Skip to main content

propose

Function propose 

Source
pub async fn propose(
    pool: &PgPool,
    actor: &Actor,
    revision_id: Uuid,
    inputs: Vec<ProposalInput>,
) -> AppResult<Vec<Proposal>>
Expand description

Stores proposals as drafts (all or none). Needs a simulation revision that is still in work and a CAD editor of its project group; the file must exist in the revision and the quote must stand in its text.

ยงInvariants

  • Permission: CAD editor in the project group; the revision is visible (404), belongs to a simulation (400) and is in work (409). No check-out is needed: a proposal is a draft, not a result value.
  • Locks: the simulation revision (FOR UPDATE).
  • Data: at most 50 values per call (400); the file must be in the revision and the quote in its current text (400). A newer proposal replaces a pending one of the same name and load case; more than 200 pending proposals on the revision is a 400.
  • Audit: simulation.proposal.create per proposal, including the quote and the file version.
  • Notifications / webhooks: none.
  • Atomic: one transaction; all proposals are stored or none.