Skip to content

Serve budget windows through /v2/reports #4289

Closed

Description

@anth-volk

The detailed-save API's /v2/reports (#4281, with #4286's missing-parameter refusal) reads and creates economy reports only, and answers 422 "cannot read yet" for a budget window.

A budget window is a report comparing a baseline and a reform in each year of a window of consecutive years. Its row has reports.budget_window_size and reports.year (the first year); each calculation of it is a budget_window_runs row, and each year of that calculation a report_runs row naming the window run and its year.

/v2/reports should:

  • read a budget window with its newest budget-window run and that run's years, and, once the run has succeeded, its result in today's budget-window format (each year's budget figures and their totals), rebuilt from each year's stored rows;
  • list budget windows beside economy reports, without results;
  • create a budget window (kind budget_window, with the first year and budget_window_size) through the simulation service's POST /reports, after the same checks as an economy report;
  • refuse a saved report whose budget_window_years disagrees with the window of the detailed-save report it names.

Reading a window's definition and runs, listing and saving must never read the window's figures, so a window whose result cannot be read can still be listed and saved. Re-running and listing runs come later.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions