feat(time): join work-item names (ticket/project/task) into the time-entry response #250
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-332-time-entry-work-item-names"
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?
Summary
The time-entries list could only render a bare
Ticket/Project/-label becauseTimeEntryResponsecarried ids but no work-item names. Task names in particular are not client-resolvable (there is no global tasks list endpoint, only/projects/{id}/tasksper project), so the rollup must come from the server. MAPPS-168 needs the real name, including the task title, on the list.Changes
TimeEntryResponseand the internalTimeEntryRow:ticket_number,ticket_title,project_name,task_title(allOption<String>), populated in theFrom<TimeEntryRow>impl.list_time_entries,get_time_entry), addLEFT JOIN tickets / projects / tasksand selecttk.ticket_number, tk.title AS ticket_title, pr.name AS project_name, ta.title AS task_title.tenant_id/id/created_at, the list query's data predicates andORDER BYare qualified with thetealias to avoid ambiguous-column errors. The count query has no join and stays on bare columns.Tenant safety
time_entries.project_id/task_idare bare UUIDs (no FK). RLS (tenant_isolation, FORCE) ontickets/projects/tasksscopes the LEFT JOINs to the caller's tenant underbegin_with_tenant, so a stale or cross-tenant id resolves to a null name rather than leaking another tenant's work-item name.Tests
time_entry_response_carries_work_item_names(HTTP-level, green against a throwaway Postgres):ticket_number+ticket_title = "Printer down", nullproject_name/task_titleproject_name = "Delivery"+task_title = "Build", null ticket fieldsFull
time_trackingsuite: 6/6 (the existing happy-path, which lists with aticket_idfilter through the new joined query, still passes).#PMS-332