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.
| Event | Description | Payload Fields |
|---|---|---|
UserCreated | A new user was created | entity |
RoleCreated | A new role was created | entity |
Credit Events
Events related to credit facility lifecycle and operations.
Facility Lifecycle
| Event | Description | Payload Fields |
|---|---|---|
FacilityProposalCreated | A credit facility proposal was created | entity |
FacilityActivated | A credit facility was activated | entity |
FacilityCompleted | A credit facility was fully repaid and closed | entity |
Collateral Events
| Event | Description | Payload Fields |
|---|---|---|
PendingCreditFacilityCollateralizationChanged | Collateralization state changed for pending facility | entity |
FacilityCollateralizationChanged | Collateralization state changed for active facility | entity |
Payment Events
| Event | Description | Payload Fields |
|---|---|---|
DisbursalSettled | A disbursal was settled | entity |
AccrualPosted | Interest accrual was posted | entity |
Liquidation Events
| Event | Description | Payload Fields |
|---|---|---|
PartialLiquidationInitiated | A partial liquidation was initiated | entity |
| Event | Description | Payload Fields |
|---|---|---|
FacilityProposalConcluded | No description available | entity |
PendingCreditFacilityCompleted | No description available | entity |
Custody Events
Events related to Bitcoin custody and wallet management.
| Event | Description | Payload Fields |
|---|---|---|
WalletBalanceUpdated | No description available | entity |
Customer Events
Events related to customer lifecycle and KYC.
| Event | Description | Payload Fields |
|---|---|---|
CustomerCreated | A new customer was created | entity |
CustomerKycUpdated | No description available | entity |
PartyCreated | No description available | entity |
PartyEmailUpdated | No description available | entity |
ProspectCreated | No description available | entity |
ProspectKycStarted | No description available | entity |
ProspectKycPending | No description available | entity |
ProspectKycDeclined | No description available | entity |
ProspectConverted | No description available | entity |
ProspectClosed | No description available | entity |
Deposit Events
Events related to deposit accounts and transactions.
| Event | Description | Payload Fields |
|---|---|---|
DepositAccountCreated | A deposit account was created | entity |
DepositInitialized | A deposit was initialized | entity |
WithdrawalConfirmed | A withdrawal was confirmed | entity |
DepositReverted | A deposit was reverted | entity |
Price Events
Events related to BTC/USD price updates.
| Event | Description | Payload Fields |
|---|---|---|
PriceUpdated | BTC/USD price was updated | price, timestamp |
Report Events
Events related to report generation.
| Event | Description | Payload Fields |
|---|---|---|
ReportRunCreated | A report run was initiated | entity |
ReportRunStateUpdated | A report run state changed | entity |
Governance Events
Events related to approval workflows.
| Event | Description | Payload Fields |
|---|---|---|
ApprovalProcessConcluded | An approval process was concluded | entity |
Event Types Reference
All event types follow the naming convention: core.<module>.<event-name>
| Module | Event Type Prefix |
|---|---|
| Access | core.access.* |
| Credit | core.credit.* |
| Custody | core.custody.* |
| Customer | core.customer.* |
| Deposit | core.deposit.* |
| Price | core.price.* |
| Report | core.report.* |
| Governance | governance.* |
Consuming Events
Events are published via the transactional outbox and can be consumed through:
- Direct database polling - Query the outbox table
- Event streaming - Integration with message queues (implementation dependent)
- ETL pipelines - Via Meltano extraction
For integration details, contact the platform team.