Skip to main content

Module return_inputs

Module return_inputs 

Source
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 ReturnInputs for year (used by income clear). Returns true if a row existed.
exists
Whether a ReturnInputs exists for year (used by the tax-profile set guard — SPEC §4.12/D-4). A SELECT 1 existence probe (does not deserialize the blob — review M5).
get
Return the stored ReturnInputs for year, or None if none has been set. Robust to older vaults (ensures the table first); typed error on malformed JSON.
init_table
Create the return_inputs side-table if it does not exist, and bring an OLDER vault’s table up to the current schema. Idempotent — it runs on every get/set, so it must be safe to call repeatedly.
set
Persist ri as the ReturnInputs for year (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).