Chart-specific query parameters shared across report chart handlers.
chart_kind maps to plotting::ChartKind; chart_series is a
report-specific toggle (e.g. Activity: show Net or not) parsed in
each handler. renderer picks between server-side SVG (default)
and client-side canvas.
A single card in the top-of-report summary strip. is_net flags cards
that show a signed net (e.g. Income − Expense) so templates can
style them distinctly; highlight is a generic accent slot.
Query-string fields shared by every report page to drive client-side
table controls. The server only needs to read commodity_columns (which
drives a template pivot) and forward collapsed_depth into the template
for initial fold state; sort_by is consumed purely by the frontend
WASM reorder logic, so the Rust handler does not parse it.
Ok(None) means no filter was asked for. A filter that was asked for and
could not be parsed is an error, never None: falling back to “no filter”
answers a narrower question with a broader report — right status, wrong
numbers, no signal to the reader.
Collect the set of commodity symbols present across all rows, in the
order the row-data first mentions them. Drives the “Commodities as
columns” pivot: a stable column ordering without depending on the
user’s commodity list.
Minimal URL-query encoder for the (key, value) pairs the chart
endpoints take. Avoids pulling in serde_urlencoded just to
stringify a handful of params — keeps the handler simple.
Parse a YYYY-MM-DD string into UTC. end_of_day controls whether the
resulting instant sits at 00:00 (range start) or 23:59:59 (range end /
as-of cutoff).
Parse the shared sort_order query param. Balance and Breakdown
accept the same names; this keeps the URLs consistent between
them. Unknown values fall back to AmountDesc so a stale URL
still renders.
Sort top-level rows in place according to order. Children ride
with their parent — they’re adjacent in the flattened view and we
preserve that adjacency by sorting on a key derived from each
top-level row alone.