-
Notifications
You must be signed in to change notification settings - Fork 0
feat: admin can update LTFT WTE and Start Date #784
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
60dea3e to
d932e16
Compare
To avoid slow un-submit -> re-submit processes for minor changes which have been agreed between admins and trainees, a PATCH endpoint should be added to allow admins to make limited changes to LTFT applications. Currently admins should only be able to perform a `replace` on `/change/wte` and `/change/startDate`. Any other patch attempts will fail. An admin triggered patch is considered a shortcut for unsubmit and re-submit and as such will trigger a revision increment and history update. The form will stay in the `SUBMITTED` state but will have the revision incremented, last modified information updated and a snapshot taken for the `LtftSubmissionHistory`. TIS21-8201 TIS21-8219 TIS21-8212
Add additional validation steps to ensure that applied LTFT patches do not make the application invalid. Due to the entity <-> DTO conversion the `Update` validation group can not be used without further changes, as the revision will default to `0` instead of `null` and always fail. So the default validation group is used. The default validation group is likely fine for the LTFT content, however LTFT content does not actually have any validation rules. So a simple validation of the WTE maximum value of `1.0` has been added, allowing testing of patched data validation. TIS21-8201 TIS21-8219
The form revision is not correctly incremented when applying an LTFT patch, both the status and form root must have the incremented revision set. TIS21-8201
825ebc7 to
50852ac
Compare
When the applied patch does not actually change the content e.g. it sets the same values, or the patch is received multiple times, then the application should not be revised or snapshotted. TIS21-8201 TIS21-8219 TIS21-8212
Add some missing javadoc and format some code which flagged up code smells. TIS21-8201
50852ac to
6f2b393
Compare
|
|
I've kicked the tires on this locally and it seems fine (different types of invalid input, valid input, unchanged input). The snapshotting seems to work when required. It will be good to figure out a more standardised way of handling the validation, so we can move the hardcoded validation out of the resource code. One thing I wasn't sure of was the update to the PDF. Since I don't think we publish the form update, I don't see where that is triggered. |
|
Tbh, the ticket is a little vague on what notifications should be triggered by this admin update, so maybe we need to confirm that side of things to know whether we should publish the form update or bypass it and recreate the PDF outside of that process. |
|
I'll take a look at the PDF as a separate PR, I was working on the assumption it was just an on-demand download that would be handled and didn't test that part out. As far as general notifications, there is a separate ticket for that (to cover off content changes properly) so I've avoided (I think) triggering anything here. |
It can be done sensibly enough using annotations in the DTO, I started implementing it by expanding the existing JSON Views and then checking fields have a |



To avoid slow un-submit -> re-submit processes for minor changes which have been agreed between admins and trainees, a PATCH endpoint should be added to allow admins to make limited changes to LTFT applications. Currently admins should only be able to perform a
replaceon/change/wteand/change/startDate. Any other patch attempts will fail.An admin triggered patch is considered a shortcut for unsubmit and re-submit and as such will trigger a revision increment and history update.
The form will stay in the
SUBMITTEDstate but will have the revision incremented, last modified information updated and a snapshot taken for theLtftSubmissionHistory.Due to the entity <-> DTO conversion the
Updatevalidation group can not be used to validate the patched LTFT form without further changes, as the revision will default to0instead ofnulland always fail. So theDefaultvalidation group is used.The default validation group is likely fine for the LTFT content, however LTFT content does not actually have any validation rules. So a simple validation of the WTE maximum value of
1.0has been added, allowing testing of patched data validation.TIS21-8201
TIS21-8219
TIS21-8212