Table of Contents |
---|
Specification
Authorize user
Verify the validity of access token
Return 401 in case validation fails
Check scopes in order to perform this action (scope = 'append_auth_method:write')
Return 403 in case invalid scope(s)
...
Logic
If IL_DB.authentication_method_request.status =
NEW
:
Verificate
...
sms - from third_person. Invoke verification module to verify OTP (OTP Verification)
Invoke Initialize OTP to generate one time password and
...
send it to person number. At this stage, the patients receive an SMS message.
Update authentication method request
Change entity status in IL_DB.authentication_method_request to APPROVED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
If IL_DB.authentication_method_request.status =
APPROVED
:
Verificate sms - from person. Invoke verification module to verify OTP
...
Update mpi
Add to table
person_auth_methods
row with type =third_person
, value = id (confidant_person_id), alias (from payload), is_primary = FalseStart date: start_date = Current_date()
End date:
...
if
...
(person.age
...
<
...
18)
...
{ end_date
...
=
...
min(birth_date
...
+
...
18y
...
-
...
1d,
...
start_date
...
+
...
third_person_term);}
...
else
...
{ end_date
...
=
...
start_date
...
+
...
third_person_term;}