All catalogue entries

04 / 07 Module catalogue detail

Transaction

Ledger-style transaction tracking for admin views, payment-driven state transitions, and audit-ready command history.

Browse category: Financial

Choose the modules you want after opening the builder.

What this module does

Transaction history, status tracking, and audit-ready records.

Documented capabilities

  • Transaction creation and status updates from payment events
  • Persistent event history for command handling
  • Admin list, statistics, and detail endpoints

Configuration highlights

  • Flyway migration path under the transaction schema

  • Event-driven integration with the payment module

  • Optional demo inserts for transaction seed data

Core flows

  1. Create transaction from payment-created event

    • Trigger: consumed PaymentCreatedEvent without existing transactionId.
    • Steps: map to CreatePaymentTransactionCommand, route through command handler, persist Transaction, persist TransactionEvent, emit TransactionCreatedEvent.
    • Output: new transaction linked to payment.
    • Failure/edge cases: missing command handler mapping or persistence failures.
  2. Update transaction from payment status update

    • Trigger: consumed PaymentStatusUpdatedEvent.
    • Steps: map status to command (ConfirmPaymentTransactionCommand or SetPaymentTransactionErrorCommand), apply handler, store event row, emit status-updated module event.
    • Output: updated transaction status/substatus.
    • Failure/edge cases: unsupported status mapping ignored, unknown transaction id raises unapplied command.
  3. Admin transaction retrieval and statistics

    • Trigger: /admin/transactions endpoints.
    • Steps: apply criteria filters (status/date), query repository/projection mapping, return page/details/stat counts.
    • Output: pageable transaction detail views and aggregate counters.
    • Failure/edge cases: invalid status query parameter -> bad request.

Core flow source: backend/modules/transaction/AGENTS.md