...
validate person.id UUID
in case error return 422
404
search person by person.id in MPI MPI or person.is_active = false
in case error return 422
404
, "Such person doesn't exist"
validate that person is active ( person.status = active)
in case error return
422
, "Such person isn't active"
validate that auth_method is active ( person.auth_method.ended_at > now())
in case error return
422
, “Authentication method isn’t active”
Search auth requests by person id
...
if type = OTP ,
phone_number
is required andvalue
shouldn’t be set. And fieldalias
is optional.validate that person.age >global_parameters.no_self_auth_age
Verificate that il.authentication_method_request.authentication_method.phone_number is in DB.VERIFICATION.VERIFIED_PHONES
if type = OFFLINE ,
phone_number
andvalue
shouldn’t be set . And fieldalias
is optional.validate that person.age > global_parameters.no_self_auth_age
if type = THIRD_PERSON,
value
,phone_number
,alias
are required.if type = THIRD_PERSON - Validate
phone_number
with mpi.person_auth_method.phone_number where mpi.person_auth_method.person_id = auth_method_request.authentication_method.value
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 auth method OTP or OFFLINE"
validate that person hasn’t this third_person isn’t already as third_person
Set auth_method_current
Set default auth method of person on IL.auth_method_request.auth_method_current - use function in mpi, that return default auth method.
Validate that auth_method_current !=NA if
action = deactivate
action = update
action = insert and type= THIRD_PERSON
else errror - “
person authentication method is undefined
“
Generate verification code
...