feat(store): auto-generate store code on create and make update code optional
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 44s
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 44s
This commit is contained in:
@@ -15,7 +15,6 @@ public sealed class CreateStoreCommandValidator : AbstractValidator<CreateStoreC
|
||||
{
|
||||
// 1. 校验核心字段
|
||||
RuleFor(command => command.Name).NotEmpty().MaximumLength(128);
|
||||
RuleFor(command => command.Code).NotEmpty().MaximumLength(32);
|
||||
RuleFor(command => command.ContactPhone).NotEmpty().MaximumLength(32);
|
||||
RuleFor(command => command.ManagerName).NotEmpty().MaximumLength(64);
|
||||
RuleFor(command => command.Address).NotEmpty().MaximumLength(256);
|
||||
|
||||
@@ -16,7 +16,10 @@ public sealed class UpdateStoreCommandValidator : AbstractValidator<UpdateStoreC
|
||||
// 1. 校验标识与核心字段
|
||||
RuleFor(command => command.Id).GreaterThan(0);
|
||||
RuleFor(command => command.Name).NotEmpty().MaximumLength(128);
|
||||
RuleFor(command => command.Code).NotEmpty().MaximumLength(32);
|
||||
RuleFor(command => command.Code)
|
||||
.NotEmpty()
|
||||
.MaximumLength(32)
|
||||
.When(command => command.Code is not null);
|
||||
RuleFor(command => command.ContactPhone).NotEmpty().MaximumLength(32);
|
||||
RuleFor(command => command.ManagerName).NotEmpty().MaximumLength(64);
|
||||
RuleFor(command => command.Address).NotEmpty().MaximumLength(256);
|
||||
|
||||
Reference in New Issue
Block a user