Allow cancel and approve transitions from any ticket state
Description
Recent Comments
## Code Review: PASS ### Changes Reviewed **File: app/models/ticket.rb** - `approve` event: Now allows transitions from all 7 states (backlog, todo, in_progress, pending_audit, review, pending_approval, blocked) → done - Excludes: `done`, `cancelled` (correct - cannot approve already done or cancelled tickets) - Guard: `all_subtasks_completed?` preserved ✓ - After callback: `completed_at` set ✓ - `cancel` event: Now allows transitions from all 8 states (backlog, todo, in_progress, pending_audit, review, pending_approval, done, blocked) → cancelled - Excludes: `cancelled` (correct - cannot cancel already cancelled tickets) **File: spec/models/ticket_spec.rb** - Added 5 new tests for approve from: backlog, todo, in_progress, pending_audit, blocked - Added 4 new tests for cancel from: pending_audit, review, pending_approval, done - All 46 tests pass ✓ ### Acceptance Criteria Met - ✓ cancel transition available from all states (except cancelled) - ✓ approve transition available from all states (except done/cancelled) - ✓ Tests added for global cancel/approve - ✓ No breaking changes to existing workflow ### Verification - State machine correctly covers all 9 possible states - PO override commands properly bypass normal workflow constraints - Guard conditions preserved - All existing tests continue to pass
Ticket Stats
Comments
1 commentsAdd a Comment
No Subtasks Yet
Break down this ticket into smaller, manageable subtasks