Skip to content

Let users save named dynamics through /v2/user-dynamics #4336

Open

Description

@anth-volk

API v1 stores dynamics (a report's model assumptions: every parameter under gov.simulation., plus the US top-level simulation.) once per country, catalog version and content hash, with no name or description (#4325). Users need to save named dynamics and pick one per report, as they save named policies through user_policies.

What's needed

  • A user_dynamics table built like user_policies, without its v1 reference, baseline and provenance. It holds the owner (a signed-in user or a signed-out browser), the country, a dynamic stored in that country (RESTRICT), and a name and description.
  • /v2/user-dynamics routes shaped like /v2/user-policies, with the same ownership rules, and the runtime role's grants.
  • Saved dynamics are treated like the other saved items: they're deleted with their user, move to the account at sign-in, and are listed in the account export.

v1 no longer writes saved policies (its saved-policy routes were removed on 2026-10-22), so no v1-to-v2 copy creates saved dynamics. The one-time migration of existing rows creates them.

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