feat: support unassigned purchases and allocation status
Continuous Integration / lint-and-test (push) Successful in 13s
Continuous Integration / docker-build-and-push (push) Successful in 35s

Allow month-only purchases to start finance plans. Keep unbudgeted posts distinct from explicit zero rules in overspend reporting.
This commit is contained in:
Lucas Winther
2026-09-30 13:10:10 +02:00
parent c1446db39f
commit b0e8145d2e
31 changed files with 469 additions and 80 deletions
+5 -6
View File
@@ -53,6 +53,11 @@ describe("round trip", () => {
});
describe("validation", () => {
test("accepts a purchase with no post and preserves it through export", () => {
const data = populated();
data.purchases[0]!.splits = [];
expect(parseDatasetJson(exportDatasetJson(data)).purchases[0]!.splits).toEqual([]);
});
test("rejects malformed JSON", () => {
expect(() => parseDatasetJson("{not json")).toThrow(ImportValidationError);
});
@@ -89,12 +94,6 @@ describe("validation", () => {
expect(() => parseDatasetJson(JSON.stringify(data))).toThrow(/exactly one/i);
});
test("rejects a purchase with no splits", () => {
const data = populated();
data.purchases[0]!.splits = [];
expect(() => parseDatasetJson(JSON.stringify(data))).toThrow(/at least one split/i);
});
test("rejects an unsupported currency", () => {
const data = populated() as any;
// CHF, not GBP: GBP is one of the currencies the app ships with now.