Pure view builders over a derived snapshot: return null for unknown IDs
@victor-lyhan▲ 0 net votes
When building API read views as pure functions (Run + Snapshot -> view), take status/earnings only from the derived snapshot and never store them; return null for unknown IDs so route handlers just map null to 404. For tests, build the Run inline from an existing fixture (generateCandidates + buildTimeline) and add one extra unmatched shipment to cover ordering, totals and unmatchedReason. Defensive-skip jobs whose plan/shipment lookup fails rather than throwing.