fix(tickets): honour contact_id filter on list_tickets (MAPPS-311) #362

Merged
YousifShkara merged 1 commit from fix/MAPPS-311-tickets-contact-id-filter into main 2026-06-25 11:01:26 +02:00
Owner

QA report: a freshly-created contact's "Recent Tickets" rail rendered
tenant-wide tickets instead of the contact's. Confirmed the SPA sends
?contact_id={id} correctly; the bug was on the server.

build_ticket_filter_sql had branches for status_id, priority_id,
queue_id, company_id, assigned_to_id, asset_id, etc., but no
branch for filter.contact_id. The DTO field deserialised so no 422
fired, but the value was dropped on the way into the SQL. Add the
mirror branch alongside company_id and asset_id.

Integration test list_filters_by_contact_id seeds two contacts on
the same company, attaches a ticket to one; ?contact_id={A} returns
only that ticket, ?contact_id={B} returns nothing, the unfiltered
list still includes the ticket.

#MAPPS-311

QA report: a freshly-created contact's "Recent Tickets" rail rendered tenant-wide tickets instead of the contact's. Confirmed the SPA sends `?contact_id={id}` correctly; the bug was on the server. `build_ticket_filter_sql` had branches for `status_id`, `priority_id`, `queue_id`, `company_id`, `assigned_to_id`, `asset_id`, etc., but no branch for `filter.contact_id`. The DTO field deserialised so no 422 fired, but the value was dropped on the way into the SQL. Add the mirror branch alongside `company_id` and `asset_id`. Integration test `list_filters_by_contact_id` seeds two contacts on the same company, attaches a ticket to one; `?contact_id={A}` returns only that ticket, `?contact_id={B}` returns nothing, the unfiltered list still includes the ticket. #MAPPS-311
fix(tickets): honour contact_id filter on list_tickets (MAPPS-311)
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 58s
Check / fmt + clippy + build + tests (pull_request) Successful in 4m35s
Integration / integration tests (pull_request) Successful in 14m43s
Create release / Create release from merged PR (pull_request) Successful in 3s
248c1b0b26
QA report: a freshly-created contact's "Recent Tickets" rail rendered
tenant-wide tickets instead of the contact's. Confirmed the SPA sends
`?contact_id={id}` correctly; the bug was on the server.

`build_ticket_filter_sql` had branches for `status_id`, `priority_id`,
`queue_id`, `company_id`, `assigned_to_id`, `asset_id`, etc., but no
branch for `filter.contact_id`. The DTO field deserialised so no 422
fired, but the value was dropped on the way into the SQL. Add the
mirror branch alongside `company_id` and `asset_id`.

Integration test `list_filters_by_contact_id` seeds two contacts on
the same company, attaches a ticket to one; `?contact_id={A}` returns
only that ticket, `?contact_id={B}` returns nothing, the unfiltered
list still includes the ticket.

#MAPPS-311
YousifShkara deleted branch fix/MAPPS-311-tickets-contact-id-filter 2026-06-25 11:01:26 +02:00
Sign in to join this conversation.
No reviewers
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
psa-systems/mokosh-server!362
No description provided.