...
validate authentication_methods.id belong to this person. Search auth method of this person where MPI.person_authentication_method.person_id = $.person.id
in case error return 422, "such authentication method does not belong to this person"
set it
default
only for auth_method.type = THIRTHIRD_PERSONoptional field
default
must be only = TRUEalias
anddefault
is optiomal, but minimum one of two filds is required.
if action = insert
if type = OTP or OFFLINE ,
phone_number
is required and don’t setvalue
value
shouldn’t be set. And fieldalias
is optional.if type = OFFLINE ,
phone_number
andvalue
shouldn’t be set . And fieldalias
is optional.if type = THIRD_PERSON,
value
is required and don’t setphone_number
shouldn’t be set. And fieldalias
is required.validate value:
validate person.id is UUID
in case error return 422
search person by person.id in MPI
in case error return 422, "such person doesn't exist"
search person by person.id in MPI
in case error return 422, "third person must be active"
search third_person.age > 18 years:
in case error return 422, "third person must be adult"
validate third_person.auth_method !=N/A
in case error return 422, "third person must has ayjth auth method OTP or OFFLINE"
Set auth_method_current
Set default auth method of person on IL.auth_method_request.auth_method_current - use function in mpi, that returm default auth method.
Generate verification code
If action = insert
auth_method_requests.auth_method_current = OTP
Invoke Initialize OTP to generate one time password and send it where auth_method_requests.auth_method_current = OTP. (Use function in mpi, that returm default auth method)
...
|
Generate upload URL
Where If auth_method_requests.auth_method_current = OFFLINE
...