Repository navigation
Wallet: exportable CSV statements (activity + per-child) - #220
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Working todo.md #2 (Wallet — full family financial OS). The wallet is already deeply wired (allowance cron credits the immutable ledger, AI coach reads real balances, reconcile is surfaced in admin); the only honest "coming soon" left is Stripe-Issuing cards. The real missing capability for a financial OS is an exportable statement — added it. - lib/wallet/activity.ts: pure toStatementCsv (RFC-4180 escaping; running balance computed oldest->newest over completed rows so the newest row shows the current total) + statementFilename. +6 tests (wallet-activity now 10). - activity-view.tsx: "Statement" download button respecting the active child/type/direction filters (disabled when empty); client-side Blob, no server round-trip. - child-detail-view.tsx: per-child "Statement" button in the Activity header. Verified: tsc clean, eslint clean, 1536 tests pass (+5), next build exit 0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJs1Px4GTVtA1jmzDZ4ShU
seed_wallet_ledger_one_family.sql + db:seed:wallet-ledger script. Seeds 500 public.wallet_transactions (the 0088 child allowance ledger the /wallet/activity page and the new CSV statement export read) for the target family: ensures the family wallet + a child_wallet with Spend/Save/Give/Invest buckets for each non-manager member, then 500 transactions across 8 types, both directions, 4 statuses, and ~180 days. RLS-repair preamble, metadata->>'seed'='wallet_ledger' idempotent tagging (delete-before-insert), verification SELECT. Validated on throwaway PG16: 500 rows, idempotent on re-run (still 500), every row has a resolved bucket, parent correctly excluded from child wallets. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJs1Px4GTVtA1jmzDZ4ShU
NewWorldVenture
force-pushed
the
claude/wallet-statement-export
branch
from
July 4, 2026 16:34
b7f53b5 to
71b4d6e
Compare
NewWorldVenture
marked this pull request as ready for review
July 4, 2026 16:55
This branch was successfully deployed
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.
Summary
Working
todo.md#2 — Wallet, full family financial OS. An audit first confirmed the wallet is already deeply wired end-to-end:app/api/cron/wallet-allowance) credits the immutable ledger viacreditChildWalletand advancesnext_run_on./api/ai/wallet) computes balances from the ledger./admin/wallet/reconciliation.The real missing capability for a "financial OS" is an exportable statement. Added it:
Changes
lib/wallet/activity.ts— new puretoStatementCsv(txns):statementFilename(now)→bubaly-wallet-statement-YYYY-MM-DD.csv.components/wallet/activity-view.tsx— a Statement download button that exports exactly what's in view (respects the active child / type / direction filters; disabled when empty). Client-sideBlobdownload — no server round-trip, no external deps.components/wallet/child-detail-view.tsx— a per-child Statement button in the Activity header, exporting that child's history with their name.Tests
tests/wallet-activity.test.ts+6 (now 10): header/row shape, oldest→newest running balance, pending excluded from balance, RFC-4180 escaping, filename stamp.Verification
tsc --noEmitcleaneslintclean on changed filesvitest— 1536 tests pass (+5)next build— exit 0Remaining wallet gaps noted in the handoff for follow-up: Stripe Issuing (blocked on keys), a parent "run allowance now"/catch-up trigger (cron-only today), and a statement date-range picker.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VJs1Px4GTVtA1jmzDZ4ShU
Generated by Claude Code