Table of Contents |
---|
Specification
...
This WS allows to terminate contract either by NHS or Legal Entity OwnerSide.
Request
- status_reason
Authorize
- Verify the validity of access token
- in case of error return 401 ('Access denied')
- Check user scope contract:termiante in order to perform this action
- in case of error generate 401 response ('Invalid scopes')
Validate User
Extract legal_entity_id (client_id) from token.
- Check client_id=contractor_legal_entity_id or client_id=nhs_legal_entity_id
- in case of error return 403 "User is not allowed to perform this action"
- Check (employees.employee_id=contractor_owner_id and client_id=employee.legal_entity_id) or (employees.employee_id=nhs_signer_id and client_id=employee.legal_entity_id)
- in case of error return 403 "User is not allowed to perform this action"
- Check client_id=contractor_legal_entity_id or client_id=nhs_legal_entity_id
Validate contract request status
...
Response
mapping
field | value |
---|---|
status | TERMINATED |
status_reason | $.status_reason |
updated_at | now() |
updated_by | $.user_id |
Auto termination
Fetch all contract with end_date<now(). Set status and status reason for such contract as below:
field | value |
---|---|
status | TERMINATED |
status_reason | $.auto_expired |
updated_at | now() |
updated_by | $.user_id |
Add status to event manager
...