Versions Compared

Key

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

...

Code Block
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
  "action": "update",
  "authentication_method": {
    "id": "057413fb-2c2e-4f33-b2d6-433469212744",
    "alias": "roksolana",

   "default": "true"
    }
  }
}

if action = insert

Code Block
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
  "action": "insert",
  "authentication_method": {
    "type": "THIRD_PERSON",
    "value": "d12888c0-1159-4296-8f03-a592c136f673",
    "phone_number` : "+380656779678",
    "alias": "roksolana"
    }
  }
}

...

  1. Field type must be THIRD_PERSON. (where person_auth_method.id = $authentication_method.id)

    1. check this auth_method .default=Falseis not primary

if action = update

  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 default only for auth_method.type = THIRD_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

...

Set default auth method of person on IL.auth_method_request.auth_method_current - use function in mpi, that return default primary 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

...