feat(api): maintenance tickets — schema, lifecycle & routes#47
Merged
Conversation
Adds the maintenance_tickets table (migration 0001) plus a shared ticket state machine (OPEN→IN_PROGRESS→RESOLVED→CLOSED, +reopen/cancel) and API: residents raise tickets for their own apartment, admins list all / assign / drive the workflow. Residents see only their apartments' tickets.
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First slice of the maintenance tickets vertical (M2). Backend only — web + mobile UIs follow in separate PRs.
What
0001, additive):maintenance_ticketstable +ticket_status/ticket_category/ticket_priorityenums.OPEN→IN_PROGRESS→RESOLVED→CLOSED, plusreopen(RESOLVED→IN_PROGRESS) andcancel(OPEN/IN_PROGRESS→CANCELLED)./tickets):POST /— residents raise a ticket for an apartment they live in (residency-checked); admins may raise for any.GET /?status=— admins see all; residents see only their apartments' tickets.POST /:id/transition(admin) — drives the lifecycle;resolvestampsresolvedAt+ optional note; illegal transitions → 409.PATCH /:id/assign(admin) — assigns to a user (validates the assignee exists → 404).Verified E2E (curl, live Neon)
assignedTo; bogus assignee → 404.GETreturns only their apartment's tickets;?status=CLOSEDfilter honored.