-
Notifications
You must be signed in to change notification settings - Fork 0
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
Induction edit start date #1779
base: main
Are you sure you want to change the base?
Conversation
if (StartDate < new DateOnly(1999, 5, 7)) // CML TODO - business logic - move | ||
{ | ||
ModelState.AddModelError(nameof(StartDate), "The induction start date cannot be before 7th May 1999"); | ||
} |
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.
Validation logic to be added to person
? Not sure I can add it to the ValidateInductionData
method because that's being used for updating the cpd induction data which I guess might have dates prior to 7th may 1999?
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.
We could put a staticDateOnly EarliestInductionStartDate
on Person
; we don't have a great way of sharing validation logic with Razor Pages currently.
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.
done - I might get in trouble for this though because that error string is supposed to say 7th May not 7 May. I propose to deal with that if it's mentioned and not before
The method ValidateInductionData - is that intended to be only for the API? I know this FE is updating the DB directly but I expect I'll call a validate method before I update the record from the last page of the wizard.
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.
We have UiDefaults.DateOnlyDisplayFormat
to use for date formatting.
method ValidateInductionData - is that intended to be only for the API?
Yes, we don't have a way of easily sharing validation logic across the API and the front-end currently.
Context
Edit start date https://trello.com/c/wl77dRCF/629-inductions-dev-select-start-date