Skip to content

TASK: Define account reservation and transfer workflow event contracts #172

Closed

Description

@ramioooz

Type: Task
Parent: #61
Epic: Banking Domain Vertical Slice
Slice: Slice 5 - Internal Transfer and Slice 7 - Events + Notification
Service: event-contracts
Priority: P0

Objective

Complete the governed Kafka contract needed by Account Service and Transaction Service to coordinate reservations, ledger posting, and transfer outcomes without sharing handwritten Java DTOs.

Scope

  • Define versioned events for account reservation accepted, reservation rejected, reservation released, and transfer workflow outcomes.
  • Define command/event ownership, required headers, correlation and causation rules, partition keys, ordering guarantees, at-least-once delivery, retry, and dead-letter behavior.
  • Define the relationship between transfer identifiers, reservation request identifiers, ledger posting identifiers, account identifiers, currency, and decimal-string amounts.
  • Define compatibility and evolution rules suitable for Schema Registry.
  • Add AsyncAPI documents and contract assertions that can run in CI.
  • Document which events are published by Transaction Service, Account Service, and Ledger Service, and which events each service consumes.

Acceptance Criteria

  • Account and Transaction Service adapters can implement the contract without importing shared service Java classes.
  • Every event has a stable version, producer, consumer, event identity, correlation identity, and partitioning rule.
  • Reservation and transfer state transitions are unambiguous for success, rejection, timeout, retry, and compensation.
  • Duplicate and out-of-order delivery behavior is documented.
  • AsyncAPI validation and compatibility checks pass in CI.
  • The contract is linked from the service implementation tasks and project handoff.

Dependencies

This task must remain under parent story #61 and must be implemented through a non-draft PR. Do not merge directly to main.

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