W168: Delete document
Hard-deletes an attachment. Triggered from the documents section of an order detail page.
Steps
- Assert the row exists.
Documents.getById— 404 when the id doesn't resolve in the caller's org. - Delete.
Documents.delete(documentId)— removes the row, then best-effort deletes the GCS object.
Returns
Nothing (L4 echoes { deletedId }).
Business rules
- The row is the source of truth: row deletion always wins; a failed GCS delete leaves an orphaned object for the sweeper.
Errors
| Condition | Error |
|---|---|
| Document not found in this org | not_found |