Skip to content

TASK: Apply ledger completion to destination account projection #231

Closed
digital-bank-java/account-service
#39

Description

@ramioooz

Parent

Objective

When Account Service consumes a valid LedgerPostingCompleted.v1 event, apply the balanced credit line to the destination account in the same database transaction as the reserved source debit and reservation transition.

Scope

  • Preserve the existing reservation account validation and commit or reversal behavior.
  • Validate that the completed posting has exactly one matching destination credit line for the transfer.
  • Update source and destination account projections atomically and idempotently through the existing inbox.
  • Keep direct public balance mutation endpoints prohibited.
  • Preserve failed-posting release behavior.

Acceptance Criteria

  • A successful internal transfer debits the reserved source projection and credits the destination projection exactly once.
  • A reversal restores the source and removes the destination credit exactly once.
  • Missing, duplicate, ambiguous, or currency-inconsistent destination lines are rejected without a partial balance update.
  • Duplicate delivery and concurrent delivery remain safe through the existing inbox and database transaction.
  • Maven verify and Helm validation pass without redundant endpoint-test expansion.

This closes a production-critical projection gap in the existing Sprint 3 ledger-driven transfer flow. AWS and UAT deployment remain out of scope.

Activity

  1. self-assigned this
    on Sep 5, 2026
  2. added theissue type on Sep 5, 2026
  3. ramioooz commented on Sep 5, 2026

    @ramioooz
    MemberAuthor

    Implemented in account-service#39.

    • Governed transfer completions now validate the persisted destination debit/credit line and atomically update source and destination projections.
    • Duplicate delivery remains an inbox replay and cannot credit the destination twice.
    • Destination identity is persisted in account_inbox_events by Flyway V6 for replay conflict detection.
    • Account Service documentation now describes the transfer projection behavior.

    Verification passed: ./mvnw -q spotless:check, focused unit tests, and full ./mvnw -q verify with Docker/Testcontainers. The PR is open for review and must be merged before this task can close.

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions