Requirements
This method allows to resend sms with OTP-code to the person’s verified phone. Used on verify approval method in case OTP wasn’t delivered in first time.
Specification
Validations
Authorization
- Verify the validity of access token
- Return 401 in case of validation fails
- Check user scope approval:create in order to perform this action
- Return 403 in case of invalid scope
Validate authentication method
- Resend SMS on Approval is allowed for person_authentication_method which was specified on Create Approval in the authorize_with field.
- Return 409 in case of validation fails (message "Resend SMS is not allowed for this authentication method")
Service Logic
- Search for approval by patient_id + approval_id
- Validate person by patient.id
- In case error return 404 (message "Person not found")
- Validate approval by approval.id
- In case error return 404 (message "Approval with such id is not found")
- Validate person by patient.id
- Send SMS with OTP-code to persons phone from approvals.urgent.phone_number