ЕСОЗ - публічна документація
IL.Suspend Legal Entity Type by MSP - Устарел. Не используется !
Specification
TBC
Validation
Authorization
- Verify the validity of access token
- in case of error return 401 ('Access denied')
- Check user scope legal_entity:update in order to perform this action
- in case of error generate 403 response ('Invalid scopes')
Request validation
Validate Owner
- Check that one of token.user_id employees is an OWNER of current legal_entity
- in case validation fails - generate 409 - "Only owner of legal entity can suspend legal entity"
Validate digital signature
- Validate signature
- Extract signer Certificate details
Validate encoded signed content according to JSON Schema
- Return 422 with list of validation errors in case validation fails
Validate Legal Entity
- Check that legal_entities.is_active = true and legal_entities.status = active for current legal entity
- in case of error return 409 - "legal entity is not active"
- token.Client_id must match current legal entity
- in case of error return 422
- EDRPOU for token.client_id must match EDRPOU $.legal_entity.edrpou
- in case of error return 422
Validate Tax ID
- Check that EDRPOU in Certificate details exists and not empty
- Check that EDRPOU in Certificate details is valid according to ^[0-9]{8,10}$
- Check that EDRPOU in Certificate details is equal to $.legal_entity.edrpou
- In case validation fails - generate 422 error
- If EDRPOU in Certificate details is empty check that DRFO exists and not empty
- Check that DRFO in Certificate details is valid according to ^[0-9]{9,10}$
- Check that DRFO in Certificate details is equal to $.legal_entity.edrpou
- In case validation fails - generate 422 error
- In case EDRPOU and DRFO is empty return error 422, msg "EDRPOU and DRFO is empty in digital sign"
Processing
- Set nhs_verified = false, status = 'suspended', status_reason = $.status_reason for current legal entity
- Find contracts by contractor_legal_entity_id for current legal entity where status='VERIFIED'
- set ops.contracts.is_suspended=true
- Save signed_content to Media Storage
- Save data to corresponding collections in DBs
- Save link to the signed content to the activity type
ЕСОЗ - публічна документація