event

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.

Event Topic: RecipientKey: idNo consumer

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.

  • replacementRefusalReason is VENDOR_REFUSED_DATA when the vendor refused fields of the account, whose paths in the input of the command go in refusedFields (bankAccount.agency), never their values; VENDOR_REFUSED when it named none, with refusedFields empty. 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 is VENDOR_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 ownerPAY
metadata.eventRecipientBankAccountReplacementRefused
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.

api/internal/platform/events/pay/recipient/recipient_bank_account_replacement_refused.go
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

PropertyValue
Contract Ownerx-contract-ownerPAY
Kafka Topicx-kafka-topicRecipient
Message Keyx-message-keyid
Sourcex-sourcecna-pay api/internal/platform/events/pay/recipient/recipient_bank_account_replacement_refused.go
23 properties
eventIdstring<uuid>
required

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.

objectVersioninteger
required

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.

Minimum: 1
idstring<uuid>
required

Id of the recipient in cna-pay. Kafka message key.

externalReferencestring | null

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.

Min length: 1
rolestring
required

Role 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).

Allowed values: SCHOOL FRANCHISOR CNA_INSTITUTE SUPPLIER
masterSystemstring
required

Client 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).

Allowed values: CNA_ONE CNA_INSTITUTE
registryStatestring
required

State 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.

Allowed values: ACTIVE SUSPENDED DEREGISTERED REFUSED
refusalReasonstring | null

Normalized 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.

Allowed values: VENDOR_REFUSED_DATA VENDOR_REFUSED CREATION_RETAKE_EXHAUSTED
verificationStatusstring | null

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.

Allowed values: IN_REVIEW AWAITING_RECIPIENT APPROVED REJECTED
eligibilityobject
required

What the recipient may do (RN-RCB-150): two answers, each with the reasons that deny it.

bankAccountobject
required

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).

replacementRefusalReasonstring
required

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.

Allowed values: VENDOR_REFUSED_DATA VENDOR_REFUSED
refusedFieldsarray[string]
required

Paths 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.

refusedAtstring<date-time>
required

When cna-pay recorded the refusal of the vendor: ISO 8601 in UTC with milliseconds (2026-11-18T12:00:00.000Z).