Versions Compared

Key

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

Table of Contents

...

The process is initiated by any employee with necessary scopes in this legal entity and involves the transfer of a signed declaration with person with electronic digital signature. 

Process is asynchronous. If all validations are successfully completed, the asynchronous process of creating a declaration person starts by processing the message.

...

Decode content that is encrypted in an electronic digital signature.
Use Digital signature WS. Method checks digital signature and returns result.
See service specification

Validate DRFO

  1. Check that DRFO in Certificate details exists and not empty
  2. Check that DRFO in Certificate details is equal to DRFO in Party
    1. Get party.tax_id using employee_id in declaration person payload
    2. Compare DRFO in Certificate with party.tax_id
      1. Convert DRFO and TAX_ID to uppercase
      2. Compare DRFO and TAX_ID as Cyrillic letters
      3. Convert DRFO to Cyrillic and compare as Cyrillic letters
    3. In case validation fails - generate 422 error

...

  1. Validate request using JSON schema (See specification)
    1. In case validation fails - generate 422 error
  2. Check declaration person request status
    1. If status is not APPROVED, - returned error 'Incorrect status'

...

In case if they are not equal - generate 422 error (message: "Signed content does not match the previously created content")

Check employee

DeclarationPerson_request can be signed by any employee with necessery scopes in equal legal_entity_id.

  1. Extract legal_entity_id (client_id) from token
  2. Extract employee_id from request
  3. Check if $.client_id=employees.legal_entity_id 
    1. in case error return 422 

Create/update person

If person.id is in request then add mpi_id to person request. Update MPI.persons with new parameters.

If person.id is not in request then create new person (do not search again for person(declaration) in person in status ACTIVE or APPROVED)


Update person request status

...