BillTracker/client/components/data
null 1238ac5b14 feat(demo): full "take it for a ride" seed + surgical, correct removal
The demo seeder created bills + categories only, so nearly every page
rendered empty; clear-demo had a data-loss bug and error-protection gaps.

Seed now populates every user-facing surface: bills with autopay states,
3-6 months of payment history (with drift + debt paydown), monthly
skips/overrides/snoozes/notes, a demo bank source + accounts + matched/
unmatched/subscription transactions, categorised spending + budgets +
rules, planning income/starting-amounts, category groups, an active
snowball plan (+ extra-payment), merchant rules, and a calendar feed —
so a new user can explore Tracker (incl. overdue/drift), Analytics,
Summary, Spending, Snowball, Payoff, Transactions, Matches, Subscriptions,
Banking and Calendar with realistic data.

Correct removal (the emphasis):
- Migration v1.07 adds an is_seeded marker to the 12 user-scoped,
  non-cascading demo tables (bill-children cascade with their seeded bill).
- clearSeededDemoData() (new, in userDataService alongside eraseUserData)
  removes ONLY seeded rows in one transaction, child->parent, and keeps a
  seeded category if a user's own bill still references it.
- Fixes the category collision: seed marks ONLY categories it creates, so
  clear no longer deletes the user's default categories / uncategorises
  their real bills.

Error protection: idempotency guard on seeded (not all) bills -> 409
instead of a fake "created 0"; whole seed wrapped in one transaction
(atomic); rate-limit + audit + standardizeError on all three routes;
seeded-status reports payments/transactions counts; dead --force removed.
Client copy/counts corrected.

Verified: typecheck/check clean; server suite 232/232 (+6 new); client
typecheck/lint/build clean; e2e probe 17/17; on a COPY of the real prod
DB the v1.07 migration applies (integrity ok) and a seed->clear round-trip
on the data-rich user restores their real data byte-for-byte with no
orphans.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 13:06:47 -05:00
..
AutoMatchReview.tsx refactor(ts): convert data/ shared + small sections to TypeScript 2026-07-04 21:33:25 -05:00
BankSyncSection.tsx refactor(brand): adopt new primitives in admin + data + dialogs 2026-07-05 17:19:03 -05:00
ConnectionHero.tsx refactor(ts): convert data/ shared + small sections to TypeScript 2026-07-04 21:33:25 -05:00
DataNav.tsx refactor(ts): convert data/ shared + small sections to TypeScript 2026-07-04 21:33:25 -05:00
DownloadMyDataSection.tsx feat(tracker): export/print the month + calendar link (plan C1/C2) 2026-07-05 14:49:09 -05:00
EraseDataSection.tsx refactor(ts): convert data/ shared + small sections to TypeScript 2026-07-04 21:33:25 -05:00
ImportHistorySection.tsx refactor(ts): convert data/ shared + small sections to TypeScript 2026-07-04 21:33:25 -05:00
ImportMyDataSection.tsx refactor(ts): convert data/ import + matching sections to TypeScript 2026-07-04 21:42:18 -05:00
ImportOfxSection.tsx refactor(ts): convert data/ shared + small sections to TypeScript 2026-07-04 21:33:25 -05:00
ImportSpreadsheetSection.tsx refactor(ts): convert ImportSpreadsheetSection to TypeScript — data/ dir complete 2026-07-04 21:56:04 -05:00
ImportTransactionCsvSection.tsx refactor(ts): convert data/ import + matching sections to TypeScript 2026-07-04 21:42:18 -05:00
SeedDemoDataSection.tsx feat(demo): full "take it for a ride" seed + surgical, correct removal 2026-07-06 13:06:47 -05:00
TransactionMatchingSection.tsx refactor(client): de-duplicate parseUtc + settingEnabled to lib/utils (plan A2/A3) 2026-07-05 14:38:12 -05:00
dataShared.tsx refactor(ts): convert data/ shared + small sections to TypeScript 2026-07-04 21:33:25 -05:00