You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Serve economy reports and simulations from the detailed-save tables at /v2/reports and /v2/simulations #4280
The detailed-save API stores simulations, reports, their runs and their results in the Public API's own v2 tables, which the simulation service and its Modal workers write. The Public API has no route that reads them, and no route that asks the simulation service to create an economy (society-wide) report or simulation.
Wanted:/v2/reports (economy kind) and /v2/simulations in the Public API.
Reads come from the tables alone, never from the simulation service, and never start a run. A report is returned with its newest run and, once that run has succeeded, its result rebuilt from the result tables into the SingleYearMacroOutput shape. Each run's package versions are returned beside the current ones, so a client can mark a report whose newest run used an older version. A list returns up to 25 named reports in one query.
Creates check the country and every named policy, then ask the simulation service to create the record and start its run. They take include_cliffs and an SPM selection, and no version: the simulation service runs its default worker's version.
Errors must never invite a resubmission that could duplicate a report and its calculation without saying so.
Saved reports and saved simulations can hold a detailed-save report_id or simulation_id, checked in the same transaction against the tables' foreign keys.
Re-runs, refusals of policies with missing parameters, budget windows and household reports are separate work.
This replaces #4108, whose design (reads through the simulation service, lookup by v1 report number, a run started on first read) no longer fits.
Activity