ЕСОЗ - публічна документація
(GraphQL) Update Legal Entity status
Purpose
This WS is designed to allow NHS employee with assigned appropriate scopes to verify for new Legal Entities or if the Legal Entity data or its license was changes.
Key points
This is a graphQl query method used in Administration panel only.
Only authenticated and authorized NHS employee with appropriate scope can verify Legal Entity.
Specification
Authorize
Verify the validity of access token
Return
401
in case validation fails
Verify that token is not expired
in case of error - return (
401
, 'Invalid access token')
Check user scopes
legal_entity:update
in order to search personIn case of invalid scope, return: "
You don't have permission to access this resource
“
Validate request
Check Legal entity status (
"ACTIVE"
or"SUSPENDED"
)in case of error - return (
"Incorrect status transition."
)
If new le.status =
"ACTIVE"
check license expiry date whereexpiry_date
>today_date
orexpiry_date
= nullin case of error - return (
"Legal entity license should not be expired."
)
Check contracts legal entity where
contract. status =
allowed_statuses_for_termination
[new, in_process, approved, nhs_signed, pending_nhs_sign]
Processing
Update LE nhs_verified
Update LE (PRM)
set status
set reason
set status_reason
for le.status =
"SUSPENDED"
status_reason:"MANUAL_LEGAL_ENTITY_STATUS_UPDATE"
for le.status =
"ACTIVE"
status_reason: null
For le.status =
"SUSPENDED"
setcontract.is_suspended = true
and updateupdated_by
,updated_at
Return LE details include new status
Related content
ЕСОЗ - публічна документація