Skip to content

Infrastructure: Transaction Processing Pipeline Refactor #628

@SatyamPandey-07

Description

@SatyamPandey-07

Objective: Decouple the monolithic transaction creation/update logic into a multi-stage pipeline with status tracking (Pending, Processing, Validated, Archived).

Files Involved (~8):
routes/transactions.js
: Update API logic to handle asynchronous status.
services/transactionService.js
: Core "juggling" to split logic into pre-save and post-save hooks.
models/Transaction.js
: Schema expansion for state management and processing logs.
services/ruleEngine.js
: Refactor to operate as a middleware in the processing pipeline.
services/revaluationService.js
: Update to ignore "unvalidated" transactions for net worth snapshots.
middleware/transactionValidator.js: (New) Move validation logic out of routes.
services/eventDispatcher.js: (New) Handle cross-cutting impact (Budget updates, Goal tracking).
scripts/transactionMigration.js: (New) Heavy migration script for existing data.
Code Volume: High. Requires moving existing logic across 4 new/refactored services and adding extensive error handling/status mapping.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions