Commit Graph
14 Commits
Author SHA1 Message Date
Lucas WintherandClaude Opus 5 438d53d016 feat(domain): add seed dataset and domain barrel
Add SCHEMA_VERSION and createSeedDataset to initialize first-run state
with three budget envelopes (Video Games, Food, Events and Social),
newId() for generating unique identifiers, and complete the domain
export barrel with all pure domain modules.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-01 19:51:57 +02:00
Lucas Winther 564a5f4079 feat(domain): add month, year, and summary view models
All three aggregate over foldBalances rather than recomputing rollover.
2026-09-01 19:48:48 +02:00
Lucas Winther 4077036ca7 feat(domain): add the envelope rollover fold
Unspent carries forward, overspend carries as debt. This is the single
implementation of the rollover math.
2026-09-01 19:45:31 +02:00
Lucas Winther 71d69c20b3 feat(domain): distribute purchase slices across posts
Slices are weighted by the whole-purchase split parts, so financed split
purchases need no special case and parts always sum to the slice total.
2026-09-01 19:40:32 +02:00
Lucas WintherandClaude Opus 5 0df1971a03 feat(domain): resolve allocation rules
Month overrides win over standing rules; percentages above 100 are allowed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-01 19:37:09 +02:00
Lucas WintherandClaude Opus 5 9af581e69c fix(domain): add month range validation to parse and monthOf
Shape-valid but out-of-range months (e.g., month 13 or 00) previously
normalized silently through ordinal arithmetic, resulting in wrong months
downstream. Now throw on invalid month values (< 1 or > 12), with the
offending value in the error message.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-01 16:33:27 +02:00
Lucas WintherandClaude Opus 5 bab6fc5f3e feat(domain): add currency conversion
Missing rates throw MissingRateError rather than silently treating the
value as base currency.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-01 16:31:22 +02:00
Lucas WintherandClaude Opus 5 261c6fa9ad feat(domain): add MonthId arithmetic
Uses a month ordinal rather than Date, so month stepping is timezone-proof.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-01 16:28:18 +02:00
Lucas Winther b2fa0e1b58 feat(domain): add money arithmetic with exact distribution
Distribution computes the remainder part by subtraction so float splits
always sum exactly to the total. Omits money() and addAmounts() from the
brief since no downstream task consumes either and the brief's own tests
don't cover them.
2026-09-01 16:25:40 +02:00
Lucas Winther e1ac6d9fac feat(domain): add domain types 2026-09-01 16:22:40 +02:00
Lucas Winther 26752aa225 chore: scaffold Bun + React + shadcn project
bun init --react=shadcn, with the demo API routes removed since this app
has no backend. Adds project invariants to CLAUDE.md and a smoke test
proving the domain layer imports with no DOM.
2026-09-01 16:18:55 +02:00
Lucas WintherandClaude Opus 5 abd77c58ed docs: add budget app implementation plan
25 TDD tasks across five phases: foundation, pure domain core, IndexedDB
persistence, JSON/ODS export, UI, and shipping (PWA + Docker + CI).

Self-review caught five defects, fixed inline:
- distributeByWeight divided by zero on all-zero weights, which a
  zero-total purchase reaches and which would take the whole fold down
- summaryView's fold binding needed an explicit type or CI typecheck fails
- a duplicated module import in registerSw.ts
- a shell render test that would break once its routes read the store,
  since happy-dom has no IndexedDB
- an unreadable assertion in the ODS numeric-cell test

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-01 16:13:40 +02:00
Lucas WintherandClaude Opus 5 6833a58c91 docs: add budget app design spec
Design for a personal budgeting PWA replacing a spreadsheet workflow.

Key decisions captured:
- Static SPA, no backend in the data path, so it deploys to both GitHub
  Pages and a self-hosted Docker image from one build artifact
- Bun toolchain (bun init --react=shadcn); no Vite, no Electron
- Pure derivation core over an IndexedDB fact store; envelope rollover
  makes caching worthless, so every figure is folded from raw facts
- One Purchase entity covers simple, split, and financed purchases, which
  is what lets splits and finance plans compose without special-casing
- Money is a float, with mandatory rounding at boundaries and last-part-
  by-subtraction so distributed parts sum exactly to the whole

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-01 15:50:46 +02:00
Lucas Winther eba36fad9d Initial commit 2026-09-01 15:23:37 +02:00