Skip to main content
Lender publishes CloudEvents 1.0 in binary content mode through Lerian’s streaming library. Business emission is outbox-only and at least once: the domain write and outbox envelope share one database transaction, and the relay publishes after commit.

Application-stream contract

  • ce-source: lender
  • Facts: lerian.streaming.lender
  • Commands: lerian.streaming.lender.commands
  • Route dead letters: lerian.streaming.lender.dlq
  • ce-type: studio.lerian.lender.<resource>.<event>
  • Dispatch key: <resource>.<event> from ce-resourcetype and ce-eventtype
The topic identifies the producing application and stream class, not one event. Route on CloudEvents headers, not on a per-event topic name. Lender serves the exact catalog and application topics at GET /api/v1/streaming/manifest.

Emitted events

The catalog declares 39 definitions. Lender emits 37 of them: 35 facts and 2 commands. The table separates catalog keys from the CloudEvent routing type.

Emitted payload contracts

The contracts below mirror the CloudEvent data JSON tags in the published Lender contract. ? means the field can be absent. The Go wire structs declare no nullable pointer fields. unknown is raw JSON and may carry any JSON value, including null. Decimal values are JSON strings, timestamps are UTC RFC 3339 strings, and YYYYMM is a six-digit competência.
Definition key: accounting_profile.configuredTopic: lerian.streaming.lenderSchema: 1.1.0Subject: profile_id
effective_from is the civil day the chart it describes starts governing. Without it, two events about one product version describe two different charts and nothing on the wire says which one governs a given month.
Definition keys: assignment_set.approved, assignment_set.acceptedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: assignment_set_idA cession composition is durably approved. The event identifies the immutable approval that determines the offer file.
A fund administrator accepts the entire cession. The event reports the set-level money totals after the write-off of the receivables from the tenant portfolio. The risk_retention field names the retention regime the cession was booked under. The retained_fraction field is the share of the expected loss the institution keeps after the sale.
Definition keys: collection.payment.applied, collection.payment.unapplied, collection.payment.reapplied, collection.payment.refundedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: application_id
Definition key: loan_application.submittedTopic: lerian.streaming.lenderSchema: 2.0.0Subject: loan_application_id
Definition key: loan_application.approvedTopic: lerian.streaming.lenderSchema: 2.0.0Subject: loan_application_id
Definition key: loan_application.rejectedTopic: lerian.streaming.lenderSchema: 2.0.0Subject: loan_application_id
Definition key: loan_application.withdrawnTopic: lerian.streaming.lenderSchema: 2.0.0Subject: loan_application_id
Definition key: loan_application.disbursedTopic: lerian.streaming.lenderSchema: 2.0.0Subject: loan_application_id
Definition key: loan_charge.appliedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_account_id
Definition key: loan_product.createdTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_product_id
Definition key: loan_product.activatedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_product_id
Definition key: loan_product.current_version_promotedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_product_idThe product is the aggregate after the repoint, so current_version_id is the new pin. Contracts already written keep the version they were born on. Only new applications originate on the promoted one. The promoted_by field holds the authenticated subject verbatim. It is empty when no human asked for the promotion.
Definition key: loan_product_version.createdTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_product_version_id
min/max rate bands are absent when the version stores none. A version with no band emits neither key rather than a zero-to-zero band, which would read as “only 0% is allowed”. The admitted_borrower_kinds field is always present. An empty array means the version admits no borrower.
Definition key: loan_schedule.prepayment_appliedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: schedule_version_id
Definition key: loan_schedule.rescheduledTopic: lerian.streaming.lenderSchema: 1.0.0Subject: schedule_version_id
Definition key: repayment.recordedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: transaction_id
Definition keys: returned_payment_receivable.opened, returned_payment_receivable.collected, returned_payment_receivable.written_offTopic: lerian.streaming.lenderSchema: 1.0.0Subject: receivable_idThe three facts project the same aggregate through one shared projection, so two facts about one debt cannot describe it differently. Every field is always present. A field that does not apply yet holds an empty string. It is never absent and never null. Read status to tell the states apart, not the emptiness of a field.The stage and provision_amount fields carry the aging of the debt. The provision_consumed and loss fields split the write-off. The reversal_transaction_id field is unique per receivable and is the anchor that a redelivery of the same reversal resolves to.
Definition key: repayment_reversal.recordedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: transaction_id
Definition key: loan_account.pdd_stage_transitionedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_account_id
Definition key: prepayment_quote.createdTopic: lerian.streaming.lenderSchema: 1.0.0Subject: quote_id
Definition key: prepayment_settlement.recordedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: settlement_id
Definition key: loan_account.debt_balance_changedTopic: lerian.streaming.lenderSchema: 2.0.0Subject: loan_account_id
Definition key: loan_account.payment_overdueTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_account_id
Definition key: loan_account.problem_asset_assessedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_account_idLender emits it on both verdicts. A declaration with characterizes_problem_asset set to false is the only way to withdraw an earlier characterization.
Definition key: loan_account.problem_asset_reassessment_overdueTopic: lerian.streaming.lenderSchema: 1.0.0Subject: loan_account_idThis fact is a call to review. It changes nothing on the contract: the stage, the provision, and the income-recognition decision stay as they were. Lender emits it once per contract per business date, and a declaration of either verdict ends it.
Definition key: consignado.exclusao.requestedTopic: lerian.streaming.lender.commandsSchema: 1.0.0Subject: request_ref
Definition key: consignado.redirecionamento.requestedTopic: lerian.streaming.lender.commandsSchema: 1.0.0Subject: request_ref
Definition key: payroll_deduction.refund_requiredTopic: lerian.streaming.lenderSchema: 1.0.0Subject: receipt_id
Definition key: payroll_overdeduction.refund_requiredTopic: lerian.streaming.lenderSchema: 1.0.0Subject: refund_case_id
Definition key: collection.instruction.issuedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: instrument_id
Definition key: guarantee_recovery.cash_allocatedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: receipt_id

Cataloged but not emitted

These two definitions are present in the manifest but have no non-test Lender emission caller. Do not treat their lender-sourced forms as operational integrations.

Events consumed

Lender wires 15 gateway fact keys from lerian.streaming.consignado-gw and one Matcher fact from lerian.streaming.matcher. Each consumer is configuration-gated and registered in bootstrap. The gateway has emission paths for the first 13 listed gateway keys. The portability pair reaches Lender only when its outcome consumer is enabled and the deployed gateway manifest declares the event. The manifest does not declare the two refinance outcomes, so those two listeners receive no traffic from the current gateway runtime. Lender does not register consignado.proposal.accepted. That key is not a Lender booking input.

Internal event planes

Lender also writes internal outbox event types for ledger intents, collection work, and signed hub handoffs. They are process-local coordination contracts, not entries of the event catalog. This public inventory omits them on purpose.

Delivery and compatibility rules

  • Deduplicate by (ce-source, ce-id) and make handlers idempotent.
  • Read ce-schemaversion before decoding. The version is a CloudEvents header, never a topic suffix.
  • Money and rates are decimal strings. Timestamps are UTC RFC 3339.
  • The wired fact consumers filter exact keys. They skip and commit unmatched facts on the shared application topics. Malformed handled records follow the consumer DLQ policy.
  • A missing required business identifier prevents emission or command execution. Lender never synthesizes it.