Skip to content

test(backend): verify snapshot totals reconcile with derived tables#1794

Open
brentthomas248 wants to merge 1 commit into
QuickLendX:mainfrom
brentthomas248:test/backend-snapshot-integrity
Open

test(backend): verify snapshot totals reconcile with derived tables#1794
brentthomas248 wants to merge 1 commit into
QuickLendX:mainfrom
brentthomas248:test/backend-snapshot-integrity

Conversation

@brentthomas248

Copy link
Copy Markdown

Closes #1730

Summary:

  • Add SnapshotScheduler integrity coverage that seeds an in-memory better-sqlite3 ledger and reconciles snapshot counts and totals against derived-table sums.
  • Capture bids, settlements, disputes, and notifications in derived-state snapshots instead of only invoice rows.
  • Cover empty state, PII redaction, point-in-time mutation behavior, mid-batch marking, and retention pruning.

Tests:

  • npm --prefix backend test -- snapshot --runInBand
  • disposable clean clone: git apply patch; npm --prefix backend ci; npm --prefix backend test -- snapshot --runInBand
  • git diff --check

Notes:

  • npm --prefix backend run lint is unavailable because backend/package.json has no lint script.
  • Full backend Jest and tsc checks still have existing unrelated baseline failures outside this snapshot change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: add a snapshot integrity verifier comparing SnapshotService output against derived-table sums

1 participant