using DS.Module.Core;
using FluentValidation;
namespace DS.WMS.Core.Code.Dtos;
///
/// 商品请求实体
///
public class CodeGoodsReq
{
///
/// 主键Id
///
public long Id { get; set; }
///
/// 商品编码
///
public string GoodsCode { get; set; }= "";
///
/// 商品名称
///
public string GoodName { get; set; }= "";
///
/// 物料号
///
public string GoodNo { get; set; }= "";
///
/// 英文名称
///
public string EnName { get; set; }= "";
///
/// 商品描述
///
public string Description { get; set; }= "";
///
/// 商品类型
///
public long GoodsTypeId { get; set; }= 0;
///
/// 计费大类
///
public long GoodsFeeTypeId { get; set; }= 0;
///
/// 海关代码
///
public string HSCode { get; set; }= "";
///
/// 申报计量单位
///
public string RuleUnit { get; set; }= "";
///
/// 法定第一计量单位
///
public string RuleUnit1 { get; set; }= "";
///
/// 法定第二计量单位
///
public string RuleUnit2 { get; set; }= "";
///
/// 状态 0 启用 1 禁用
///
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
///
/// 备注
///
public string Note { get; set; } = "";
}
///
/// 验证
///
public class CodeGoodsReqValidator : AbstractValidator
{
///
/// 构造函数
///
public CodeGoodsReqValidator()
{
this.RuleFor(o => o.GoodsCode)
.NotEmpty().WithName("商品编码");
this.RuleFor(o => o.GoodName)
.NotEmpty().WithName("商品名称");
}
}