> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Lender events

> Reference the domain events emitted and consumed by Lerian Lender — loan lifecycle, collections, BR jurisdiction, and consignado commands — with payloads and delivery semantics.

Lender emits domain events as **CloudEvents 1.0** messages in binary content mode over Kafka, published through `lib-streaming`. Every event travels in the [shared envelope](/en/reference/events/overview): `ce-type` names the event as `studio.lerian.<resource>.<event>`, `ce-subject` carries the aggregate id, `ce-tenantid` the owning tenant, and `ce-schemaversion` the payload version — `1.0.0` for every event below.

`ce-source` comes from `STREAMING_CLOUDEVENTS_SOURCE`, and Lender **enforces the value `lender`** when streaming is enabled — booting with any other value fails. Topics derive from the source (see [Topic naming](/en/reference/events/overview#topic-naming)), so every emitted event lands on `lender.<resource>.<event>`.

Every event in Lender's catalog is **outbox-backed**: the event row is written in the same database transaction as the state change it reports, and a relay publishes committed rows to Kafka, retrying through broker outages. The catalog does not allow this policy to be weakened per deployment. Money amounts and rates cross the wire as decimal **strings**, never floats. Lender serves its full event catalog at `GET /api/v1/streaming/manifest`.

## Loan lifecycle events

| Event (`ce-type`)                             | Topic                                  | Fires when                                                                                       | Key payload                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `studio.lerian.loan_application.submitted`    | `lender.loan_application.submitted`    | An application is validated and persisted, pending approval.                                     | `loanApplicationId`, `loanProductVersionId`, `borrowerId`, `assignedOfficerId`, `status`, `requestedPrincipalAmount`, `requestedInterestRate`, `requestedInstallments`, `expectedDisbursementDate`, `previewProfileVersion`, `previewJurisdictionCode`, `previewScheduleSnapshotId`, `createdAt`, `updatedAt`   |
| `studio.lerian.loan_application.approved`     | `lender.loan_application.approved`     | A pending application is approved.                                                               | `loanApplicationId`, `loanProductVersionId`, `borrowerId`, `assignedOfficerId`, `status`, `approvedAmount`, `approvalDecisionId`, `approvalDecisionAt`, `approvedBy`, `requestedPrincipalAmount`, `previewProfileVersion`, `previewJurisdictionCode`, `updatedAt`                                               |
| `studio.lerian.loan_application.rejected`     | `lender.loan_application.rejected`     | A pending application is rejected.                                                               | As `approved`, with `rejectionDecisionId`, `rejectionDecisionAt`, `rejectedBy`                                                                                                                                                                                                                                  |
| `studio.lerian.loan_application.withdrawn`    | `lender.loan_application.withdrawn`    | A pending application is withdrawn.                                                              | As `approved`, with `withdrawalDecisionId`, `withdrawalDecisionAt`, `withdrawnBy`                                                                                                                                                                                                                               |
| `studio.lerian.loan_application.disbursed`    | `lender.loan_application.disbursed`    | An approved application is disbursed and the active loan is created.                             | `loanApplicationId`, `loanProductVersionId`, `borrowerId`, `assignedOfficerId`, `status`, `loanAccountId`, `disbursementEventId`, `disbursementTransactionId`, `grossRequestedAmount`, `netDeliveredAmount`, `disbursedAt`, `profileVersion`, `jurisdictionExtensions`?, `previewJurisdictionCode`, `updatedAt` |
| `studio.lerian.loan_product.created`          | `lender.loan_product.created`          | A loan product is persisted as a draft.                                                          | `loan_product_id`, `name`, `loan_type`, `status`, `jurisdiction_code`, `current_version_id`?, `created_at`                                                                                                                                                                                                      |
| `studio.lerian.loan_product.activated`        | `lender.loan_product.activated`        | A product transitions to active, pinned to a version snapshot.                                   | `loan_product_id`, `current_version_id`, `status`, `name`, `loan_type`, `jurisdiction_code`, `created_at`                                                                                                                                                                                                       |
| `studio.lerian.loan_product_version.created`  | `lender.loan_product_version.created`  | Immutable product-version terms are appended.                                                    | `loan_product_version_id`, `loan_product_id`, `jurisdiction_code`, `jurisdictionExtensions`?, `rate_mode`, `floating_rate_table_id`?, `floating_spread_bps`, `fixed_annual_rate_bps`, `requires_floating_rate`, `created_at`                                                                                    |
| `studio.lerian.loan_charge.applied`           | `lender.loan_charge.applied`           | A product-version charge template is persisted as an immutable applied charge on a loan account. | `request_id`, `loan_account_id`, `source_product_version_id`, `charge_template_id`, `charge_code`, `charge_type`, `amount`, `rate`, `currency`, `account_created_at`, `assessed_at`                                                                                                                             |
| `studio.lerian.accounting_profile.configured` | `lender.accounting_profile.configured` | A tenant's product-version accounting profile and posting rules are durably configured.          | `profile_id`, `loan_product_version_id`, `accounting_mode`, `posting_rules` (each entry: `event_type` and `legs` with `account`, `role`?, `side`, `component`?, `optional`), `created_at`                                                                                                                       |

## Servicing events

| Event (`ce-type`)                                | Topic                                     | Fires when                                                                   | Key payload                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------ | ----------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `studio.lerian.repayment.recorded`               | `lender.repayment.recorded`               | A repayment is durably recorded with its cash allocation.                    | `transaction_id`, `loan_account_id`, `request_id`, `paid_amount`, `overpayment_amount`, `effective_date`, `created_at`, `allocation_count`, `allocations` (each entry: `installment_number`, `due_date`, `principal_amount`, `interest_amount`, `fees_amount`, `penalties_amount`, `total_amount`, `fully_paid`) |
| `studio.lerian.repayment_reversal.recorded`      | `lender.repayment_reversal.recorded`      | A repayment reversal is recorded as a compensating transaction with lineage. | As `repayment.recorded`, plus `original_transaction_id`, `profile_version`, `jurisdiction_code`                                                                                                                                                                                                                  |
| `studio.lerian.loan_schedule.prepayment_applied` | `lender.loan_schedule.prepayment_applied` | A prepayment produces a successor schedule version.                          | `loan_account_id`, `schedule_version_id`, `previous_schedule_version_id`, `version_number`, `reason`, `trigger_transaction_id`, `request_id`, `payload_hash`, `prepayment_amount`, `effective_date`, `business_date`, `profile_version`, `jurisdiction_code`, `created_at`, `installment_count`                  |
| `studio.lerian.loan_schedule.rescheduled`        | `lender.loan_schedule.rescheduled`        | A reschedule produces a successor schedule version.                          | As `prepayment_applied` minus `prepayment_amount`, plus `first_rescheduled_due_date`                                                                                                                                                                                                                             |

## Collection events

The four collection-payment events share one payload schema; optional fields fill in per flow.

| Event (`ce-type`)                            | Topic                                 | Fires when                                                                         | Key payload                                                                                                                                                                                                                                                                                          |
| -------------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `studio.lerian.collection_payment.applied`   | `lender.collection_payment.applied`   | A verified collection payment is conserved and applied to one loan financial path. | `application_id`, `notification_id`, `instrument_id`, `provider`, `provider_account_id`, `provider_payment_id`, `received_amount`, `applied_amount`, `unapplied_amount`, `refunded_amount`?, `currency`, `applied_transaction_id`?, `repair_reason`?, `refund_request_id`?, `refund_transaction_id`? |
| `studio.lerian.collection_payment.unapplied` | `lender.collection_payment.unapplied` | A payment is conserved as unapplied cash with a bounded repair reason.             | Same schema                                                                                                                                                                                                                                                                                          |
| `studio.lerian.collection_payment.reapplied` | `lender.collection_payment.reapplied` | Unapplied cash is released into receivables.                                       | Same schema                                                                                                                                                                                                                                                                                          |
| `studio.lerian.collection_payment.refunded`  | `lender.collection_payment.refunded`  | Unapplied cash is refunded through a provider request.                             | Same schema                                                                                                                                                                                                                                                                                          |

## BR jurisdiction events

| Event (`ce-type`)                                   | Topic                                        | Fires when                                                                                                                                                                           | Key payload                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `studio.lerian.loan_account.pdd_stage_transitioned` | `lender.loan_account.pdd_stage_transitioned` | A BR PDD delinquency stage transition or cure is persisted, with accrual eligibility.                                                                                                | `loan_account_id`, `transition_id`, `from_stage`, `to_stage`, `accrual_state`, `reason`?, `effective_at`, `business_date`, `triggered_by`?, `profile_version`?, `jurisdiction_code`?, `created_at`                                                                                                                                                                                                                                          |
| `studio.lerian.prepayment_quote.created`            | `lender.prepayment_quote.created`            | An immutable BR prepayment quote is created, with rebate and IOF reconciliation facts.                                                                                               | `quote_id`, `loan_account_id`, `quote_type`, `principal_outstanding`, `interest_rebate`, `charge_rebate`, `iof_reconciliation`, `gross_amount`, `net_settlement_amount`, `rebate_mandatory`, `expires_at`, `currency`, `sla_due_at`, `statement_available_at`, `instrument_id`, `instrument_type`, `instrument_requested_at`, `profile_version`?, `jurisdiction_code`?, `consumer_protection_regime`?, `created_at`                         |
| `studio.lerian.prepayment_settlement.recorded`      | `lender.prepayment_settlement.recorded`      | An accepted prepayment quote is settled; the final breakdown is persisted. `final_interest_amount` is a disclosure-only forgiven-interest figure — never sum it into cash movements. | `settlement_id`, `quote_id`, `loan_account_id`, `transaction_id`, `schedule_version_id`?, `settlement_type`, `principal_outstanding`, `interest_rebate`, `charge_rebate`, `iof_reconciliation`, `gross_amount`, `net_settlement_amount`, `final_principal_amount`, `final_interest_amount`, `final_charge_amount`, `final_iof_amount`, `profile_version`?, `jurisdiction_code`?, `consumer_protection_regime`?, `accepted_at`, `created_at` |
| `studio.lerian.payroll_deduction.refund_required`   | `lender.payroll_deduction.refund_required`   | Confirmed post-payoff payroll cash is recorded as requiring a borrower refund.                                                                                                       | `receipt_id`, `account_id`, `product_version_id`, `payoff_effective_at`, `receipt_settled_at`, `amount`, `currency`, `required_at`                                                                                                                                                                                                                                                                                                          |
| `studio.lerian.guarantee_recovery.cash_allocated`   | `lender.guarantee_recovery.cash_allocated`   | One confirmed guarantee-recovery cash receipt is allocated with cash conservation.                                                                                                   | `receipt_id`, `loan_account_id`, `disruption_ref`, `source_sequence`, `cash_source`, `amount`, `repayment_applied`, `prepayment_applied`, `unapplied`, `currency`, `settled_at`                                                                                                                                                                                                                                                             |

## Consignado commands emitted

Commands Lender sends to the Consignado rail. They keep Lender's namespace — Consignado subscribes to these `lender.*` topics (see [Consignado events](/en/reference/events/consignado)).

| Command (`ce-type`)                                   | Topic                                          | Fires when                                                                                         | Key payload                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `studio.lerian.consignado_averbacao.requested`        | `lender.consignado_averbacao.requested`        | Active contracting asks the rail to averbar a signed contract.                                     | `contract_id`, `numero_contrato`, `cpf`, `matricula`, worker and employer identification, the full accepted financial terms (`principal_amount`, `liberated_amount`, `installment_amount`, `installment_count`, rates, `iof_amount`, `first_deduction_competencia`), the FGTS collateral block, the signed CCB, and signature evidence |
| `studio.lerian.consignado_exclusao.requested`         | `lender.consignado_exclusao.requested`         | A full payoff triggers exclusion of the averbação.                                                 | `request_ref`, `settlement_id`, `loan_account_id`, `contract_id`, `numero_contrato`, `settled_at`                                                                                                                                                                                                                                      |
| `studio.lerian.consignado_redirecionamento.requested` | `lender.consignado_redirecionamento.requested` | Employment-disruption resolution requests a payroll-collection redirection to an eligible vínculo. | `request_ref`, `numero_contrato`, `source_vinculo_ref`, `target_vinculo_ref`, `target_matricula`, `target_cnpj`, `target_esocial_category`, `disruption_status`, `effective_at`                                                                                                                                                        |

`studio.lerian.consignado_margin.requested` (topic `lender.consignado_margin.requested`) is declared in the catalog and in the manifest, but no Lender flow emits it yet — treat it as a contract reservation, not live traffic. Consignado's fact events (`studio.lerian.consignado_proposal.accepted`, `studio.lerian.consignado_averbacao.confirmed`, and the rest) also appear in Lender's manifest for contract documentation, but their producer is the Consignado rail — see the [Consignado events](/en/reference/events/consignado) page for those payloads.

## Events consumed

Consumers are opt-in per deployment: each has an enable flag (default off) and fails at boot when enabled without a reachable broker.

| Topic (producer)                                                                   | What Lender does with it                                                                                                                           |
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `consignado-gw.consignado_averbacao.confirmed` (Consignado)                        | Confirms the averbação on the application and converges disbursement.                                                                              |
| `consignado-gw.consignado_averbacao.rejected` (Consignado)                         | Applies the averbação rejection to the application and contract.                                                                                   |
| `consignado-gw.consignado_employment_status.reported` (Consignado)                 | Feeds employment-disruption processing.                                                                                                            |
| `consignado-gw.consignado_exclusao.confirmed` and `.rejected` (Consignado)         | Applies the terminal exclusion outcome to the exclusion flow; a repair command can re-emit `studio.lerian.consignado_exclusao.requested`.          |
| `consignado-gw.consignado_redirecionamento.confirmed` and `.rejected` (Consignado) | Applies the redirection outcome to employment-disruption state.                                                                                    |
| `consignado-gw.consignado_reconciliation.received` (Consignado)                    | Drives the reconciliation orchestrator for a competência (escrituração and repasse ingestion).                                                     |
| `matcher.match_run.completed` (Matcher)                                            | Translates a completed reconciliation match run into PDD stage transitions, arrears and collection issuance, and settle or refund posting intents. |

The `consignado-gw.consignado_proposal.accepted` fact — the auction-win handoff — has a handler implemented but **not yet wired into any deployment**: the leilão handoff is not live end to end. It is listed here so subscribers know the contract exists; check the streaming manifest of your deployment before depending on it.
