entity

Recipient

A recipient (recebedor) of CNA Pay - every CPF or CNPJ enabled to receive money on the platform - a school, the franchisor, the CNA Institute or a supplier. Aggregate root of the Recipient Kafka topic, whose facts carry its public state.

Entity(Aggregate Root)

Overview

A Recipient (Recebedor) is every CPF or CNPJ enabled to receive money on CNA Pay: a school, the franchisor, the CNA Institute or a supplier. Its registry belongs to a master system, the client system that owns it (the One, or the CNA Institute), which correlates it by id and externalReference. To receive money, a recipient needs a subaccount at the payment vendor; until the vendor creates it, the recipient is ACTIVE but neither transacts nor withdraws (SUBACCOUNT_CREATING).

The events on Recipient (Kafka topic)Recipient (Kafka topic)Channelv1.0.0Kafka topic for the Recipient aggregate of CNA Pay - every CPF or CNPJ enabled to receive money on the platform. Carries...Ownercna-platformView docs carry the public state of the recipient after each change: the properties below, the same in every event, after the eventId of the event and the objectVersion of the recipient after the change. They never carry its document (CPF or CNPJ), its name or any data of its managing partner (guard-rail 9, data minimization), and a bank account in a fact is masked but for the last digits of the agency and of the account number, never with its holder or its check digits (RN-RCB-176).

The reasons that deny an answer of eligibility:

ReasonDenies
SUBACCOUNT_CREATINGTransacting and withdrawing, until the vendor creates the subaccount
SUBACCOUNT_BLOCKEDTransacting and withdrawing, while the vendor blocks the subaccount
VERIFICATION_PENDINGWithdrawing, until the verification is approved
VERIFICATION_REJECTEDTransacting and withdrawing
REGISTRY_REFUSED, REGISTRY_SUSPENDED, REGISTRY_DEREGISTEREDTransacting and withdrawing
HELD_BALANCE_CEILING_REACHEDTransacting, once the balance a recipient not approved yet holds reaches the ceiling of the network
VERIFICATION_DEADLINE_EXPIREDTransacting, once a verification in review or awaiting the recipient passes the deadline of the network
WINDING_DOWNTransacting, while the recipient winds down after a change of ownership

The topic is keyed by id, the recipient’s own identifier, so identifier and x-routing-key are the same field.

NameTypeRequiredDescriptionReference
idstringRequiredId (UUID) of the recipient in cna-pay. Kafka message key of the Recipient topic.—
externalReferencestringOptionalId of the registry in the master system, which correlates the recipient with it. Not unique, since after a change of ownership the old and the new recipient point to the same registry. Null for a recipient the platform administration created, such as the franchisor.—
rolestring
Enum:
  • SCHOOL
  • FRANCHISOR
  • CNA_INSTITUTE
  • SUPPLIER
RequiredRole of the recipient in the network (recipients.Role). The One creates a school or a supplier, and the platform administration only the franchisor; no command creates a CNA Institute recipient yet (cna-br/cna-pay#262).—
masterSystemstring
Enum:
  • CNA_ONE
  • CNA_INSTITUTE
RequiredClient system that owns the registry and receives the facts of the recipient (recipients.MasterSystem, cna-pay-docs RN-EVT-155). The CNA Institute has no topic yet, so a change of one of its recipients fails whole until the topic exists (cna-br/cna-pay#297).—
registryStatestring
Enum:
  • ACTIVE
  • SUSPENDED
  • DEREGISTERED
  • REFUSED
RequiredState of the registry (lifecycle.RegistryState). A new recipient is born ACTIVE; REFUSED is a recipient whose creation the vendor refused, which a new attempt brings back to ACTIVE; SUSPENDED and DEREGISTERED (final) are not produced in this delivery.—
refusalReasonstring
Enum:
  • VENDOR_REFUSED_DATA
  • VENDOR_REFUSED
  • CREATION_RETAKE_EXHAUSTED
OptionalNormalized reason of a REFUSED recipient (recipients.RefusalReason); null otherwise. CREATION_RETAKE_EXHAUSTED is not produced yet (cna-br/cna-pay#389).—
verificationStatusstring
Enum:
  • IN_REVIEW
  • AWAITING_RECIPIENT
  • APPROVED
  • REJECTED
OptionalVerification (KYC) of the recipient as the payment vendor reflects it (lifecycle.VerificationStatus). Null until the vendor reflects the first result.—
eligibilityobjectRequiredWhat the recipient may do (RN-RCB-150), two answers, each with the reasons that deny it.—
↳canTransactbooleanRequiredWhether the recipient may take new payments, referenced in a new order. True exactly when transactReasons is empty.—
↳transactReasonsstring[]RequiredIneligibility reasons (recipients.IneligibilityReason) that deny transacting, in their declared order. Empty, never null, when canTransact is true.—
↳canWithdrawbooleanRequiredWhether the recipient may move its balance to its bank account. True exactly when withdrawReasons is empty.—
↳withdrawReasonsstring[]RequiredIneligibility reasons (recipients.IneligibilityReason) that deny withdrawing, in their declared order. Empty, never null, when canWithdraw is true.—

Custom properties

PropertyValue
Kafka Topicx-kafka-topicRecipient
Routing Keyx-routing-keyid