Skip to content

TASK: Consume ledger posting commands in Ledger Service #211

Closed

Description

@ramioooz

Parent: STORY: Orchestrate transfer saga with ledger-driven completion

Objective

Consume governed LedgerPostingRequested.v1 commands in Ledger Service and map them to the immutable posting boundary without creating duplicate financial entries.

Scope

  • Consume ledger.posting.requested.v1 with the governed event envelope and required headers.
  • Validate payload, producer, schema, topic, and header/payload consistency before posting.
  • Use a durable PostgreSQL inbox keyed by event ID to absorb at-least-once redelivery.
  • Reuse Ledger Service posting idempotency and append-only persistence safeguards.
  • Record governed validation/conflict failures through the existing failure outbox path when identifiers are available.
  • Keep Kafka consumption opt-in for SIT until the complete Transaction-to-Ledger rollout is ready.

Definition of Done

  • Valid commands create one immutable ledger entry and one completion outbox event.
  • Duplicate event delivery does not create another entry or completion event.
  • Invalid governed commands create a failure outcome without a ledger posting.
  • Inbox rows and ledger rows remain append-only.
  • Existing Maven, PostgreSQL/Testcontainers, and Helm verification pass.
  • The implementation PR links this task and the parent transfer story.

Project Tracking

  • Sprint: Sprint 3 - Internal Transfers and Event Consistency
  • Service: ledger-service
  • Priority: P0
  • Assignee: ramioooz

Activity

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

    @ramioooz
    MemberAuthor

    Implementation PR opened: ledger-service#18.

    Related merged work: transaction-service#13 provides the transaction-side ledger transport, while transaction-service#15 and config-repo#38 provide the SIT runtime prerequisite. No merge delay is required. Keep the Ledger consumer disabled until the topic, producer, and database configuration are deployed; then enable it and roll out Ledger Service.

    Branch verification passed: 21 unit-phase tests and 28 Testcontainers PostgreSQL integration tests, with no failures.

  4. ramioooz commented on Sep 4, 2026

    @ramioooz
    MemberAuthor

    Completed by merged ledger-service#17. Ledger command consumption, governed payload validation, durable inbox handling, immutable posting reuse, and completion/failure outbox behavior are implemented. Enabling the consumer in local SIT remains separate work under task #213, with config-repo#41 still awaiting 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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions