Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Purpose

This web service is design designed to change contract request by nhs employee. NHS employee should enrich contract request with information about itself, sum and place of the contract request and could change status of the contract request. 

Overview

  • NHS employee with scopes 'contract_requests:update' can change contract request
  • Contract request only in status 'NEW' could be changed. 
  • NHS employee can change only several field of the contract request and but not all of them

Specification

...

Request

Validation

Validate token

  • Verify the validity of access token
    • Return 401 in case validation fails
  • token is not expired
    • in case error return 401 - "Token is expired"

...

  • Check if user is active
    • in case error return 403 - (user is not active)
  • check nhs_legal_entity is active
    • in case error return 403 - (Client is not active)

Validate scopes

  • Check user scopes in order to perform this action (scope = 'contract_requests:update')
    • Return 403 in case invalid scope(s) 

...

  • Only next field could be changed by nhs employee
    • issue_city = nhs_le City, where address_type=REGISTRATION
    • nhs_base - що діє на підставі
    • price - Загальна орієнтовна Ціна Договору
    • status (enum)Approved or Declined)
    • status_reason

Response

Generate Printout form 

If status is changed to APPROVED - generate printout form

Invoke MAN to render print form.

Request mapping:

Parameter
Source
idCONTRACT_REQUEST

...

Code Block
titleCurl example
curl --request POST \
     --header 'Accept: text/html' \
     --header 'Content-Type: application/json' \
     {:host}/templates/{:contract_printout_id}/actions/render

Set IL.contract_request.printout_content:


MANResponse.$.data

Add to evemt manager

if status was changed (status = APPROVED, DECLINED or SIGNED) - add new status to event_manager

fieldvalue
event_typeStatusChangeEvent
entity_typeContract_request
entity_id$.id
properties.status.new_value$.status
event_time$.update_at
changed_by$.changed_by