What is the Finance MVP? #59

Closed
opened 2026-11-23 16:05:25 -05:00 by bobby · 2 comments
Owner

Part of #44

Question

What does the finance domain need at MVP: core entities (accounts, transactions, categories, budgets?), the first endpoints/flows, how data gets in (manual, import, bank feed later), and what is explicitly deferred?

Part of #44 ## Question What does the finance domain need at MVP: core entities (accounts, transactions, categories, budgets?), the first endpoints/flows, how data gets in (manual, import, bank feed later), and what is explicitly deferred?
bobby added the wayfinder:grilling label 2026-11-23 16:05:25 -05:00
bobby added a new dependency 2026-11-23 16:05:35 -05:00
bobby self-assigned this 2026-11-24 15:57:43 -05:00
Author
Owner

Resolution: Finance MVP

Finance in v1 is a ledger plus a zero-based Budget per owner, filled by importer Bots through an idempotent ingest endpoint. It replaces the Owner's hand-filled spreadsheet. Terms are in GLOSSARY.md → Finance.

Ownership (ADR-0001 / ADR-0005 applied)

  • A Financial Account is Personal data (e.g. Diamond CU, Chase, Apple Card) or Household data (the joint Capital One card and Fulton checking). Its Transactions inherit its owner. Partner adoption is uncertain, but the joint Accounts are Household data either way.
  • Financial Accounts and Transactions never change owner. This narrows ADR-0001's "Personal → Household move" for Finance. To bring a card into the Household, set tracked_until on the Personal Account and archive it, then create a new Household Account with tracked_from on the same date. History stays where it was spent. The two Accounts aren't linked, so the Household never sees a reference to Personal data.
  • Categories: Household Categories can be used on Household Transactions and on any Household member's Personal Transactions. Personal Categories are visible to, and usable by, only their Person. A Person may promote a Personal Category to Household (one way).
  • Budgets: one per owner. The Household Budget counts only Household Accounts. A Person's Budget counts only that Person's Personal Accounts. Splitting a cost between them means a real transfer between Accounts (see Offsets).

