Skip to main content

obsolete

Function obsolete 

Source
pub async fn obsolete(
    pool: &PgPool,
    actor: &Actor,
    id: Uuid,
) -> AppResult<Revision>
Expand description

Marks a released revision as obsolete.

§Invariants

  • Permission: CAD editor; the revision is visible (“not found” otherwise) and in a group the actor may edit (403); it is released (409 otherwise), and its group does not require a change order for it (obsolete_requires_change, 409).
  • Locks: the revision row (revisions::lock).
  • Audit: revision.obsolete; when it is the latest revision of its item, also impact.flag for its dependents (impacts::on_obsolete).
  • Notifications: the watchers of the item; when the latest revision became obsolete also the people responsible for the flagged dependents.
  • Webhooks: revision.obsoleted.
  • Data: when it is the latest revision, the open impacts on the item are resolved and its dependents are flagged.
  • Atomic: one transaction.