feat: financial data integrity & reconciliation (#96)#478
Open
sinatragianpaolo-oc wants to merge 3 commits intorohitdash08:mainfrom
Open
feat: financial data integrity & reconciliation (#96)#478sinatragianpaolo-oc wants to merge 3 commits intorohitdash08:mainfrom
sinatragianpaolo-oc wants to merge 3 commits intorohitdash08:mainfrom
Conversation
e5abe2e to
c9338da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements financial data integrity detection and reconciliation to fix #96.
Detects missing or inconsistent financial records and provides a per-month reconciliation summary.
Endpoints
GET/integrity/checkGET/integrity/reconciliationBoth JWT-protected. Query params:
months(1–12, default 3),anchor(YYYY-MM-DD).Alert types
duplicate_expenseorphan_categorymissing_recurring_instancenegative_net_flowAlerts include a
suggestionfield with a human-readable remediation step.Example response
{ "healthy": false, "alert_counts": { "high": 1, "medium": 0, "low": 1, "total": 2 }, "alerts": [ { "type": "duplicate_expense", "severity": "high", "count": 2, "amount": 500.0, "spent_at": "2026-03-10", "suggestion": "Review and delete extra copies if they are duplicates." }, ... ], "reconciliation": [ { "period": "2026-03", "income": 50000, "expenses": 38000, "net_flow": 12000, "balanced": true }, ... ] }Files
app/services/integrity.py— 4 integrity checks + reconciliation engineapp/routes/integrity.py— Flask blueprinttests/test_integrity.py— 28 tests (unit + HTTP + user isolation)/claim #96
Closes #96