Skip to content

TASK: Implement transfer-risk decision gate #205

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

Description

@ramioooz

Objective

Implement the first deterministic transfer-risk decision gate inside Transaction Service using the approved versioned risk/step-up contract.

Scope

  • Normalize transfer intent fields before evaluation.
  • Evaluate the configured local policy and return exactly one of ALLOW, REQUIRE_STEP_UP, or DECLINE.
  • Support the initial transfer classifications INTERNAL, DOMESTIC, and INTERNATIONAL.
  • Configure policy version, decision TTL, high-value threshold, and explicitly declined classifications through Config Server/SIT values; do not hard-code business thresholds in clients.
  • Persist the decision binding with the transfer workflow so account reservation and ledger posting cannot start when step-up is required or the decision is expired.
  • Make a decision request idempotent and reject reuse with a changed normalized intent.
  • Keep OTP values, tokens, raw credentials, and unnecessary device data outside Transaction Service persistence and logs.
  • Preserve the existing ledger-driven saga boundary. MFA challenge creation/verification remains a separate child task under Story STORY: Require MFA for high-value internal, domestic, and international transfers #56.

Acceptance Criteria

  • Equivalent normalized intent retries return the same decision and transfer identity.
  • A changed intent with the same decision request identifier returns 409 Conflict.
  • ALLOW continues to the existing reservation action.
  • REQUIRE_STEP_UP returns a transfer-bound decision and emits no reservation or ledger action until assurance is recorded.
  • DECLINE terminates the workflow without reservation or ledger posting.
  • Expired, replayed, or mismatched decisions fail closed.
  • The API/OpenAPI contract, SIT configuration, and verification procedure document the behavior.

Dependencies

This is local SIT implementation only. External policy engines, AWS deployment, and production threshold governance remain deferred.

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