SHA256
GuestDocument - Improvements to GuestDocument creation:
- IssueDate is now Nullable. Is not required for DNI and NIE document types. - Improvements in SupportNumber for NIE documents. - Address search can now be skipped.
This commit is contained in:
@@ -22,14 +22,22 @@ public class GuestDocumentDTOValidator : ValueValidator<GuestDocumentDTO>
|
||||
.Length(6, 32);
|
||||
|
||||
RuleFor(x => x.IssueDate)
|
||||
.Cascade(CascadeMode.Stop)
|
||||
.NotEmpty()
|
||||
.When(x => x.Nationality != GuestConsts.CountryCode_ESP)
|
||||
.LessThanOrEqualTo(DateTime.Today);
|
||||
|
||||
RuleFor(x => x.SupportNum)
|
||||
.Cascade(CascadeMode.Stop)
|
||||
.NotEmpty()
|
||||
.Matches(RegexUtils.RegexGuestDocSuportNumber()).WithMessage("Invalid Format. Expected 'AAA000000'.")
|
||||
.When(x => x.Nationality == GuestConsts.CountryCode_ESP);
|
||||
.Matches(RegexUtils.RegexGuestDocSupportNumberDNI()).WithMessage("Invalid Format for DNI. Expected 'AAA000000'.")
|
||||
.When(x => x.DocumentType == GuestConsts.DocumentType_DNI);
|
||||
|
||||
RuleFor(x => x.SupportNum)
|
||||
.Cascade(CascadeMode.Stop)
|
||||
.NotEmpty()
|
||||
.Matches(RegexUtils.RegexGuestDocSupportNumberNIE()).WithMessage("Invalid Format for NIE. Expected 'E00000000'.")
|
||||
.When(x => x.DocumentType == GuestConsts.DocumentType_NIE);
|
||||
|
||||
RuleFor(x => x.Name)
|
||||
.NotEmpty()
|
||||
|
||||
Reference in New Issue
Block a user