DECCF · Cash Flow Modeler and Calculator

Model a household with declarative rows and funding

Declare each person once as a typed row. input.objectArray() provides the schema and initial values; the Calculator uses that schema to create editable person cards with add and remove controls. repeat() uses each row to create its entity and the declarations that depend on that person. Stable IDs keep the rows connected when someone is added, removed, or reordered.

Filter the repeated collection to select adults, then use the salary column as weights in proportional(). A household budget can use funding to turn that allocation into balanced transfers to the household. The engine owns row binding, allocation, account resolution, and transfer posting. The model only states the domain fields and rule.

The full code is available in the Calculator as Household budget · proportional funding (available in Marketplace). The fixed contributions example (available in Marketplace) uses the same cards and repeats salary and Swedish tax per adult, then transfers each person's declared monthly contribution.

You can extend the row schema with fields such as familyRole, dateOfBirth, salary, or contribution. Use input.enum() for a closed set of roles, input.money() for currency-bound values, and input.id({ generate: "uuid" }) for generated IDs on new cards. An explicit item schema lets users start with an empty collection. Required fields remain editable in the draft and are validated when the model runs.

Pick the right declaration

Use allocation() when you need a report of calculated shares and do not want to book payments. Use transfer() for a known payment between two owners. Use funding() when a need should be allocated across sources and those allocations should be posted as transfers. Each layer reuses the same proportional or priority solver.

householdBudget({ household, members, funding }) composes a domain budget need with the general funding rule. Read result.component(budget).total for need by period and fundingShares, fundingShortfall, and fundingTransfers when a funding rule is present. The budget payments remain ordinary account postings and are counted once in cashflow totals.

Saved Calculator models keep their input rows and named scenario drafts with the source. Each scenario has an independent collection, so adding or removing one person's card in a scenario does not change the base model or another scenario.