using DS.Module.Core.Extensions;
using DS.WMS.Core.FeeModule.Dtos;
using FluentValidation;
namespace DS.WMS.Core.WmsModule.Dtos;
public class WmsInPlanFeeRateInput
{
public Guid? Id { get; set; }
///
/// 明细
///
public List List { get; set; }
}
public class WmsInFeeRateDetailInput
{
public Guid? GID { get; set; }
// public Guid? ID { get; set; }
public Guid? FEERATEDETAILID { get; set; }
public string FEEMAKETYPE { get; set; } = "";
public string FEENAME { get; set; } = "";
public string DEFAULTUNIT { get; set; } = "";
public decimal? FEEPRICE { get; set; } = 0;
public byte? FEETYPE { get; set; } = 0;
public byte? FEEGRADE { get; set; } = 0;
public int? FEESCALE { get; set; } = 0;
public decimal? ADDPRICE { get; set; } = 0;
public decimal? ENDPRICE { get; set; } = 0;
public string REMARK { get; set; } = "";
public string INPUTMODE { get; set; } = "";
public Guid? GoodsFeeTypeGID { get; set; }
public string GOODSFEETYPE { get; set; }
public string FeeId { get; set; }
}
///
/// 验证
///
public class WmsInFeeRateDetailInputValidator : AbstractValidator
{
///
/// 构造函数
///
public WmsInFeeRateDetailInputValidator()
{
this.RuleFor(o => o.FEEPRICE)
.GreaterThan(0).WithMessage("计费单价必须大于0")
.Custom((price, context) =>
{
if (price.ToDecimal() < 0)
{
context.AddFailure("计费单价必须为正数!");
}
});
}
}