...
Check it is submitted
in case of error - return 422 ('required property <name/creation_reason> was not present')
Check value is allowed according to [New] Person verification status model https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/16755458061/Person+verification+status+model+EN.
in case of error - return 422 ('value is not allowed in enum')
Check status transition allowed according to [New] Person verification status model https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/16755458061/Person+verification+status+model+EN. For transition VERIFICATION_NEEDED to IN_REVIEW it is required to have verification reason = RULES_TRIGGERED, if there are other reasons - an error should be returned.
If transition is allowed then
(if (initial
verificationStatus
=VERIFICATION_NEEDED
and (verificationReason
=RULES_PASSED
or verificationReason =INITIAL
)) thenreturn error, 409 ('Such person can't be transferred into manual verification process')
else
Ok)
else show error
return 409 ('Can\'t update verification status from <old status value> to <new status value>')
...