Entities

  • Financial Account: name; type checking|savings|credit_card|cash; institution; currency; owner; tracked_from / tracked_until; archived. No balances in v1.
  • Transaction: Financial Account; amount_minor (signed integer cents, negative = money out); occurred_on (purchase date, required; the importer falls back to the posted date if the source lacks one); posted_on (optional); raw payee + normalized payee; external_id (unique per Account, absent for manual entries); Category; categorized_by = manual|learned; note; dismissed; recorded_by. Posted only: no pending Transactions.
  • Category: name; kind expense|income|transfer; owner; archived. Lifecycle: create, rename, archive, merge (A's Transactions, Payee mappings and Targets move to B, then A is archived) and promote. No hard delete of a Category that is in use.
  • Budget: owner; standing expected income.
  • Target: Budget × Category: amount + period monthly|quarterly|annual, effective from a month. Old Targets are kept so past months recompute correctly. A period longer than a month makes the Category Banked for that Budget, and a Banked Target takes an optional opening banked balance.
  • Move: Budget, month, from Category, to Category, amount, recorded_by.
  • Payee mapping: owner, normalized payee → Category.

Budget behaviour

  • Zero-based per month. The Allocation is the Target's monthly share (quarterly ÷ 3, annual ÷ 12) ± Moves. Unassigned = expected income − total Allocations, and the month summary shows it. It is reported, never enforced, so a half-finished rebalance doesn't error.
  • Moves shift Allocation between Categories within a month and never change the total.
  • Leftovers in ordinary Categories are history: they don't carry, and they don't change the Target. Only Banked Categories carry forward: their unspent Allocation accrues as a banked balance, the bill draws it down, and an overdraw goes negative (visible, never clamped) until a Move covers it.
  • Rebalance hint: whenever a month has at least one Category in the red and another still holding money, the summary flags it and lists both sides.
  • The budget month is decided by occurred_on. Months are never locked: summaries are recomputed on read, so late posts land in the right month. The summary also shows expected vs actual income.
  • Offsets: a positive amount in an expense Category reduces that Category's spending. That covers refunds and reimbursements: if joint pays you back for groceries, the joint outflow is Household Groceries and your inflow is Personal Groceries. transfer Transactions (e.g. a card payoff) are excluded from spending and Budgets.

Getting data in

  • Ingest: POST /v1/finance/transactions/ingest takes {financial_account_id, transactions: [{external_id, amount_minor, occurred_on, posted_on?, payee_raw}]} in bounded batches. Each item reports created | duplicate | dismissed | outside_tracked_window. A known external_id is ignored, never updated, so a re-import never overwrites edits. Transactions outside the Account's tracked window are dropped.
  • Importers are Bots outside hAPI, under ordinary ADR-0005 auth: a Household grant finance:write for joint Accounts, a Person's Binding for Personal ones. hAPI holds no bank credentials. Accepted limitation: a domain Scope also lets the Bot read and change Budgets. Finer Finance Scopes are a v2 priority.
  • Categorization order: manual > learned > uncategorized. Bots never set Categories. Categorizing by hand creates or updates the owner's Payee mapping, and ingest applies mappings to new Transactions. Personal Accounts check the Person's mappings first, then the Household's. Household Accounts check only the Household's. Correcting a learned Category updates the mapping. Lists can filter on uncategorized and learned for review.
  • Editing: manual Transactions are fully editable and deletable. On imported Transactions the source facts (amount, dates, raw payee, external_id) are read-only, so only Category and note change. Deleting one dismisses it: it's hidden from Budgets, and its external_id is kept so a re-import doesn't bring it back.
  • No spreadsheet migration. Finance starts fresh, because the spreadsheet is two months old and its Categories are still changing.
  • Sources: see Which sources can feed posted Transactions from our banks and cards?. SimpleFIN Bridge is the likely route for the joint Accounts, with OFX/QFX as the fallback.

API surface (flat, /v1/finance/..., owner + recorded_by on every record)

  • accounts: CRUD, archive.
  • transactions: list (filters: account, owner, month, Category, uncategorized, categorized_by), manual create, patch, delete/dismiss; transactions/ingest.
  • categories: CRUD, archive, /{id}/merge, /{id}/promote.
  • payee-mappings: list, delete.
  • budgets: one per owner, expected income; budgets/{id}/targets; budgets/{id}/moves; budgets/{id}/months/{YYYY-MM} (summary: per-Category Allocation, spent, remaining, banked balance; unassigned; expected vs actual income; rebalance hint).

Deferred past v1

Splits; balances and net worth (later: investments, home and mortgage), with transfer-leg linking arriving alongside it for reconciliation; ML categorization (would sit below Payee mappings); a hand-written rule editor; pending Transactions; bill-due reminders (Scheduling fog); an aggregator running inside hAPI; finer Finance Scopes (v2 priority). Multi-currency is out of scope (USD only, never expected).

## Resolution: Finance MVP Finance in v1 is a **ledger plus a zero-based Budget per owner**, filled by importer Bots through an idempotent ingest endpoint. It replaces the Owner's hand-filled spreadsheet. Terms are in `GLOSSARY.md` → *Finance*. ### Ownership (ADR-0001 / ADR-0005 applied) - A **Financial Account** is Personal data (e.g. Diamond CU, Chase, Apple Card) or Household data (the joint Capital One card and Fulton checking). Its **Transactions inherit its owner**. Partner adoption is uncertain, but the joint Accounts are Household data either way. - **Financial Accounts and Transactions never change owner.** This narrows ADR-0001's "Personal → Household move" for Finance. To bring a card into the Household, set `tracked_until` on the Personal Account and archive it, then create a new Household Account with `tracked_from` on the same date. History stays where it was spent. The two Accounts aren't linked, so the Household never sees a reference to Personal data. - **Categories:** Household Categories can be used on Household Transactions *and* on any Household member's Personal Transactions. Personal Categories are visible to, and usable by, only their Person. A Person may **promote** a Personal Category to Household (one way). - **Budgets:** one per owner. The Household Budget counts only Household Accounts. A Person's Budget counts only that Person's Personal Accounts. Splitting a cost between them means a real transfer between Accounts (see Offsets). ### Entities - **Financial Account**: name; type `checking|savings|credit_card|cash`; institution; currency; owner; `tracked_from` / `tracked_until`; archived. **No balances in v1.** - **Transaction**: Financial Account; `amount_minor` (signed integer cents, negative = money out); `occurred_on` (purchase date, required; the importer falls back to the posted date if the source lacks one); `posted_on` (optional); raw payee + normalized payee; `external_id` (unique per Account, absent for manual entries); Category; `categorized_by` = `manual|learned`; note; `dismissed`; `recorded_by`. **Posted only**: no pending Transactions. - **Category**: name; kind `expense|income|transfer`; owner; archived. Lifecycle: create, rename, archive, **merge** (A's Transactions, Payee mappings and Targets move to B, then A is archived) and promote. No hard delete of a Category that is in use. - **Budget**: owner; standing **expected income**. - **Target**: Budget × Category: amount + period `monthly|quarterly|annual`, effective from a month. Old Targets are kept so past months recompute correctly. A period longer than a month makes the Category **Banked** for that Budget, and a Banked Target takes an optional **opening banked balance**. - **Move**: Budget, month, from Category, to Category, amount, `recorded_by`. - **Payee mapping**: owner, normalized payee → Category. ### Budget behaviour - **Zero-based per month.** The Allocation is the Target's monthly share (quarterly ÷ 3, annual ÷ 12) ± Moves. **Unassigned = expected income − total Allocations**, and the month summary shows it. It is **reported, never enforced**, so a half-finished rebalance doesn't error. - **Moves** shift Allocation between Categories within a month and never change the total. - **Leftovers in ordinary Categories are history**: they don't carry, and they don't change the Target. Only **Banked** Categories carry forward: their unspent Allocation accrues as a banked balance, the bill draws it down, and an overdraw goes **negative** (visible, never clamped) until a Move covers it. - **Rebalance hint:** whenever a month has at least one Category in the red and another still holding money, the summary flags it and lists both sides. - The budget month is decided by `occurred_on`. **Months are never locked**: summaries are recomputed on read, so late posts land in the right month. The summary also shows expected vs actual income. - **Offsets:** a positive amount in an `expense` Category reduces that Category's spending. That covers refunds and reimbursements: if joint pays you back for groceries, the joint outflow is Household *Groceries* and your inflow is Personal *Groceries*. `transfer` Transactions (e.g. a card payoff) are excluded from spending and Budgets. ### Getting data in - **Ingest:** `POST /v1/finance/transactions/ingest` takes `{financial_account_id, transactions: [{external_id, amount_minor, occurred_on, posted_on?, payee_raw}]}` in bounded batches. Each item reports `created | duplicate | dismissed | outside_tracked_window`. A known `external_id` is **ignored, never updated**, so a re-import never overwrites edits. Transactions outside the Account's tracked window are dropped. - **Importers are Bots outside hAPI**, under ordinary ADR-0005 auth: a **Household grant** `finance:write` for joint Accounts, a Person's **Binding** for Personal ones. hAPI holds no bank credentials. Accepted limitation: a domain Scope also lets the Bot read and change Budgets. Finer Finance Scopes are a **v2 priority**. - **Categorization order:** manual > learned > uncategorized. Bots never set Categories. Categorizing by hand creates or updates the owner's **Payee mapping**, and ingest applies mappings to new Transactions. Personal Accounts check the Person's mappings first, then the Household's. Household Accounts check only the Household's. Correcting a learned Category updates the mapping. Lists can filter on *uncategorized* and *learned* for review. - **Editing:** manual Transactions are fully editable and deletable. On imported Transactions the source facts (amount, dates, raw payee, `external_id`) are read-only, so only Category and note change. Deleting one **dismisses** it: it's hidden from Budgets, and its `external_id` is kept so a re-import doesn't bring it back. - **No spreadsheet migration.** Finance starts fresh, because the spreadsheet is two months old and its Categories are still changing. - Sources: see *Which sources can feed posted Transactions from our banks and cards?*. SimpleFIN Bridge is the likely route for the joint Accounts, with OFX/QFX as the fallback. ### API surface (flat, `/v1/finance/...`, `owner` + `recorded_by` on every record) - `accounts`: CRUD, archive. - `transactions`: list (filters: account, owner, month, Category, uncategorized, `categorized_by`), manual create, patch, delete/dismiss; `transactions/ingest`. - `categories`: CRUD, archive, `/{id}/merge`, `/{id}/promote`. - `payee-mappings`: list, delete. - `budgets`: one per owner, expected income; `budgets/{id}/targets`; `budgets/{id}/moves`; `budgets/{id}/months/{YYYY-MM}` (summary: per-Category Allocation, spent, remaining, banked balance; unassigned; expected vs actual income; rebalance hint). ### Deferred past v1 Splits; balances and **net worth** (later: investments, home and mortgage), with **transfer-leg linking** arriving alongside it for reconciliation; ML categorization (would sit below Payee mappings); a hand-written rule editor; pending Transactions; bill-due reminders (Scheduling fog); an aggregator running *inside* hAPI; finer Finance Scopes (v2 priority). **Multi-currency is out of scope** (USD only, never expected).
bobby closed this issue 2026-11-24 22:17:32 -05:00
Author
Owner

Amended by Which importer Bots ship in v1, and where do they run? (#67): occurred_on is now the best-known date, editable on imported Transactions within posted_on − 31 d … posted_on. There's a new dated_by (source|posted|manual), occurred_on is optional on ingest, and a date_review flag covers posted-date rows from days 1–5 of a month. See the resolution on #67.

**Amended by** *Which importer Bots ship in v1, and where do they run?* (#67): `occurred_on` is now the best-known date, editable on imported Transactions within `posted_on − 31 d … posted_on`. There's a new `dated_by` (`source|posted|manual`), `occurred_on` is optional on ingest, and a `date_review` flag covers posted-date rows from days 1–5 of a month. See the resolution on #67.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: bobby/hapi#59