Bug: ServiceRequest missing decline transitions from quoted and accepted states #206

Closed
opened 2026-06-13 22:06:54 +00:00 by ldraney · 0 comments
Owner

Type

Bug

Lineage

Related to ldraney/landscaping-assistant #122 — the accepted state was added post-spec without a decline exit.

Repo

ldraney/landscaping-assistant

What Broke

The VALID_TRANSITIONS map in app/models/service_request.rb is missing a decline path from the accepted state. Once a quote is accepted, there is no way to cancel — a customer who changes their mind is locked in.

Note: quoted → declined is already implemented (initial report was incorrect). Only accepted → declined is missing.

Repro Steps

  1. Create a ServiceRequest with status requested
  2. Transition to quoted, then to accepted
  3. Attempt service_request.transition_to("declined") — returns false
  4. Observe: no way to decline from accepted state

Expected Behavior

accepted → declined should be a valid transition. Either party should be able to back out after accepting but before paying.

Environment

  • Cluster/namespace: all (model-level logic)
  • Service version/commit: 5391056 (Add ServiceRequest model with status transition validation #178)
  • Related alerts: none

Acceptance Criteria

  • accepted → declined transition is valid
  • Spec updated to test accepted → declined
  • docs/service-requests.md updated to reflect accepted as implemented (was incorrectly noted as "planned for #179")
  • ldraney/landscaping-assistant #122 — ServiceRequest model
  • ldraney/landscaping-assistant #176 — Property detail projects display
  • ldraney/landscaping-assistant #179 — Admin project workflow
### Type Bug ### Lineage Related to `ldraney/landscaping-assistant #122` — the `accepted` state was added post-spec without a decline exit. ### Repo `ldraney/landscaping-assistant` ### What Broke The `VALID_TRANSITIONS` map in `app/models/service_request.rb` is missing a decline path from the `accepted` state. Once a quote is accepted, there is no way to cancel — a customer who changes their mind is locked in. **Note:** `quoted → declined` is already implemented (initial report was incorrect). Only `accepted → declined` is missing. ### Repro Steps 1. Create a ServiceRequest with status `requested` 2. Transition to `quoted`, then to `accepted` 3. Attempt `service_request.transition_to("declined")` — returns `false` 4. Observe: no way to decline from `accepted` state ### Expected Behavior `accepted → declined` should be a valid transition. Either party should be able to back out after accepting but before paying. ### Environment - Cluster/namespace: all (model-level logic) - Service version/commit: `5391056` (Add ServiceRequest model with status transition validation #178) - Related alerts: none ### Acceptance Criteria - [x] `accepted → declined` transition is valid - [x] Spec updated to test `accepted → declined` - [x] `docs/service-requests.md` updated to reflect `accepted` as implemented (was incorrectly noted as "planned for #179") ### Related - `ldraney/landscaping-assistant #122` — ServiceRequest model - `ldraney/landscaping-assistant #176` — Property detail projects display - `ldraney/landscaping-assistant #179` — Admin project workflow
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#206
No description provided.