Browse Source

[fix]调整Validator

master
jiargcnXPS 3 years ago
parent
commit
dd85f33278
  1. 5
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDtoValidator.cs
  2. 10
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/CreatePurchaseOrderDetailValidator.cs
  3. 14
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDtoValidator.cs
  4. 18
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDtoValidator.cs
  5. 6
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDtoValidator.cs
  6. 16
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/UnplannedReceiptCreateDtoValidator.cs

5
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDtoValidator.cs

@ -7,10 +7,10 @@ public class PartCreateDtoValidator : AbstractValidator<PartCreateDto>
public PartCreateDtoValidator() public PartCreateDtoValidator()
{ {
RuleFor(x => x.Code).MaximumLength(64).NotEmpty(); RuleFor(x => x.Code).MaximumLength(64).NotEmpty();
RuleFor(x => x.Name).MaximumLength(64).NotEmpty(); RuleFor(x => x.Name).MaximumLength(64).NotNull();
RuleFor(x => x.Desc1).MaximumLength(1024); RuleFor(x => x.Desc1).MaximumLength(1024);
RuleFor(x => x.Desc2).MaximumLength(1024); RuleFor(x => x.Desc2).MaximumLength(1024);
RuleFor(x => x.Status).MaximumLength(64).NotEmpty(); RuleFor(x => x.Status).MaximumLength(64).NotNull();
RuleFor(x => x.IsMakePart).NotNull(); RuleFor(x => x.IsMakePart).NotNull();
RuleFor(x => x.IsBuyPart).NotNull(); RuleFor(x => x.IsBuyPart).NotNull();
RuleFor(x => x.Uom).MaximumLength(64).NotNull(); RuleFor(x => x.Uom).MaximumLength(64).NotNull();
@ -22,5 +22,6 @@ public class PartCreateDtoValidator : AbstractValidator<PartCreateDto>
RuleFor(x => x.Version).MaximumLength(64); RuleFor(x => x.Version).MaximumLength(64);
RuleFor(x => x.Site).MaximumLength(64).NotEmpty(); RuleFor(x => x.Site).MaximumLength(64).NotEmpty();
RuleFor(x => x.Company).MaximumLength(64).NotEmpty(); RuleFor(x => x.Company).MaximumLength(64).NotEmpty();
RuleFor(x => x.TraceId).MaximumLength(64).NotEmpty();
} }
} }

10
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/CreatePurchaseOrderDetailValidator.cs

