ЕСОЗ - публічна документація

RCC_(GraphQL) Update Confidant person relationship (DRACS2-105)

Status transitions

Allowed confidant person relationship verification status transitions for method:

  • from verification_status = NOT_VERIFIED and verification_reason = AUTO to verification_status = IN_REVIEW and verification_reason = MANUAL

  • from any verification_status to verification_status=VERIFICATION_NEEDED and verification_reason=ONLINE_TRIGGERED MANUAL

  • from verification_status = IN_REVIEW and verification_reason = MANUAL to verification_status = NOT_VERIFIED and verification_reason = MANUAL with required verification_comment

  • from verification_status = IN_REVIEW and verification_reason = MANUAL to verification_status = VERIFIED and verification_reason = MANUAL with required dracs_birth_act_id

 

Service logic

  1. Update confidant person relationship based on submitted data:

    1. if verificationStatus, verificationReason and verificationComment submitted, set fields in confidant_person_relationship table (mpi database):

      1. verification_status = $.verification_status

      2. verification_comment = $.verification_comment

      3. verification_reason = $.verification_reason

      4. unverified_at = now() (if $.verification_status <> NOT_VERIFIED)

      5. dracs_birth_synced_at = null (if $.verification_status = VERIFICATION_NEEDED and $.verification_reason = ONLINE_TRIGGERED MANUAL)

      6. dracs_birth_act_id = $.dracs_birth_act_id

      7. updated_by = user_id (from token)

      8. updated_at = current timestamp

    2. if documentsRelationship submitted, set fields in confidant_person_relationship_documents table (mpi database) for document type = BIRTH_CERTIFICATE and confidant_person_relationship_id = $.confidantPersonRelationshipId:

      1. number = $.documentNumber

      2. issued_at = $.issuedAt (if exists in request, else skip update)

      3. issued_by = $.issuedBy (if exists in request, else skip update)

      4. updated_by = user_id (from token)

      5. updated_at = current timestamp

  2. In case if $.verification_status = VERIFIED - check existence of confidant person relationships verification candidates (where confidant_person_relationship_id == $.confidant_person_relationship_id and entity_type = ‘dracs_birth_act’ and status = ‘NEW’) in confidant_person_relationship_verification_candidates table (mpi database), if found - update them, set values:

    1. status = CONFIRMED

    2. updated_at = current timestamp

  3. Render a response according to specification.

ЕСОЗ - публічна документація