Skip to content

BUG: validate ledger completion lines before completing transfer #240

Closed
digital-bank-java/transaction-service
#22

Description

@ramioooz

Outcome

A ledger completion event cannot mark a transfer completed unless its immutable accounting details match the transfer workflow.

Scope

  • Carry reservation request ID, currency, posting ID, and debit/credit lines through the Transaction Service inbox parser and process manager.
  • Validate transfer ID/correlation, posting request ID, reservation request ID, currency, source debit, destination credit, and exact amount before the COMPLETED transition.
  • Reject and quarantine inconsistent events without marking the event processed or mutating balances.
  • Preserve deduplication and retry/DLQ behavior.

Out of scope

  • Account balance mutation, ledger posting ownership, Kafka topic redesign, public gateway routes, and full saga orchestration changes.

Acceptance criteria

  • A valid completion completes the transfer.
  • A mismatched account, amount, currency, reservation, or extra line cannot complete the transfer.
  • The invalid event remains eligible for existing retry/DLQ handling.
  • No redundant test suite is added; only load-bearing regression coverage is required.

Project tracking

Activity

  1. self-assigned this
    on Sep 5, 2026
  2. ramioooz commented on Sep 5, 2026

    @ramioooz
    MemberAuthor

    Parented under .github#103 (Sprint 3 - Internal Transfers and Event Consistency) and added to the Digital Bank Java Platform project as a Sprint 3 Bug in progress. Implementation is being prepared in Transaction Service; completion will be tracked by its reviewable PR.

  3. ramioooz commented on Sep 5, 2026

    @ramioooz
    MemberAuthor

    Implementation is ready in transaction-service#22.

    The PR preserves reservation request ID, posting ID, currency, and ledger lines; validates the exact source debit and destination credit before completion; keeps invalid events unprocessed for retry/DLQ handling; and covers the persisted deferred-event path without adding a schema migration.

    Verification on the isolated branch: 93 unit-phase tests, 15 PostgreSQL Testcontainers integration tests, Helm lint/template validation, and git diff --check all passed. The PR is non-draft and mergeable; it requires review and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions