Skip to content

Commit

Permalink
Set fixed length for external identifier validation
Browse files Browse the repository at this point in the history
  • Loading branch information
samgibsonmoj authored and carlsixsmith-moj committed Aug 20, 2024
1 parent d408a2d commit 95046e4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ public CandidateSearchQueryValidator()

RuleFor(q => q.ExternalIdentifier)
.NotEmpty()
.NotNull()
.WithMessage("External identifier is required")
.Matches(ValidationConstants.AlphaNumeric)
.WithMessage(string.Format(ValidationConstants.AlphaNumericMessage, "External Identifier"));
.WithMessage(string.Format(ValidationConstants.AlphaNumericMessage, "External Identifier"))
.Length(7) // CRN and NOMIS Number (both 7 chars)
.WithMessage("Unrecognised format for External Identifier");

}
}

0 comments on commit 95046e4

Please sign in to comment.