/
RC_(CSI-1323)_Resend Authorization OTP on Confidant Person relationship

ЕСОЗ - публічна документація

RC_(CSI-1323)_Resend Authorization OTP on Confidant Person relationship

Purpose

This method is used when you need to resend SMS to a confidant person.

Specification

Apiary

Authorization

  • Verify the validity of access token

    • Return (401, 'Invalid access token') in case of validation fails

  • Verify that token is not expired

    • in case of error - return (401, 'Invalid access token')

  • Check user scopes in order to perform this action (scope = confidant_person_relationship_request:write)

    • Return (403, 'Your scope does not allow to access this resource. Missing allowances: confidant_person_relationship_request:write') in case of invalid scope(s)

Validation

Validate Person

  • Get person_id from URL

  • Validate person status is active (status = ‘active' & is_active = 'true’)

    • in case of error - return 404 ('Person is not found')

Validate request

  • Check that confidant person relationship request from URL exists in https://e-health-ua.atlassian.net/wiki/spaces/CSI/pages/17613422609/IL#confidant_person_relationship_requests table with person_id = person_id from URL

    • in case of error - return 404 ('Confidant person relationship request is not found')

  • Check that confidant person relationship request from URL has status = NEW

    • in case of error - return 409 ('Invalid transition')

  • Check that authentication method current type for request equals to OTP

    • in case of error - return 409 ('Auth method is not OTP')

Service Logic

Generate verification code

Get template for OTP SMS from CONFIDANT_PERSON_RELATIONSHIP_SMS_TEMPLATE config parameter.

Invoke Initialize OTP to generate one time password and send it to confidant persons number that is stored in authentication_method_current.phone_number

Render a response

Render a response according to specification.

Related content

ЕСОЗ - публічна документація