test(tickets): pin priority round-trip on ticket create (PMS-358) #270
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-358-priority-roundtrip-integration-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
External review reported "select Priority = High on New Ticket, ticket saves as Medium" everywhere downstream (detail, list, dashboard, widget). Medium is the seeded default priority (023_seed_data.sql), and the create path falls back to that default only when
priority_idis absent from the request. The server create path itself bindsrequest.priority_idstraight into the INSERT (src/modules/tickets/service.rs), so a present, validpriority_idalready persists unchanged.This adds a server-side integration test that enumerates every tenant priority via GET /api/v1/tickets/priorities, creates a ticket with each explicit
priority_id, and asserts both the create response and a fresh GET carry that exact id+name (never the default), while company/status/joined fields still resolve. The test passes against all four seeded priorities (Critical, High, Medium, Low), proving the backend round-trips priority correctly and is not the source of the regression.Remediation note: because the server stores whatever
priority_idthe form sends and only defaults to Medium when the field is omitted, the "High -> Medium" symptom maps to the SPA New Ticket form droppingpriority_idbefore POST (suspects a/b in the issue: onchange writing a different signal, or submit ignoring the selection). The fix belongs in the mokosh-apps SPA, not this repo. Existing data: any tickets created through the broken form carry the default Medium rather than the intended value; this is staging-only at present and the call on backfill is left to operators - this change does not retroactively repair rows.#PMS-358