-
Notifications
You must be signed in to change notification settings - Fork 2
Applied new [ValidateLaCode]
attribute to actions and controllers that consume code
#2339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3fb4bcd
to
cd8d248
Compare
1f8e820
to
853e9f2
Compare
… that consume `code`
853e9f2
to
a12d2a9
Compare
a12d2a9
to
a041d34
Compare
…Validator` instead of Regex
a041d34
to
f757c8c
Compare
RuleFor(p => p.Value) | ||
.Length(6) | ||
.When(p => p.Type == OrganisationTypes.School) | ||
.When(p => p.ValueAsInt != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would -19823 pass this validation as is? Length 6 and is a valid int?
Could use .Must(p=> p.All(char.IsDigit))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot! Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about XXXXXX? Does that pass or fail the validation?
My gut is saying that'll pass based on the 'when'. However I've not used when before so not 100% sure on the behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the other rules fails validation with Organisation identifier must be a number
for XXXXXX
…he correct length for each type
Context
AB#254608 AB#260043 #2337
Change proposed in this pull request
IValidator
Guidance to review
Dependency on #2337.
Any URL including a bad LA code should fail with
404
and the 'page not found' view. E2E/A11y should be unaffected.Checklist (add/remove as appropriate)
You have reviewed with UX/Design