Expand description
Per-year return_inputs(year, inputs_json) side-table — the full-return v1 input surface (line
items + PII + payments). A projection input, not ledger state (NFR6). Mirrors tax_profile.rs
exactly (idempotent DDL, robust-to-older-vaults guard, typed error on bad JSON) — one JSON-encoded
ReturnInputs per tax year, stored inside the encrypted vault.
Constants§
- SCHEMA_
VERSION - The current row schema.
Functions§
- all
- Return all stored inputs, sorted by year ascending.
- delete
- Delete the stored
ReturnInputsforyear(used byincome clear). Returnstrueif a row existed. - exists
- Whether a
ReturnInputsexists foryear(used by thetax-profile setguard — SPEC §4.12/D-4). ASELECT 1existence probe (does not deserialize the blob — review M5). - get
- Return the stored
ReturnInputsforyear, orNoneif none has been set. Robust to older vaults (ensures the table first); typed error on malformed JSON. - init_
table - Create the
return_inputsside-table if it does not exist, and bring an OLDER vault’s table up to the current schema. Idempotent — it runs on everyget/set, so it must be safe to call repeatedly. - set
- Persist
rias theReturnInputsforyear(upsert — replaces any prior value). - years
- The years that have stored inputs, ascending — WITHOUT deserializing any blob, so a single corrupt row cannot break enumeration (review N3: one bad blob must not brick the read-only viewer).