Support deleting decisions

What

Add support for deleting decisions from the decision log.

This builds on the storage and retrieval work in #615863 (closed) and the CRUD API work in #603067 (closed).

How

  • Add a delete mutation/API for decisions (and cascade to their options/associated records where applicable).
  • Enforce the appropriate permissions and feature flag gating.
  • Add specs covering the delete paths.

Specifics

  • Hard deletes (destroys record)
    • Cascade deletes when work items are deleted ( ✅ already covered by DB)
    • API for hard deletes (destroys decision record)
      • Should apply only to open decisions
      • Resolved decisions should not be able to be manually destroyed. They can only be cascade deleted.
  • Soft deletes (record stays)
    • API for soft deleting resolved decisions
      • Decision record stays, but should be marked with an "archived" state
        • We should add a status attribute, containing the following active/resolved/archived in an enum.
          • Note: start the enums at 1 instead of 0 in case we want to switch to FixedItemsModel later
  • User must have write permissions to delete a decision
  • This should all be behind the decision_log FF
Edited by Richard Chan