Table of Contents |
---|
...
Page Properties | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
|
Preconditions
Before this the contract request should be created from MSP/PHARAMCY side and NHS employee should be appointed
...
Request to process the request using a token in the headers
Headers
Наприклад:
Content-Type:application/json
...
Validate contract request id exists in DB
in case error return 404 ("Contract request with id=$id doesn't exist")
Validate request according to json schema
in case error return 422 ("validation failed")
Validate OPS.contract_request.contract_type == $.contract_type
in case of error return 409 ("Contract_type does not correspond to previously created content")
validate nhs_contract_price
in case contract_type =` REIMBURSEMENT` nhs_contract_price shouldn`t be submitted
in case of error return 409 - "nhs_contract_price is unavailable for reimbursement contract requests`
nhs_contract_price should be >= 0
in case error return 422 ("Contract price could not be negative")
Validate $nhs_signer_id: fetch prm.employees.id=$nhs_signer_id
check client_id=prm.employees.legal_entity_id
in case of error return 422 Error (Employee doesn't belong to legal_entity)
check status='APPROVED' and is_active=true
in case of error return 422 Error (Employee must be active)
Processing
API paragraph not foundFill the fields of contract_request in DB with information from request and from employee token:
field | value |
---|---|
contract_requests.nhs_signer_id | $nhs_signer_id |
contract_requests.nhs_legal_entity_id | $client_id |
contract_requests.nhs_signer_base | $.nhs_signer_base |
contract_requests.issue_city | $.issue_city |
contract_requests.nhs_contract_price | $.nhs_contract_price |
contract_requests.nhs_payment_method | $.nhs_payment_method |
contract_requests.updated_by | $.user_id |
contract_requests.updated_at | now() |
Response structure
Expand | ||
---|---|---|
|
...