...
if exists return 422 - message 'Declaration with the same declaration_number is already exist in DB'
Update declaration request:
Change entity status in IL_DB.declaration_request to SIGNED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Save signed declaration to media storage
Get url for declaration upload.
Use Request a Secret WSParameter
Source
action'GET'bucket'DECLARATIONS'resource_id: DECLARATION_IDresource_name: DECLARATION_NAME
Upload signed declaration to media storage
Update declaration request:
Change entity status in IL_DB.declaration_request to SIGNED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Get active declarations
Search for active declarations using MPI ID
...
Check authentication_method_current
Code Block SELECT authentication_method_current FROM declaration_requests WHERE id = {:id}
If "type" = "OFFLINE"
set declaration status to "PENDING_VERIFICATION"
set reason to 'offline'
if "type" = "OTP" - set declaration status to "ACTIVE"
Check persons 'no_tax_id' flag
if 'no_tax_id'=true
set declaration status to "PENDING_VERIFICATION"
set reason to 'no_tax_id'
Create a new declaration by adding a new entity to the declarations table ops_db without declaration_id.
if there is existing record in the declarations table with the same id and declaration_request_id, return ok to IL
Mapping:
...
Update declaration request:
...