fix: 门店资质日期字段改为date
This commit is contained in:
@@ -21,7 +21,7 @@ public sealed class CreateStoreQualificationCommandValidator : AbstractValidator
|
||||
RuleFor(x => x.DocumentNumber).MaximumLength(100);
|
||||
|
||||
RuleFor(x => x.ExpiresAt)
|
||||
.Must(date => date.HasValue && date.Value.Date > DateTime.UtcNow.Date)
|
||||
.Must(date => date.HasValue && date.Value > DateOnly.FromDateTime(DateTime.UtcNow))
|
||||
.When(x => IsLicenseType(x.QualificationType))
|
||||
.WithMessage("证照有效期必须晚于今天");
|
||||
|
||||
@@ -32,7 +32,7 @@ public sealed class CreateStoreQualificationCommandValidator : AbstractValidator
|
||||
.WithMessage("证照编号不能为空");
|
||||
|
||||
RuleFor(x => x.ExpiresAt)
|
||||
.Must(date => !date.HasValue || date.Value.Date > DateTime.UtcNow.Date)
|
||||
.Must(date => !date.HasValue || date.Value > DateOnly.FromDateTime(DateTime.UtcNow))
|
||||
.When(x => !IsLicenseType(x.QualificationType))
|
||||
.WithMessage("证照有效期必须晚于今天");
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public sealed class UpdateStoreQualificationCommandValidator : AbstractValidator
|
||||
RuleFor(x => x.DocumentNumber).MaximumLength(100).When(x => !string.IsNullOrWhiteSpace(x.DocumentNumber));
|
||||
RuleFor(x => x.SortOrder).GreaterThanOrEqualTo(0).When(x => x.SortOrder.HasValue);
|
||||
RuleFor(x => x.ExpiresAt)
|
||||
.Must(date => !date.HasValue || date.Value.Date > DateTime.UtcNow.Date)
|
||||
.Must(date => !date.HasValue || date.Value > DateOnly.FromDateTime(DateTime.UtcNow))
|
||||
.When(x => x.ExpiresAt.HasValue)
|
||||
.WithMessage("证照有效期必须晚于今天");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user