feat(domain): allocation rules become a dated series
Post.standingRule becomes Post.rules: RuleVersion[], resolved by ruleAt() as the last version effective at or before a month. Per-month overrides still win outright; a post with no applicable version allocates zero rather than applying its earliest rule backwards. allocationFor keeps its signature, so the fold, the views and the ODS export are untouched. Settings gets a read-only rule summary for now; the history editor follows.
This commit is contained in:
@@ -8,7 +8,7 @@ import type { Dataset } from "../domain/types.ts";
|
||||
function populated(): Dataset {
|
||||
const data = createSeedDataset("2026-01");
|
||||
data.months[0]!.income = { amount: 20000, currency: "DKK" };
|
||||
data.posts[1]!.standingRule = { kind: "percentOfIncome", percent: 25 };
|
||||
data.posts[1]!.rules = [{ from: "2026-01", rule: { kind: "percentOfIncome", percent: 25 } }];
|
||||
data.purchases.push({
|
||||
id: "p1",
|
||||
date: "2026-01-15",
|
||||
|
||||
Reference in New Issue
Block a user