Recipient Bank Account Replacement Refused
The vendor refused the change of the bank account of a recipient, and the current account stays: the public state of the recipient, the refused account masked, why and which fields. Recorded by cna-pay in its outbox in the transaction of the refusal. No consumer yet.
Overview
Fact: the vendor refused the change of the bank account of a RecipientRecipientEntityv1.0.0A recipient (recebedor) of CNA Pay - every CPF or CNPJ enabled to receive money on the platform - a school, the franchis...Ownercna-platformView docs (PRD 1, US-105), and its current account stays. The payload is the public state of the recipient, after eventId and objectVersion, plus bankAccount, the new account the vendor refused, replacementRefusalReason, refusedFields and refusedAt.
When it is published. The change is commanded with replaceRecipientBankAccount, as for Recipient Bank Account ReplacedRecipient Bank Account ReplacedEventv1.0.0The vendor confirmed the change of the bank account of a recipient, and the new account became current: the public state...Ownercna-platformSchemaMapView docs. When the vendor refuses it for good, CNA PayCNA PayServicev1.0.0Payments platform of the CNA network (recipients, their subaccounts at the payment vendor, bank accounts and gateway con...PublishesRecipientCreated, RecipientStateChanged +5Ownercna-platformMapRepoView docs records this fact in its outbox, in the transaction that keeps the new account REFUSED with its reason; the current account keeps receiving the transfers. The publisher process then sends it to 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.
replacementRefusalReasonisVENDOR_REFUSED_DATAwhen the vendor refused fields of the account, whose paths in the input of the command go inrefusedFields(bankAccount.agency), never their values;VENDOR_REFUSEDwhen it named none, withrefusedFieldsempty. A refused field outside the account is no field the client can fix in this command, so it is dropped, and a refusal left without fields isVENDOR_REFUSED.- The reason has a name of its own:
refusalReason, in the public state, is the refusal of the creation of the recipient, the same in every fact of the recipient. - The refusal advances the version of the recipient. When the eligibility recalculated with it turns an answer, Recipient Eligibility ChangedRecipient Eligibility ChangedEventv1.0.0An answer of what a recipient may do changed, transacting or withdrawing, such as when the vendor creates its subaccount...Ownercna-platformSchemaMapView docs goes right before this fact, with the same
objectVersion.
The account is masked as in Recipient Bank Account ReplacedRecipient Bank Account ReplacedEventv1.0.0The vendor confirmed the change of the bank account of a recipient, and the new account became current: the public state...Ownercna-platformSchemaMapView docs: the last digits of the agency and of the account number only, never the holder or the check digits (RN-RCB-176). The payload carries neither the document nor the name of the recipient, nor any data of its managing partner (guard-rail 9, data minimization).
No consumer yet. The One is the expected first consumer. Delivery is at least once: a consumer drops an event whose eventId it already applied and a state older than the objectVersion it holds; a fact of the version it holds is still applied. cna-pay publishes nothing until this message is in the catalog (see 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).
Kafka
Topic (AggregateRoot) | Recipient |
Message key (RoutingKey) | payload.id |
| Contract owner | PAY |
metadata.event | RecipientBankAccountReplacementRefused |
| Consumer group | (none yet) |
Payload schema
Source of truth
events.Fact and State are embedded without a JSON name, so their fields are written inline, before the fields of this payload. Both are shown on Recipient CreatedRecipient CreatedEventv1.0.0The platform recorded a new recipient: its public state at its birth, ACTIVE and neither transacting nor withdrawing whi...Ownercna-platformSchemaMapView docs, and BankAccount on Recipient Bank Account ReplacedRecipient Bank Account ReplacedEventv1.0.0The vendor confirmed the change of the bank account of a recipient, and the new account became current: the public state...Ownercna-platformSchemaMapView docs. RefusedFields is built never nil, so it is always an array, and RefusedAt is written by dates.ISO, in UTC with milliseconds.
type BankAccountReplacementRefusedPayload struct { events.Fact State BankAccount BankAccount `json:"bankAccount"` ReplacementRefusalReason string `json:"replacementRefusalReason"` RefusedFields []string `json:"refusedFields"` RefusedAt string `json:"refusedAt"`}
var RecipientBankAccountReplacementRefused = events.Definition[BankAccountReplacementRefusedPayload]{ Name: "RecipientBankAccountReplacementRefused", Owner: events.OwnerPay, AggregateRoot: "Recipient", Version: "1.0.0", RoutingKey: func(p BankAccountReplacementRefusedPayload) string { return p.ID.String() },}The definition exists only in cna-pay.
Custom properties
| Property | Value |
|---|---|
| Contract Ownerx-contract-owner | PAY |
| Kafka Topicx-kafka-topic | Recipient |
| Message Keyx-message-key | id |
| Sourcex-source | cna-pay api/internal/platform/events/pay/recipient/recipient_bank_account_replacement_refused.go |
Unique, immutable id of the event (events.Fact), the same in every resend of it. A consumer drops an event whose eventId it already applied.
Version of the recipient after the change the event reports, from 1 (events.Fact). The facts of one change share it, so a consumer applies a fact of the version it holds and drops one older than it.
1Id of the recipient in cna-pay. Kafka message key.
Id 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 (RN-RCB-130). Always sent; null for a recipient the platform administration created, such as the franchisor.
1Role of the recipient in the network (cna-pay recipients.Role). The One creates a SCHOOL or a SUPPLIER, and the platform administration only the FRANCHISOR; no command creates a CNA_INSTITUTE yet (cna-br/cna-pay#262).
SCHOOL FRANCHISOR CNA_INSTITUTE SUPPLIERClient system that owns the registry and receives the facts of the recipient, RN-EVT-155 (cna-pay recipients.MasterSystem): CNA_ONE for a school, a supplier and the franchisor; CNA_INSTITUTE for the CNA Institute, which has no topic yet, so a change of such a recipient fails whole until its topic exists (cna-br/cna-pay#297).
CNA_ONE CNA_INSTITUTEState of the registry after the change (cna-pay lifecycle.RegistryState): ACTIVE, what it may do being in eligibility; REFUSED, the vendor refused its creation and refusalReason says why; SUSPENDED and DEREGISTERED (final) are not produced in this delivery.
ACTIVE SUSPENDED DEREGISTERED REFUSEDNormalized reason of a REFUSED recipient (cna-pay recipients.RefusalReason): VENDOR_REFUSED_DATA, the vendor refused fields of the creation; VENDOR_REFUSED, it refused it without naming a field; CREATION_RETAKE_EXHAUSTED, the creation got no answer of the vendor until its retakes ran out (not produced yet, cna-br/cna-pay#389). Always sent; null unless registryState is REFUSED.
VENDOR_REFUSED_DATA VENDOR_REFUSED CREATION_RETAKE_EXHAUSTED Verification (KYC) of the recipient as the vendor reflects it (cna-pay lifecycle.VerificationStatus): IN_REVIEW, AWAITING_RECIPIENT (the vendor waits for the recipient; the pending items stay in the query of the recipient), APPROVED, or REJECTED (final). Always sent; null until the vendor reflects the first result.
IN_REVIEW AWAITING_RECIPIENT APPROVED REJECTED What the recipient may do (RN-RCB-150): two answers, each with the reasons that deny it.
The new bank account the vendor refused, kept REFUSED; the current account stays and keeps receiving the transfers. Masked: never the holder (name or document) nor the check digits (cna-pay recipient.BankAccount; RN-RCB-176).
Normalized reason the vendor refused the change (cna-pay recipients.BankAccountRefusalReason): VENDOR_REFUSED_DATA, it refused fields of the account, listed in refusedFields; VENDOR_REFUSED, it refused it without naming a field of the account. Not refusalReason, which is the refusal of the creation of the recipient, the same in every fact of the recipient.
VENDOR_REFUSED_DATA VENDOR_REFUSEDPaths of the fields of the account the vendor refused, in the input of replaceRecipientBankAccount (bankAccount.agency), when replacementRefusalReason is VENDOR_REFUSED_DATA, which lists at least one; an empty array, never null, when it is VENDOR_REFUSED. Never their values.
When cna-pay recorded the refusal of the vendor: ISO 8601 in UTC with milliseconds (2026-11-18T12:00:00.000Z).