Description
Add a dedicated API endpoint to cancel pending/triggering database triggers and set their expires_at field for cleanup.
Context
The TriggerStatusEnum includes a CANCELLED status, but there is currently no code path that sets triggers to this status or assigns an expires_at timestamp for cancelled triggers. This capability should be implemented via a new API endpoint.
Requirements
- Implement API endpoint to cancel triggers
- Add
mark_as_cancelled() function (similar to mark_as_failed and mark_as_triggered) to update trigger status to CANCELLED and set expires_at
- Ensure TTL-based cleanup applies to cancelled triggers (already configured in the index)
References
Description
Add a dedicated API endpoint to cancel pending/triggering database triggers and set their
expires_atfield for cleanup.Context
The
TriggerStatusEnumincludes aCANCELLEDstatus, but there is currently no code path that sets triggers to this status or assigns anexpires_attimestamp for cancelled triggers. This capability should be implemented via a new API endpoint.Requirements
mark_as_cancelled()function (similar tomark_as_failedandmark_as_triggered) to update trigger status to CANCELLED and setexpires_atReferences