Skip to main content
Lender publishes CloudEvents 1.0 in binary content mode through lib-streaming v3. 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 37 definitions. Lender has production callers for 34 of them: 32 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.
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. promoted_by is the authenticated subject verbatim, and 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”.
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.collectedTopic: lerian.streaming.lenderSchema: 1.0.0Subject: receivable_idBoth facts project the same aggregate through one shared projection, so the two facts about one debt cannot describe it differently. Every field is always present: on .opened the three collection fields are empty strings, never absent and never null. Read status to tell the two states apart, not the emptiness of a field. reversal_transaction_id is unique per receivable and is the anchor 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: 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 three 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 lib-streaming CloudEvents catalog entries. 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.