aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-20 09:59:25 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-20 09:59:25 +0200
commitfed4952b5e9e6bc6f9f6ca4a30570b0b898ee953 (patch)
treefef914673c1166c8a9154f4e18934cf96ba619ac
parent3e4619cd98d4660534301bfd10712e5ce9b84425 (diff)
downloadbokf-fed4952b5e9e6bc6f9f6ca4a30570b0b898ee953.tar.gz
bokf-fed4952b5e9e6bc6f9f6ca4a30570b0b898ee953.zip
docs: mark the moms rule editor and pre-migration snapshot donev0.1.46
-rw-r--r--docs/STATE.md26
1 files changed, 18 insertions, 8 deletions
diff --git a/docs/STATE.md b/docs/STATE.md
index aae9906..de87186 100644
--- a/docs/STATE.md
+++ b/docs/STATE.md
@@ -24,7 +24,9 @@ check.
2. **Stack**: C11, Makefile, vendored SQLite 3.53.4 / yyjson 0.13.0 / Argon2
20190702 / SHA-256 (public domain). Only system dep: libncursesw.
3. **Storage**: SQLite WAL, `synchronous=FULL`, STRICT tables, composite-key
- tenant isolation, append-only triggers, `VACUUM INTO` snapshots. Postgres
+ tenant isolation, append-only triggers, `VACUUM INTO` snapshots; forward
+ migrations snapshot to `pre-migration-v<old>-<stamp>.db` first and refuse
+ to migrate without it. Postgres
deliberately rejected for now; keep DB access behind one layer for a later
port.
4. **Protocol**: NDJSON over Unix socket (+ optional plain TCP and a native
@@ -111,6 +113,13 @@ check.
written back on every return; screens own a `static int sel`), so a
sub-screen round-trip or a field save returns the highlight to the
same row.
+18. **Momsregler (2026-09-20)**: the per-org vat `report_rules` are edited
+ with `report.rule_list/create/update/delete` (mutations owner-only,
+ audited, `dry_run`; rules are config, not ledger) and in the TUI
+ **Momsregler** screen under Register. `report.vat` honors `match_type`
+ `account`, `range` and `type`; several rules may share a box and are
+ summed. Only the `vat` report is consumed today, so the commands accept
+ only that report.
## Pending decisions
@@ -134,11 +143,8 @@ check.
org (`board.*`, edited under Företagsuppgifter) and the stämma decision
is posted with a `Utdelning` template (D 2099/K 2898). Imported history
years are read with their "Stäng" closings skipped, so comparisons and
- the flerårsöversikt show real figures. Still missing before filing: a
- command/TUI to edit the moms `report_rules` per org (below).
-- Moms `report_rules` seed is a corrected starter mapping (schema v3), but
- there is still no command/TUI to edit rules per org; add one before filing
- if the mapping needs adjustments (SCHEMA.md §10 promises owner editing).
+ the flerårsöversikt show real figures. The moms `report_rules` are now
+ owner-editable in the **Momsregler** screen (decision 18).
## Backlog (prioritized, from COMPLIANCE.md §10 and the audit)
@@ -168,8 +174,12 @@ check.
5. ~~`report.general_ledger` and `report.voucher_list`~~ implemented
(Huvudbok, Verifikationslista) with Kapitas-style TUI tables; the ledger
API supports `accounts`/`from`/`to`, the list an optional `series`.
-6. `describe` argument schemas (currently name/summary/permission only).
-7. Pre-migration `VACUUM INTO` snapshot (promised in SCHEMA.md, not built).
+6. ~~`describe` argument schemas (currently name/summary/permission only).~~
+ Done: every command carries a `CMD_ARGS` type/required/default schema,
+ the dispatcher validates before the handler and `describe` emits `args[]`.
+7. ~~Pre-migration `VACUUM INTO` snapshot (promised in SCHEMA.md, not built).~~
+ Done: forward migrations snapshot to
+ `backup/pre-migration-v<old>-<stamp>.db` first and abort if that fails.
8. ~~Docker image + compose (multi-arch amd64/arm64, GHCR) and systemd unit.~~
Done as a Dockerfile + `compose.yaml` (amd64/arm64 build stage) and
`scripts/deploy.sh` over SSH; no registry and no systemd unit (the