@ -6,13 +6,13 @@ public class CreatePurchaseOrderDetailValidator : AbstractValidator<PurchaseOrde
{ {
public CreatePurchaseOrderDetailValidator() public CreatePurchaseOrderDetailValidator()
{ {
RuleFor(q => q.PoNumber).NotEmpty().MaximumLength(64); RuleFor(q => q.PoNumber).MaximumLength(64).NotEmpty();
RuleFor(q => q.PoLine).NotEmpty().MaximumLength(64); RuleFor(q => q.PoLine).MaximumLength(64).NotNull();
RuleFor(q => q.PartCode).NotEmpty().MaximumLength(64); RuleFor(q => q.PartCode).MaximumLength(64).NotEmpty();
RuleFor(q => q.Uom).NotEmpty().MaximumLength(64); RuleFor(q => q.Uom).MaximumLength(64).NotNull();
RuleFor(q => q.OrderQty).NotNull(); RuleFor(q => q.OrderQty).NotNull();
RuleFor(q => q.StdPackQty).NotNull(); RuleFor(q => q.StdPackQty).NotNull();
RuleFor(q => q.SupplierPackConvertRate); RuleFor(q => q.SupplierPackConvertRate).NotNull();
RuleFor(q => q.IsConsignment).NotNull(); RuleFor(q => q.IsConsignment).NotNull();
RuleFor(q => q.LineStatus).NotNull(); RuleFor(q => q.LineStatus).NotNull();
RuleFor(q => q.Remark).MaximumLength(4096); RuleFor(q => q.Remark).MaximumLength(4096);

14
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDtoValidator.cs

@ -6,19 +6,21 @@ public class PurchaseOrderCreateDtoValidator : AbstractValidator<PurchaseOrderCr
{ {
public PurchaseOrderCreateDtoValidator() public PurchaseOrderCreateDtoValidator()
{ {
RuleFor(q => q.PoNumber).MaximumLength(64); RuleFor(q => q.PoNumber).MaximumLength(64).NotEmpty();
RuleFor(q => q.SupplierCode).NotEmpty().MaximumLength(64); RuleFor(q => q.SupplierCode).MaximumLength(64).NotEmpty();
RuleFor(q => q.PoType).NotEmpty().MaximumLength(64); RuleFor(q => q.PoType).MaximumLength(64).NotNull();
RuleFor(q => q.Status).NotNull(); RuleFor(q => q.Status).NotNull();
RuleFor(q => q.IsConsignment).NotNull(); RuleFor(q => q.IsConsignment).NotNull();
RuleFor(q => q.OrderDate).NotNull(); RuleFor(q => q.OrderDate).NotNull();
RuleFor(q => q.DueDate).NotNull(); RuleFor(q => q.DueDate).NotNull();
RuleFor(q => q.Version).NotNull().MaximumLength(64); RuleFor(q => q.Version).MaximumLength(64).NotNull();
RuleFor(q => q.TaxRate).NotNull(); RuleFor(q => q.TaxRate).NotNull();
RuleFor(q => q.Site).NotEmpty().MaximumLength(64); RuleFor(q => q.Site).MaximumLength(64).NotEmpty();
RuleFor(q => q.Company).NotEmpty().MaximumLength(64); RuleFor(q => q.Company).MaximumLength(64).NotEmpty();
RuleFor(q => q.ContactName).MaximumLength(64); RuleFor(q => q.ContactName).MaximumLength(64);
RuleFor(q => q.ContactPhone).MaximumLength(64); RuleFor(q => q.ContactPhone).MaximumLength(64);
RuleFor(q => q.Remark).MaximumLength(4096); RuleFor(q => q.Remark).MaximumLength(4096);
RuleFor(x => x.TraceId).MaximumLength(64).NotEmpty();
} }
} }

18
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDtoValidator.cs

@ -6,24 +6,26 @@ public class ReceiptCreateDtoValidator : AbstractValidator<ReceiptCreateDTO>
{ {
public ReceiptCreateDtoValidator() public ReceiptCreateDtoValidator()
{ {
RuleFor(q => q.RcNumber).NotEmpty().MaximumLength(64); RuleFor(q => q.RcNumber).MaximumLength(64).NotEmpty();
RuleFor(q => q.AsnNumber).MaximumLength(64); RuleFor(q => q.AsnNumber).MaximumLength(64);
RuleFor(q => q.PoNumber).MaximumLength(64); RuleFor(q => q.PoNumber).MaximumLength(64);
RuleFor(q => q.SupplierCode).NotEmpty().MaximumLength(64); RuleFor(q => q.SupplierCode).MaximumLength(64).NotEmpty();
RuleFor(q => q.RcType).NotNull().MaximumLength(64); RuleFor(q => q.RcType).MaximumLength(64).NotNull();
RuleFor(q => q.Warehouse).MaximumLength(64); RuleFor(q => q.Warehouse).MaximumLength(64);
RuleFor(q => q.Dock).MaximumLength(64); RuleFor(q => q.Dock).MaximumLength(64);
RuleFor(q => q.ReceiveDate).NotNull(); RuleFor(q => q.ReceiveDate).NotNull();
RuleFor(q => q.ReceiveTime); RuleFor(q => q.ReceiveTime);
RuleFor(q => q.PoLine).MaximumLength(64); RuleFor(q => q.PoLine).MaximumLength(64);
RuleFor(q => q.PartCode).NotEmpty().MaximumLength(64); RuleFor(q => q.PartCode).MaximumLength(64).NotEmpty();
RuleFor(q => q.Lot).NotNull().MaximumLength(64); RuleFor(q => q.Lot).MaximumLength(64).NotNull();
RuleFor(q => q.SupplierLot).NotNull(); RuleFor(q => q.SupplierLot).NotNull();
RuleFor(q => q.Uom).NotNull().MaximumLength(64); RuleFor(q => q.Uom).MaximumLength(64).NotNull();
RuleFor(q => q.ReceiveQty).NotNull(); RuleFor(q => q.ReceiveQty).NotNull();
RuleFor(q => q.SupplierPackConvertRate).NotNull(); RuleFor(q => q.SupplierPackConvertRate).NotNull();
RuleFor(q => q.Remark).MaximumLength(4096); RuleFor(q => q.Remark).MaximumLength(4096);
RuleFor(q => q.Site).NotEmpty().MaximumLength(64); RuleFor(q => q.Site).MaximumLength(64).NotEmpty();
RuleFor(q => q.Company).NotEmpty().MaximumLength(64); RuleFor(q => q.Company).MaximumLength(64).NotEmpty();
RuleFor(x => x.TraceId).MaximumLength(64).NotEmpty();
} }
} }

6
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDtoValidator.cs

@ -8,7 +8,7 @@ public class SupplierCreateDtoValidator : AbstractValidator<SupplierCreateDTO>
{ {
RuleFor(x => x.Code).MaximumLength(64).NotEmpty(); RuleFor(x => x.Code).MaximumLength(64).NotEmpty();
RuleFor(x => x.Name).MaximumLength(64).NotEmpty(); RuleFor(x => x.Name).MaximumLength(64).NotNull();
RuleFor(x => x.Desc).MaximumLength(1024); RuleFor(x => x.Desc).MaximumLength(1024);
RuleFor(x => x.Rank).MaximumLength(64); RuleFor(x => x.Rank).MaximumLength(64);
RuleFor(x => x.Address).MaximumLength(1024); RuleFor(x => x.Address).MaximumLength(1024);
@ -21,7 +21,9 @@ public class SupplierCreateDtoValidator : AbstractValidator<SupplierCreateDTO>
RuleFor(x => x.Bank).MaximumLength(64); RuleFor(x => x.Bank).MaximumLength(64);
RuleFor(x => x.Currency).MaximumLength(64); RuleFor(x => x.Currency).MaximumLength(64);
RuleFor(x => x.IsActive).NotNull(); RuleFor(x => x.IsActive).NotNull();
RuleFor(x => x.Company).MaximumLength(1024); RuleFor(x => x.Company).MaximumLength(1024).NotEmpty();
RuleFor(x => x.Remark).MaximumLength(4096); RuleFor(x => x.Remark).MaximumLength(4096);
RuleFor(x => x.TraceId).MaximumLength(64).NotEmpty();
} }
} }

16
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/UnplannedReceiptCreateDtoValidator.cs

@ -7,18 +7,20 @@ public class UnplannedReceiptCreateDtoValidator : AbstractValidator<UnplannedRec
public UnplannedReceiptCreateDtoValidator() public UnplannedReceiptCreateDtoValidator()
{ {
RuleFor(q => q.TrNbr).NotNull(); RuleFor(q => q.TrNbr).NotNull();
RuleFor(q => q.TrType).NotNull().MaximumLength(8); RuleFor(q => q.TrType).MaximumLength(8).NotNull();
RuleFor(q => q.Order).MaximumLength(64); RuleFor(q => q.Order).MaximumLength(64);
RuleFor(q => q.Location).NotNull().MaximumLength(8); RuleFor(q => q.Location).MaximumLength(8).NotNull();
RuleFor(q => q.EffectiveDate).NotNull(); RuleFor(q => q.EffectiveDate).NotNull();
RuleFor(q => q.SystemDate).NotNull(); RuleFor(q => q.SystemDate).NotNull();
RuleFor(q => q.PartCode).NotEmpty().MaximumLength(18); RuleFor(q => q.PartCode).MaximumLength(18).NotEmpty();
RuleFor(q => q.Lot).NotNull().MaximumLength(64); RuleFor(q => q.Lot).MaximumLength(64).NotNull();
RuleFor(q => q.Uom).NotNull().MaximumLength(8); RuleFor(q => q.Uom).MaximumLength(8).NotNull();
RuleFor(q => q.Qty).NotNull(); RuleFor(q => q.Qty).NotNull();
RuleFor(q => q.SoJob).MaximumLength(20); RuleFor(q => q.SoJob).MaximumLength(20);
RuleFor(q => q.Remark).MaximumLength(4096); RuleFor(q => q.Remark).MaximumLength(4096);
RuleFor(q => q.Site).NotEmpty().MaximumLength(8); RuleFor(q => q.Site).MaximumLength(8).NotEmpty();
RuleFor(q => q.Company).NotEmpty().MaximumLength(8); RuleFor(q => q.Company).MaximumLength(8).NotEmpty();
RuleFor(x => x.TraceId).MaximumLength(64).NotEmpty();
} }
} }
Loading…
Cancel
Save