Transaction

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

What this module does

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

Key capabilities

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

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.

Module is included in

  • Subscription Access: Create plans, manage subscriptions, and control what users can see or use.
  • Value Ledger: Record value movements with clear entries, timestamps, and a complete audit trail.
  • Tradebook: Track transfers and swaps between parties, assets or resources.

Source paths

  • backend/modules/transaction
  • frontend/modules/transaction