Skip to content

Transaction category corrections

ID MOD-166
System SD01
Repo bank-core
Build status Deployed
Deployed Yes
Last commit 2b41724

Captures customer and back-office corrections to transaction categorisation, satisfying FR-239. Owns the accounts.transaction_overrides table — an append-only Cat 1 immutable register of every category override applied to a posting.

A single Lambda (IAM_AUTH Function URL) accepts POST /internal/v1/transactions/{posting_id}/overrides. The handler validates the posting_id belongs to the claimed customer (via accounts.postings → accounts.account_party_relationships), records the correction, and returns the created row. No correction is ever mutated — a customer changing their mind writes a new row; the latest created_at wins for downstream retraining purposes.

The table feeds MOD-041's weekly retrain via the MOD-042 CDC pipeline. MOD-041 is bootstrap-resilient and operates without corrections until this module is deployed. Once deployed and the CDC path is wired, stg_customer_corrections in MOD-041's dbt project automatically picks up the live corrections data — no MOD-041-side code change required.

CDC inclusion is a separate bank-platform/MOD-042 action (file handoff to add accounts.transaction_overrides to Firehose routing + Glue + Snowflake External Table). Non-blocking for MOD-166's own build.


Module dependencies

Depends on

Module Title Required? Contract Reason
MOD-001 Double-entry posting engine Required Validates correction posting_id against accounts.postings (owned by MOD-001) before recording the override.
MOD-041 Categorisation & merchant enrichment model Optional MOD-041's weekly retrain consumes accounts.transaction_overrides via CDC. MOD-041 is bootstrap-resilient — MOD-166 does not depend on MOD-041, but MOD-041 is the primary downstream consumer of MOD-166's data.
MOD-104 AWS shared infrastructure bootstrap Required AWS shared infrastructure provisioned by MOD-104 (EventBridge buses, S3, KMS, Cognito) is required before this module can be deployed.
MOD-103 Neon database platform bootstrap Required Neon database and schema provisioned by MOD-103 must exist before this module can read or write Postgres.

Required by

(No modules in this wiki currently declare a dependency on this module.)


Policies satisfied

(No policies assigned)


Capabilities satisfied

(No capabilities mapped)


Part of SD01 — Core Banking Platform Compiled 2026-05-22 from source/entities/modules/MOD-166.yaml