Table of Contents |
---|
Purpose
This WS is designed to resend sms with OTP-code to the person’s verified phone on device request in case OTP wasn’t delivered in first time.
...
Page Properties | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
|
Logic
API paragraph not found
...
Get person's authentication_method of MPI
If authentication_method == OTP :or THIRD_PERSON (with OTP)
if device_request has a program specified
Generate text SMS with template
CREATE_DEVICE_REQUEST_SMS_TEMPLATE
.
enrich template with data from Device Request: request_number, verification_code
if device_request has no program specified
Generate text SMS with template
СREATE_DEVICE_REQUEST_SMS_TEMPLATE_WITHOUT_CODE
.enrich template with data from Device Request: request_number
Call SMS timeout procedure to check if resending is allowed using:
- DR_MAX_ATTEMPTS_COUNT as MAX_ATTEMPTS_COUNT
- DR_SEND_TIMEOUT as SEND_TIMEOUT
- "device_request" as entity_name
- device_request_id as entity_idin case of error - return 429 ("Sending SMS timeout. Try later. Next attempt will be available at <attempts.oldest.value + SEND_TIMEOUT>")
Check if sms notifications are enabled:
if device_request has a program specified
in case of an error check that the specified program has setting
request_notification_disabled
set in false or the setting is absentreturn an error 409 "Action is not allowed for the specified medical program"
if device_request has no program specified
check config parameter
DEVICE_REQUESTS_SMS_ENABLED
is set in trueelse return an error 409 “Action is disabled by the configuration”
Send SMS to a person
Response structure
...