fix(tickets): scope writes to tenant and validate FK references #209

Merged
David merged 3 commits from fix/pms-193-scope-tickets-writes-validate-fk into main 2026-06-13 23:42:03 +02:00
Owner

add_note UPDATEd tickets filtered only by id, so a cross-tenant ticket_id corrupted another tenant's updated_at/first_response_at/SLA columns; both UPDATEs are now scoped by tenant_id and the ticket is FK-validated before the note INSERT.

create_ticket now FK-validates type_id/category_id, update_ticket now FK-validates priority_id/queue_id, and assign_ticket now validates assigned_to_id belongs to the tenant, so a request body cannot link a ticket to another tenant's row.

#PMS-193

add_note UPDATEd tickets filtered only by id, so a cross-tenant ticket_id corrupted another tenant's updated_at/first_response_at/SLA columns; both UPDATEs are now scoped by tenant_id and the ticket is FK-validated before the note INSERT. create_ticket now FK-validates type_id/category_id, update_ticket now FK-validates priority_id/queue_id, and assign_ticket now validates assigned_to_id belongs to the tenant, so a request body cannot link a ticket to another tenant's row. #PMS-193
fix(tickets): scope writes to tenant and validate FK references
Some checks failed
E2E / Playwright against staging (pull_request) Failing after 16s
Check / fmt + clippy + compile + tests (pull_request) Failing after 2m35s
0433815bd4
add_note UPDATEd tickets filtered only by id, so a cross-tenant ticket_id corrupted another tenant's updated_at/first_response_at/SLA columns; both UPDATEs are now scoped by tenant_id and the ticket is FK-validated before the note INSERT.

create_ticket now FK-validates type_id/category_id, update_ticket now FK-validates priority_id/queue_id, and assign_ticket now validates assigned_to_id belongs to the tenant, so a request body cannot link a ticket to another tenant's row.

#PMS-193
Merge origin/main into fix/pms-193-scope-tickets-writes-validate-fk
Some checks failed
E2E / Playwright against staging (pull_request) Failing after 18s
Check / fmt + clippy + compile + tests (pull_request) Successful in 4m49s
bde8f81f73
#PMS-193
ci: re-trigger Check (transient failure; green locally)
Some checks failed
Create release / Create release from merged PR (pull_request) Has been skipped
E2E / Playwright against staging (pull_request) Failing after 24s
Check / fmt + clippy + compile + tests (pull_request) Successful in 4m23s
3154fbaf3c
#PMS-193
David merged commit 85fd769008 into main 2026-06-13 23:42:03 +02:00
David deleted branch fix/pms-193-scope-tickets-writes-validate-fk 2026-06-13 23:42:03 +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!209
No description provided.