Skip to main content
Version: 0.52.0-rc.104

Domain Events

Lana Bank publishes domain events via the transactional outbox pattern. These events can be consumed by external systems for integration, analytics, and audit purposes.

All events are serialized as JSON and include metadata for tracing and ordering.


Event Structure

Each event is wrapped in an envelope with the following structure:

{
"id": "uuid",
"event_type": "core.credit.facility-activated",
"payload": { ... },
"recorded_at": "2024-01-15T10:30:00Z",
"trace_id": "trace-uuid"
}

Access Events

Events related to user and role management.

EventDescriptionPayload Fields
UserCreatedA new user was createdentity
RoleCreatedA new role was createdentity

Credit Events

Events related to credit facility lifecycle and operations.

EventDescriptionPayload Fields
FacilityProposalCreatedA credit facility proposal was createdentity
FacilityProposalConcludedA credit facility proposal was concludedentity
PendingCreditFacilityCollateralizationChangedCollateralization state changed for pending facilityentity
PendingCreditFacilityCompletedA pending credit facility was completedentity
FacilityActivatedA credit facility was activatedentity
FacilityCompletedA credit facility was fully repaid and closedentity
FacilityCollateralizationChangedCollateralization state changed for active facilityentity
DisbursalInitializedA disbursal was initiated and is pending approvalentity
DisbursalApprovalConcludedA disbursal approval process was concludedentity
DisbursalSettledA disbursal was settledentity
DisbursalCancelledA disbursal was cancelledentity
AccrualPostedInterest accrual was postedentity
FacilityMaturedNo description availableentity
PartialLiquidationInitiatedA partial liquidation was initiatedentity

CreditCollateral Events

Events related to credit facility collateral management and liquidation.

EventDescriptionPayload Fields
CollateralUpdatedCollateral amount was updatedentity
LiquidationCollateralSentOutCollateral was sent for liquidationamount, effective, ledger_tx_id, liquidation_id, recorded_at, secured_loan_id
LiquidationProceedsReceivedLiquidation proceeds were receivedamount, collateral_id, effective, ledger_tx_id, liquidation_id, payment_id, recorded_at, secured_loan_id
LiquidationCompletedLiquidation was completedliquidation_id, secured_loan_id

CreditCollection Events

Events related to credit facility obligations and payment collection.

EventDescriptionPayload Fields
PaymentCreatedA payment was createdentity
PaymentAllocationCreatedA payment allocation was createdentity
ObligationCreatedA new obligation was createdentity
ObligationDueAn obligation became dueentity
ObligationOverdueAn obligation became overdueentity
ObligationDefaultedAn obligation defaultedentity
ObligationCompletedAn obligation was fully paidentity

Custody Events

Events related to Bitcoin custody and wallet management.

EventDescriptionPayload Fields
WalletBalanceUpdatedNo description availableentity

Customer Events

Events related to customer lifecycle and KYC.

EventDescriptionPayload Fields
CustomerCreatedA new customer was createdentity
CustomerFrozenA customer account was frozen, blocking financial operationsentity
CustomerUnfrozenA previously frozen customer account was unfrozen, restoring normal operationsentity
CustomerClosedCustomer account was closedentity
PartyCreatedNo description availableentity
PartyEmailUpdatedNo description availableentity
ProspectCreatedA new prospect was created for onboardingentity
ProspectKycStartedA prospect started KYC verificationentity
ProspectKycPendingA prospect's KYC verification is pending reviewentity
ProspectKycDeclinedA prospect's KYC verification was declinedentity
ProspectConvertedA prospect was converted to a customerentity
ProspectClosedA prospect was closed without convertingentity

Deposit Events

Events related to deposit accounts and transactions.

EventDescriptionPayload Fields
DepositAccountCreatedA deposit account was createdentity
DepositInitializedA deposit was initializedentity
DepositRevertedA deposit was revertedentity
WithdrawalInitializedA withdrawal was initiated and is pending approvalentity
WithdrawalApprovalConcludedA withdrawal approval process was concludedentity
WithdrawalDeniedA withdrawal was deniedentity
WithdrawalConfirmedA withdrawal was confirmedentity
WithdrawalCancelledA withdrawal was cancelledentity
WithdrawalRevertedA confirmed withdrawal was revertedentity

Price Events

Events related to BTC/USD price updates.

EventDescriptionPayload Fields
PriceUpdatedBTC/USD price was updatedprice, timestamp
ProviderPriceFetchedNo description availableprice, provider_id, timestamp

Report Events

Events related to report generation.

EventDescriptionPayload Fields
ReportRunCreatedA report run was initiatedentity
ReportRunStateUpdatedA report run state changedentity

Governance Events

Events related to approval workflows.

EventDescriptionPayload Fields
ApprovalProcessConcludedAn approval process was concludedentity

Time Events

Events related to end-of-day processing.

EventDescriptionPayload Fields
EndOfDayEnd of day was reached for the configured timezoneclosing_time, day, timezone

Event Types Reference

All event types follow the naming convention: core.<module>.<event-name>

ModuleEvent Type Prefix
Accesscore.access.*
Creditcore.credit.*
CreditCollateralcore.credit-collateral.*
CreditCollectioncore.credit-collection.*
Custodycore.custody.*
Customercore.customer.*
Depositcore.deposit.*
Pricecore.price.*
Reportcore.report.*
Governancegovernance.*
Timecore.time.*

Consuming Events

Events are published via the transactional outbox and can be consumed through:

  1. Direct database polling - Query the outbox table
  2. Event streaming - Integration with message queues (implementation dependent)
  3. ETL pipelines - Via Meltano extraction

For integration details, contact the platform team.