feat(time): General/ticketless time logging with own-company attribution (MAPPS-243) #277

Merged
vas2000-work merged 1 commit from feat/MAPPS-243-general-ticketless-time-logging into main 2026-06-18 06:53:13 +02:00
Owner

Implements the frontend half of ticketless time logging (MAPPS-243), the SPA-side counterpart to PMS-394 / PMS-413. Adds a "General (no ticket or project)" option to the log-time Work Item selector so users can log overhead time with no ticket and no project; the entry is attributed to the tenant's own company (own_company_id, surfaced on /auth/me by PMS-413) and classified server-side via work_category = "general", with the existing ticket and project flows now sending "ticketed"/"project". The own_company_id is threaded onto the client CurrentUser (DTO + the /auth/me MeBody deserializer, defaulted None at id-token-sourced construction sites since the post-login /me fetch reconciles it). The "Please pick a work item." validation no longer blocks a General entry, and the list renders a "General" label distinct from the "-" used for unlinked entries. Defensive against a pre-backfill tenant: when own_company_id is absent the General option is disabled with an inline notice and the submit path refuses rather than sending a null company_id. Verified in the dev container: rustfmt, clippy -D warnings, wasm check, and the full test suite (165 passing, incl new work_item_label cases).

#MAPPS-243

Implements the frontend half of ticketless time logging (MAPPS-243), the SPA-side counterpart to PMS-394 / PMS-413. Adds a "General (no ticket or project)" option to the log-time Work Item selector so users can log overhead time with no ticket and no project; the entry is attributed to the tenant's own company (`own_company_id`, surfaced on `/auth/me` by PMS-413) and classified server-side via `work_category = "general"`, with the existing ticket and project flows now sending `"ticketed"`/`"project"`. The `own_company_id` is threaded onto the client `CurrentUser` (DTO + the `/auth/me` `MeBody` deserializer, defaulted None at id-token-sourced construction sites since the post-login `/me` fetch reconciles it). The "Please pick a work item." validation no longer blocks a General entry, and the list renders a "General" label distinct from the "-" used for unlinked entries. Defensive against a pre-backfill tenant: when `own_company_id` is absent the General option is disabled with an inline notice and the submit path refuses rather than sending a null `company_id`. Verified in the dev container: rustfmt, clippy -D warnings, wasm check, and the full test suite (165 passing, incl new work_item_label cases). #MAPPS-243
feat(time): add General work item for ticketless time logging
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m11s
Create release / Create release from merged PR (pull_request) Has been skipped
0403ad0fae
Add a "General (no ticket or project)" option to the log-time Work Item selector so a user can log overhead time with no ticket and no project, attributed to the tenant's own company. Selecting it sends ticket_id/project_id/task_id = none, company_id = the tenant's own_company_id, and work_category = "general"; the ticket and project branches now send "ticketed" and "project" respectively, all of which pass the server's derive_work_category consistency check (PMS-394).

Thread own_company_id (PMS-413) from the server onto the client CurrentUser: add the field to the CurrentUser DTO and to the /auth/me MeBody deserializer in hooks/auth.rs where the live value actually arrives, and default it to None at the id-token-sourced construction sites (rehydrate, OIDC callback, dev bypass) since the post-login /me fetch reconciles it within a tick.

Drop the "Please pick a work item." hard failure for the General case so a ticketless entry submits; the empty placeholder still errors. Defensive: when own_company_id is None (a tenant that predates the PMS-413 backfill) the General option is disabled with an inline notice and the submit path re-checks and refuses rather than POSTing a null company_id, so no company id is ever invented.

Carry work_category on RemoteTimeEntry and render a "General" label in the time-entry list for a ticketless overhead entry, distinct from the "-" shown for a truly unlinked entry. Add unit tests for work_item_label covering the general, unlinked, ticketed, and project cases.

#MAPPS-243

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vas2000-work deleted branch feat/MAPPS-243-general-ticketless-time-logging 2026-06-18 06:53:38 +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-apps!277
No description provided.