Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. validate authentication_methods.id belong to this person. Search auth method of this person where  MPI.person_authentication_method.person_id = $.person.id

    1. in case error return 422, "such authentication method does not belong to this person"

  2. set it default only for auth_method.type = THIRTHIRD_PERSON

  3. optional field default must be only = TRUE

  4. alias and default is optiomal, but minimum one of two filds is required.

if action = insert

  1. if type = OTP or OFFLINE , phone_number is required and don’t set value value shouldn’t be set. And field alias is optional.

  2. if type = OFFLINE , phone_numberand value shouldn’t be set . And field alias is optional.

  3. if type = THIRD_PERSON, value is required and don’t set phone_numbershouldn’t be set. And field alias is required.

  4. validate value:

    1. validate person.id is UUID

      • in case error return 422

    2. search person by person.id in MPI 

      • in case error return 422, "such person doesn't exist"

    3. search person by person.id in MPI 

      • in case error return 422, "third person must be active"

    4. search third_person.age > 18 years:

      • in case error return 422, "third person must be adult"

    5. 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 = insertauth_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)

...

Code Block
curl -X POST \
  http://localhost:4000/verifications \
  -H 'content-type: application/json' \
  -d '{
  "phone_number": "+380936235985"
}'

Generate upload URL

Where If auth_method_requests.auth_method_current = OFFLINE 

...