fix: 门店资质日期字段改为date

This commit is contained in:
2026-01-20 13:09:06 +08:00
parent de54b64efc
commit 3385674490
17 changed files with 14948 additions and 35 deletions

View File

@@ -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("证照有效期必须晚于今天");
}

View File

@@ -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("证照有效期必须晚于今天");
}