@open-mercato/core 0.7.1-develop.7178.1.ab93fbaf4e → 0.7.1-develop.7180.1.9717fbbb43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/dist/generated/entities/staff_time_entry/index.js +14 -0
- package/dist/generated/entities/staff_time_entry/index.js.map +2 -2
- package/dist/generated/entities/staff_time_entry_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_entry_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_project/index.js +16 -0
- package/dist/generated/entities/staff_time_project/index.js.map +2 -2
- package/dist/generated/entities/staff_time_report/index.js +57 -0
- package/dist/generated/entities/staff_time_report/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_entry/index.js +27 -0
- package/dist/generated/entities/staff_time_report_entry/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_event/index.js +21 -0
- package/dist/generated/entities/staff_time_report_event/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_project/index.js +15 -0
- package/dist/generated/entities/staff_time_report_project/index.js.map +7 -0
- package/dist/generated/entities/staff_time_tag/index.js +21 -0
- package/dist/generated/entities/staff_time_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task/index.js +37 -0
- package/dist/generated/entities/staff_time_task/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_comment/index.js +21 -0
- package/dist/generated/entities/staff_time_task_comment/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_status/index.js +29 -0
- package/dist/generated/entities/staff_time_task_status/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_task_tag/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +11 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +149 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/timesheetFixtures.js +7 -0
- package/dist/helpers/integration/timesheetFixtures.js.map +2 -2
- package/dist/modules/auth/cli.js +16 -0
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/lib/backendChrome.js +1 -0
- package/dist/modules/auth/lib/backendChrome.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js +44 -0
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js.map +7 -0
- package/dist/modules/customer_accounts/setup.js +1 -28
- package/dist/modules/customer_accounts/setup.js.map +2 -2
- package/dist/modules/data_sync/api/options.js +2 -0
- package/dist/modules/data_sync/api/options.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +39 -17
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/lib/start-controls.js +42 -0
- package/dist/modules/data_sync/lib/start-controls.js.map +7 -0
- package/dist/modules/staff/acl.js +9 -1
- package/dist/modules/staff/acl.js.map +2 -2
- package/dist/modules/staff/ai-agents.js +142 -0
- package/dist/modules/staff/ai-agents.js.map +7 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js +348 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js.map +7 -0
- package/dist/modules/staff/ai-tools/types.js +54 -0
- package/dist/modules/staff/ai-tools/types.js.map +7 -0
- package/dist/modules/staff/ai-tools.js +8 -0
- package/dist/modules/staff/ai-tools.js.map +7 -0
- package/dist/modules/staff/analytics.js +84 -1
- package/dist/modules/staff/analytics.js.map +2 -2
- package/dist/modules/staff/api/guards.js +37 -3
- package/dist/modules/staff/api/guards.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js +131 -0
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js.map +7 -0
- package/dist/modules/staff/api/portal/time-reports/route.js +179 -0
- package/dist/modules/staff/api/portal/time-reports/route.js.map +7 -0
- package/dist/modules/staff/api/team-members/self/route.js +1 -3
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js +174 -0
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js.map +7 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js +226 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +15 -8
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/route.js +13 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js +42 -0
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js +383 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +14 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js +168 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js +246 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js +183 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js +164 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js +360 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/route.js +316 -0
- package/dist/modules/staff/api/timesheets/reports/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js +63 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js +164 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js +168 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/route.js +199 -0
- package/dist/modules/staff/api/timesheets/settings/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/access.js +76 -0
- package/dist/modules/staff/api/timesheets/tags/access.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js +235 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/route.js +160 -0
- package/dist/modules/staff/api/timesheets/tags/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js +233 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js +188 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js +399 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js +210 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js +333 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js +228 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js +29 -10
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +31 -18
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +21 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +27 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +215 -32
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js +378 -0
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js +340 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/route.js +238 -26
- package/dist/modules/staff/api/timesheets/time-entries/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +23 -8
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js +209 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js +59 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/route.js +264 -22
- package/dist/modules/staff/api/timesheets/time-projects/route.js.map +2 -2
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js +110 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js +981 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js +583 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js +15 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js +65 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js +229 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js +1014 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js +97 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js +1040 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js +19 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js +353 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js +457 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js +697 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js +174 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js +546 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js +710 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js +646 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/page.js +4 -793
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js +2 -7
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js +5 -136
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js +5 -445
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js.map +3 -3
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js +4 -76
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +4 -613
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js +2 -17
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js.map +2 -2
- package/dist/modules/staff/ce.js +40 -0
- package/dist/modules/staff/ce.js.map +2 -2
- package/dist/modules/staff/cli.js +166 -1
- package/dist/modules/staff/cli.js.map +2 -2
- package/dist/modules/staff/commands/index.js +5 -0
- package/dist/modules/staff/commands/index.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js +569 -21
- package/dist/modules/staff/commands/timesheets-entries.js.map +3 -3
- package/dist/modules/staff/commands/timesheets-projects.js +450 -7
- package/dist/modules/staff/commands/timesheets-projects.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-reports.js +1036 -0
- package/dist/modules/staff/commands/timesheets-reports.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tags.js +1015 -0
- package/dist/modules/staff/commands/timesheets-tags.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js +438 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js +723 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tasks.js +834 -0
- package/dist/modules/staff/commands/timesheets-tasks.js.map +7 -0
- package/dist/modules/staff/data/enrichers.js +426 -12
- package/dist/modules/staff/data/enrichers.js.map +2 -2
- package/dist/modules/staff/data/entities.js +552 -3
- package/dist/modules/staff/data/entities.js.map +2 -2
- package/dist/modules/staff/data/extensions.js +41 -0
- package/dist/modules/staff/data/extensions.js.map +7 -0
- package/dist/modules/staff/data/validators.js +254 -9
- package/dist/modules/staff/data/validators.js.map +2 -2
- package/dist/modules/staff/di.js +42 -1
- package/dist/modules/staff/di.js.map +2 -2
- package/dist/modules/staff/events.js +84 -6
- package/dist/modules/staff/events.js.map +2 -2
- package/dist/modules/staff/events.payloads.js +158 -0
- package/dist/modules/staff/events.payloads.js.map +7 -0
- package/dist/modules/staff/extension-points.js +261 -0
- package/dist/modules/staff/extension-points.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js +138 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js +12 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js +133 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js +19 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js.map +7 -0
- package/dist/modules/staff/lib/crud.js +11 -1
- package/dist/modules/staff/lib/crud.js.map +2 -2
- package/dist/modules/staff/lib/time-tracking/access.js +92 -0
- package/dist/modules/staff/lib/time-tracking/access.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/billability.js +39 -0
- package/dist/modules/staff/lib/time-tracking/billability.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js +68 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js +15 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/cost.js +82 -0
- package/dist/modules/staff/lib/time-tracking/cost.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/duration.js +55 -0
- package/dist/modules/staff/lib/time-tracking/duration.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js +41 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/interval.js +72 -0
- package/dist/modules/staff/lib/time-tracking/interval.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js +88 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js +10 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js +87 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js +27 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js +16 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js +135 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js +187 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js +80 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js +56 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js +63 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js +62 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js +21 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js +34 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js +66 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js +39 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js +214 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settings.js +87 -0
- package/dist/modules/staff/lib/time-tracking/settings.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js +9 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js +48 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js +283 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js +324 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js +121 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js +89 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js +855 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js +360 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js +259 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js +238 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js +130 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js +98 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js +27 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js +166 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js +295 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js +212 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js +729 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js +217 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js +158 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js +224 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js +93 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js +1196 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js +307 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js +284 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js +73 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js +1499 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js +95 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js +61 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js +45 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js +82 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js +5 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js +152 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js +92 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js +111 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js +243 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js +105 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js +132 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js +205 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js +53 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js +77 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js.map +7 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js +809 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js.map +7 -0
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js +2 -3
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js.map +2 -2
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js +152 -0
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js +36 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js +66 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js +78 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js +81 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js +44 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js +169 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js +22 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js +51 -1
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js +70 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js +63 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js +170 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js +205 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js +68 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js +135 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js +48 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js +262 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js +34 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js +79 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js +11 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js +83 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js +42 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js +107 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js +289 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js +145 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js +116 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js +50 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js +27 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js +65 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js +17 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js +51 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js +11 -4
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/ListView.js +369 -111
- package/dist/modules/staff/lib/timesheets-ui/ListView.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js +47 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js.map +2 -2
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js +79 -0
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js +15 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js.map +7 -0
- package/dist/modules/staff/notifications.client.js +16 -0
- package/dist/modules/staff/notifications.client.js.map +7 -0
- package/dist/modules/staff/notifications.handlers.js +80 -0
- package/dist/modules/staff/notifications.handlers.js.map +7 -0
- package/dist/modules/staff/notifications.js +168 -0
- package/dist/modules/staff/notifications.js.map +2 -2
- package/dist/modules/staff/search.js +159 -1
- package/dist/modules/staff/search.js.map +2 -2
- package/dist/modules/staff/setup.js +20 -1
- package/dist/modules/staff/setup.js.map +2 -2
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js +68 -0
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js +149 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js +78 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js +78 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js.map +7 -0
- package/dist/modules/staff/translations.js +4 -1
- package/dist/modules/staff/translations.js.map +2 -2
- package/dist/modules/staff/widgets/components.js +7 -0
- package/dist/modules/staff/widgets/components.js.map +7 -0
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js +5 -4
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js.map +2 -2
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js +135 -0
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js.map +7 -0
- package/dist/modules/staff/widgets/notifications/index.js +5 -0
- package/dist/modules/staff/widgets/notifications/index.js.map +7 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js +43 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js.map +7 -0
- package/generated/entities/staff_time_entry/index.ts +7 -0
- package/generated/entities/staff_time_entry_tag/index.ts +6 -0
- package/generated/entities/staff_time_project/index.ts +8 -0
- package/generated/entities/staff_time_report/index.ts +27 -0
- package/generated/entities/staff_time_report_entry/index.ts +12 -0
- package/generated/entities/staff_time_report_event/index.ts +9 -0
- package/generated/entities/staff_time_report_project/index.ts +6 -0
- package/generated/entities/staff_time_tag/index.ts +9 -0
- package/generated/entities/staff_time_task/index.ts +17 -0
- package/generated/entities/staff_time_task_comment/index.ts +9 -0
- package/generated/entities/staff_time_task_status/index.ts +13 -0
- package/generated/entities/staff_time_task_tag/index.ts +6 -0
- package/generated/entities.ids.generated.ts +11 -1
- package/generated/entity-fields-registry.ts +149 -0
- package/package.json +7 -7
- package/src/helpers/integration/timesheetFixtures.ts +31 -1
- package/src/modules/auth/README.md +1 -1
- package/src/modules/auth/cli.ts +35 -1
- package/src/modules/auth/i18n/de.json +7 -0
- package/src/modules/auth/i18n/en.json +7 -0
- package/src/modules/auth/i18n/es.json +7 -0
- package/src/modules/auth/i18n/ko.json +7 -0
- package/src/modules/auth/i18n/pl.json +7 -0
- package/src/modules/auth/lib/backendChrome.tsx +1 -0
- package/src/modules/customer_accounts/lib/customerRoleAcls.ts +79 -0
- package/src/modules/customer_accounts/setup.ts +1 -45
- package/src/modules/data_sync/AGENTS.md +34 -0
- package/src/modules/data_sync/api/options.ts +2 -0
- package/src/modules/data_sync/backend/data-sync/page.tsx +82 -33
- package/src/modules/data_sync/i18n/de.json +1 -0
- package/src/modules/data_sync/i18n/en.json +1 -0
- package/src/modules/data_sync/i18n/es.json +1 -0
- package/src/modules/data_sync/i18n/ko.json +1 -0
- package/src/modules/data_sync/i18n/pl.json +1 -0
- package/src/modules/data_sync/lib/adapter.ts +45 -0
- package/src/modules/data_sync/lib/start-controls.ts +89 -0
- package/src/modules/staff/AGENTS.md +769 -1
- package/src/modules/staff/acl.ts +9 -0
- package/src/modules/staff/ai-agents.ts +189 -0
- package/src/modules/staff/ai-tools/time-tracking-pack.ts +494 -0
- package/src/modules/staff/ai-tools/types.ts +82 -0
- package/src/modules/staff/ai-tools.ts +13 -0
- package/src/modules/staff/analytics.ts +113 -0
- package/src/modules/staff/api/guards.ts +85 -3
- package/src/modules/staff/api/leave-requests/accept/route.ts +0 -2
- package/src/modules/staff/api/leave-requests/reject/route.ts +0 -2
- package/src/modules/staff/api/portal/time-reports/[id]/route.ts +182 -0
- package/src/modules/staff/api/portal/time-reports/route.ts +270 -0
- package/src/modules/staff/api/team-members/self/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/assign/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +0 -2
- package/src/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.ts +292 -0
- package/src/modules/staff/api/timesheets/access-requests/route.ts +299 -0
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +15 -7
- package/src/modules/staff/api/timesheets/my-projects/route.ts +14 -1
- package/src/modules/staff/api/timesheets/my-work/myWorkAggregate.ts +90 -0
- package/src/modules/staff/api/timesheets/my-work/route.ts +475 -0
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +15 -2
- package/src/modules/staff/api/timesheets/reports/[id]/close/route.ts +203 -0
- package/src/modules/staff/api/timesheets/reports/[id]/export/route.ts +315 -0
- package/src/modules/staff/api/timesheets/reports/[id]/sheet/route.ts +220 -0
- package/src/modules/staff/api/timesheets/reports/[id]/unlock/route.ts +208 -0
- package/src/modules/staff/api/timesheets/reports/preview/route.ts +449 -0
- package/src/modules/staff/api/timesheets/reports/route.ts +386 -0
- package/src/modules/staff/api/timesheets/reports/shared.ts +121 -0
- package/src/modules/staff/api/timesheets/settings/reapply-rounding/route.ts +205 -0
- package/src/modules/staff/api/timesheets/settings/rounding-impact/route.ts +226 -0
- package/src/modules/staff/api/timesheets/settings/route.ts +242 -0
- package/src/modules/staff/api/timesheets/tags/access.ts +134 -0
- package/src/modules/staff/api/timesheets/tags/entry-assignments/route.ts +290 -0
- package/src/modules/staff/api/timesheets/tags/route.ts +177 -0
- package/src/modules/staff/api/timesheets/tags/task-assignments/route.ts +294 -0
- package/src/modules/staff/api/timesheets/task-statuses/route.ts +232 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/comments/route.ts +532 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/status/route.ts +271 -0
- package/src/modules/staff/api/timesheets/tasks/route.ts +443 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.ts +306 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.ts +32 -10
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +32 -17
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +27 -6
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +36 -6
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +331 -34
- package/src/modules/staff/api/timesheets/time-entries/copy-day/route.ts +533 -0
- package/src/modules/staff/api/timesheets/time-entries/overlaps/route.ts +457 -0
- package/src/modules/staff/api/timesheets/time-entries/route.ts +378 -24
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +31 -9
- package/src/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.ts +246 -0
- package/src/modules/staff/api/timesheets/time-projects/[id]/employees/route.ts +62 -2
- package/src/modules/staff/api/timesheets/time-projects/route.ts +397 -22
- package/src/modules/staff/backend/staff/time-tracking/board/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/board/page.tsx +151 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.tsx +1229 -0
- package/src/modules/staff/backend/staff/time-tracking/page.meta.ts +11 -0
- package/src/modules/staff/backend/staff/time-tracking/page.tsx +823 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.tsx +81 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.tsx +275 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.tsx +1420 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.tsx +109 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.meta.ts +15 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.tsx +1254 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.ts +466 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.tsx +632 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.tsx +867 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.tsx +246 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.tsx +701 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/GridView.tsx +953 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.tsx +800 -0
- package/src/modules/staff/backend/staff/timesheets/page.meta.ts +6 -6
- package/src/modules/staff/backend/staff/timesheets/page.tsx +12 -1010
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.tsx +4 -158
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.tsx +4 -609
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.tsx +3 -89
- package/src/modules/staff/backend/staff/timesheets/projects/page.meta.ts +2 -19
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +3 -778
- package/src/modules/staff/ce.ts +63 -0
- package/src/modules/staff/cli.ts +207 -1
- package/src/modules/staff/commands/index.ts +5 -0
- package/src/modules/staff/commands/timesheets-entries.ts +1006 -28
- package/src/modules/staff/commands/timesheets-projects.ts +593 -7
- package/src/modules/staff/commands/timesheets-reports.ts +1329 -0
- package/src/modules/staff/commands/timesheets-tags.ts +1315 -0
- package/src/modules/staff/commands/timesheets-task-comments.ts +583 -0
- package/src/modules/staff/commands/timesheets-task-statuses.ts +889 -0
- package/src/modules/staff/commands/timesheets-tasks.ts +1121 -0
- package/src/modules/staff/data/enrichers.ts +675 -10
- package/src/modules/staff/data/entities.ts +494 -2
- package/src/modules/staff/data/extensions.ts +68 -0
- package/src/modules/staff/data/validators.ts +348 -3
- package/src/modules/staff/di.ts +96 -0
- package/src/modules/staff/events.payloads.ts +268 -0
- package/src/modules/staff/events.ts +87 -5
- package/src/modules/staff/extension-points.ts +308 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.ts +10 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.tsx +225 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.ts +17 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.tsx +182 -0
- package/src/modules/staff/i18n/de.json +899 -0
- package/src/modules/staff/i18n/en.json +899 -0
- package/src/modules/staff/i18n/es.json +899 -0
- package/src/modules/staff/i18n/ko.json +899 -0
- package/src/modules/staff/i18n/pl.json +899 -0
- package/src/modules/staff/lib/crud.ts +14 -3
- package/src/modules/staff/lib/time-tracking/access.ts +155 -0
- package/src/modules/staff/lib/time-tracking/billability.ts +68 -0
- package/src/modules/staff/lib/time-tracking/capacity.ts +124 -0
- package/src/modules/staff/lib/time-tracking/componentContracts.ts +26 -0
- package/src/modules/staff/lib/time-tracking/cost.ts +144 -0
- package/src/modules/staff/lib/time-tracking/duration.ts +68 -0
- package/src/modules/staff/lib/time-tracking/featureAccess.ts +115 -0
- package/src/modules/staff/lib/time-tracking/interval.ts +90 -0
- package/src/modules/staff/lib/time-tracking/migrateProjectCodes.ts +161 -0
- package/src/modules/staff/lib/time-tracking/moneyVisibility.ts +37 -0
- package/src/modules/staff/lib/time-tracking/overlap.ts +159 -0
- package/src/modules/staff/lib/time-tracking/portalRecipients.ts +76 -0
- package/src/modules/staff/lib/time-tracking/portalReports.ts +31 -0
- package/src/modules/staff/lib/time-tracking/projectCode.ts +221 -0
- package/src/modules/staff/lib/time-tracking/reapplyRounding.ts +313 -0
- package/src/modules/staff/lib/time-tracking/recalculationRunner.ts +118 -0
- package/src/modules/staff/lib/time-tracking/recalculations.ts +135 -0
- package/src/modules/staff/lib/time-tracking/registries/invoke.ts +122 -0
- package/src/modules/staff/lib/time-tracking/registries/registry.ts +124 -0
- package/src/modules/staff/lib/time-tracking/registries/scope.ts +56 -0
- package/src/modules/staff/lib/time-tracking/rollup.ts +59 -0
- package/src/modules/staff/lib/time-tracking/rounding.ts +126 -0
- package/src/modules/staff/lib/time-tracking/roundingImpact.ts +75 -0
- package/src/modules/staff/lib/time-tracking/settingKeys.ts +274 -0
- package/src/modules/staff/lib/time-tracking/settings.ts +168 -0
- package/src/modules/staff/lib/time-tracking/sqlInClause.ts +22 -0
- package/src/modules/staff/lib/time-tracking/timeEntrySources.ts +85 -0
- package/src/modules/staff/lib/time-tracking-ui/BoardFilterChips.tsx +360 -0
- package/src/modules/staff/lib/time-tracking-ui/CustomerPicker.tsx +427 -0
- package/src/modules/staff/lib/time-tracking-ui/DurationInput.tsx +192 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryDetailsFields.tsx +224 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryFilterBar.tsx +144 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanBoard.tsx +1065 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanCard.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanColumn.tsx +316 -0
- package/src/modules/staff/lib/time-tracking-ui/NewTaskDialog.tsx +291 -0
- package/src/modules/staff/lib/time-tracking-ui/NoProjectAccess.tsx +162 -0
- package/src/modules/staff/lib/time-tracking-ui/PeriodSelector.tsx +149 -0
- package/src/modules/staff/lib/time-tracking-ui/PhasePlaceholder.tsx +31 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCodeField.tsx +230 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.tsx +432 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectFormSections.tsx +323 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.tsx +930 -0
- package/src/modules/staff/lib/time-tracking-ui/ReportSheet.tsx +357 -0
- package/src/modules/staff/lib/time-tracking-ui/TagPicker.tsx +195 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskBoardScreen.tsx +243 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskCommentThread.tsx +137 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskDrawer.tsx +1405 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskListView.tsx +260 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskPicker.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskQuickLog.tsx +296 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.tsx +97 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDialog.tsx +1929 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.tsx +126 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetCalendar.tsx +265 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.tsx +78 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.tsx +70 -0
- package/src/modules/staff/lib/time-tracking-ui/boardDirectory.ts +231 -0
- package/src/modules/staff/lib/time-tracking-ui/boardFilters.ts +128 -0
- package/src/modules/staff/lib/time-tracking-ui/boardSummary.ts +20 -0
- package/src/modules/staff/lib/time-tracking-ui/kanbanBoardData.ts +228 -0
- package/src/modules/staff/lib/time-tracking-ui/projectTeamAssignment.ts +143 -0
- package/src/modules/staff/lib/time-tracking-ui/taskDrawerData.ts +194 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryDialogState.ts +400 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryListData.ts +271 -0
- package/src/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.ts +168 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetData.ts +225 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetPeriod.ts +278 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetTargets.ts +93 -0
- package/src/modules/staff/lib/time-tracking-ui/useBoardFilters.ts +107 -0
- package/src/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.ts +245 -0
- package/src/modules/staff/lib/timeTrackingSeeds.ts +1037 -0
- package/src/modules/staff/lib/timesheets/timeEntryCacheInvalidation.ts +11 -10
- package/src/modules/staff/lib/timesheets/timeEntryDecoration.ts +256 -0
- package/src/modules/staff/lib/timesheets-projects/budgetBurn.ts +60 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThreshold.ts +135 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThresholdState.ts +137 -0
- package/src/modules/staff/lib/timesheets-projects/computeProjectFinancials.ts +142 -0
- package/src/modules/staff/lib/timesheets-projects/reportSelection.ts +82 -0
- package/src/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.tsx +237 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.tsx +33 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectCard.tsx +56 -1
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.tsx +90 -0
- package/src/modules/staff/lib/timesheets-reports/buildReportSheet.ts +125 -0
- package/src/modules/staff/lib/timesheets-reports/loadReportData.ts +251 -0
- package/src/modules/staff/lib/timesheets-reports/pdf.ts +263 -0
- package/src/modules/staff/lib/timesheets-reports/reportApprovalPolicies.ts +137 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigData.ts +247 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigState.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportExport.ts +373 -0
- package/src/modules/staff/lib/timesheets-reports/reportExportFormats.ts +71 -0
- package/src/modules/staff/lib/timesheets-reports/reportGroupings.ts +153 -0
- package/src/modules/staff/lib/timesheets-reports/reportLabels.ts +23 -0
- package/src/modules/staff/lib/timesheets-reports/reportReference.ts +146 -0
- package/src/modules/staff/lib/timesheets-reports/reportRows.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportSheetData.ts +196 -0
- package/src/modules/staff/lib/timesheets-reports/reportTotals.ts +544 -0
- package/src/modules/staff/lib/timesheets-reports/xlsx.ts +207 -0
- package/src/modules/staff/lib/timesheets-tasks/computeTaskRollups.ts +238 -0
- package/src/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.ts +90 -0
- package/src/modules/staff/lib/timesheets-tasks/seedProjectStatuses.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/statusPositions.ts +132 -0
- package/src/modules/staff/lib/timesheets-tasks/statusSlug.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHierarchy.ts +99 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHoursTotals.ts +42 -0
- package/src/modules/staff/lib/timesheets-tasks/taskReference.ts +108 -0
- package/src/modules/staff/lib/timesheets-ui/CreateProjectDialog.tsx +18 -4
- package/src/modules/staff/lib/timesheets-ui/ListView.tsx +504 -149
- package/src/modules/staff/lib/timesheets-ui/TimerBar.tsx +50 -2
- package/src/modules/staff/migrations/.snapshot-open-mercato.json +3244 -228
- package/src/modules/staff/migrations/Migration20260813073131_staff.ts +94 -0
- package/src/modules/staff/migrations/Migration20260824143357_staff.ts +17 -0
- package/src/modules/staff/notifications.client.ts +16 -0
- package/src/modules/staff/notifications.handlers.ts +88 -0
- package/src/modules/staff/notifications.ts +163 -0
- package/src/modules/staff/search.ts +191 -1
- package/src/modules/staff/setup.ts +22 -0
- package/src/modules/staff/subscribers/time-project-access-requested-notification.ts +95 -0
- package/src/modules/staff/subscribers/time-project-budget-threshold-notification.ts +226 -0
- package/src/modules/staff/subscribers/time-report-approved-notification.ts +116 -0
- package/src/modules/staff/subscribers/time-report-portal-broadcast.ts +120 -0
- package/src/modules/staff/translations.ts +17 -0
- package/src/modules/staff/widgets/components.ts +34 -0
- package/src/modules/staff/widgets/injection/timer-sidebar-indicator/widget.tsx +6 -5
- package/src/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.tsx +138 -0
- package/src/modules/staff/widgets/notifications/index.ts +1 -0
- package/src/modules/staff/workers/timesheets-reapply-rounding.ts +59 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js +0 -123
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js.map +0 -7
- package/src/modules/staff/backend/staff/timesheets/projects/projectFormConfig.ts +0 -138
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning a computed report into the three deliverables of US-G4.
|
|
3
|
+
*
|
|
4
|
+
* Screen 14 note 3 sets the split: **PDF mirrors the sheet** the client is
|
|
5
|
+
* shown — the same groups, the same rolled-up lines, the same grand total — and
|
|
6
|
+
* **CSV/XLSX add the raw columns** (date, person, description) an accounts
|
|
7
|
+
* department reconciles against. All three honour the current grouping, the
|
|
8
|
+
* filters, the rounding and the currency, because all three are built from the
|
|
9
|
+
* same `ReportSheet` the screen rendered.
|
|
10
|
+
*
|
|
11
|
+
* No format locks anything (screen 14 note 5). Exporting appends an `exported`
|
|
12
|
+
* event and nothing else.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
16
|
+
import { serializeExport, type PreparedExport } from '@open-mercato/shared/lib/crud/exporters'
|
|
17
|
+
import { buildPdf, PDF_CONTENT_TYPE, type PdfLine } from './pdf'
|
|
18
|
+
import { buildXlsx, XLSX_CONTENT_TYPE } from './xlsx'
|
|
19
|
+
import { formatReportMinutes, type ReportGroup, type ReportLine } from './reportTotals'
|
|
20
|
+
import type { ReportRow } from './reportRows'
|
|
21
|
+
import {
|
|
22
|
+
getReportExportFormat,
|
|
23
|
+
registerBuiltInReportExportFormat,
|
|
24
|
+
reportExportFormatIds,
|
|
25
|
+
type ReportExportFormat,
|
|
26
|
+
} from './reportExportFormats'
|
|
27
|
+
|
|
28
|
+
const logger = createLogger('staff').child({ component: 'timesheets-reports/reportExport' })
|
|
29
|
+
|
|
30
|
+
export type { ReportExportFormat }
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* EP-35: the accepted set is the registry, not a literal union, so a contributed
|
|
34
|
+
* format is accepted here and documented by the route's OpenAPI enum without
|
|
35
|
+
* either being edited.
|
|
36
|
+
*/
|
|
37
|
+
export function normalizeReportExportFormat(value: unknown): ReportExportFormat | null {
|
|
38
|
+
if (typeof value !== 'string') return null
|
|
39
|
+
return getReportExportFormat(value) ? value : null
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function supportedReportExportFormats(): string[] {
|
|
43
|
+
return reportExportFormatIds()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ReportExportLabels = {
|
|
47
|
+
documentTitle: string
|
|
48
|
+
issuedBy: string
|
|
49
|
+
reference: string
|
|
50
|
+
period: string
|
|
51
|
+
line: string
|
|
52
|
+
time: string
|
|
53
|
+
rate: string
|
|
54
|
+
amount: string
|
|
55
|
+
total: string
|
|
56
|
+
totalHint: string
|
|
57
|
+
nonbillable: string
|
|
58
|
+
overrideBadge: string
|
|
59
|
+
date: string
|
|
60
|
+
project: string
|
|
61
|
+
task: string
|
|
62
|
+
person: string
|
|
63
|
+
description: string
|
|
64
|
+
billable: string
|
|
65
|
+
yes: string
|
|
66
|
+
no: string
|
|
67
|
+
rawMinutes: string
|
|
68
|
+
roundedMinutes: string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type ReportExportInput = {
|
|
72
|
+
reference: string
|
|
73
|
+
title: string
|
|
74
|
+
customerName: string
|
|
75
|
+
periodLabel: string
|
|
76
|
+
issuedByLabel: string | null
|
|
77
|
+
issuedAtLabel: string | null
|
|
78
|
+
currencyCode: string | null
|
|
79
|
+
showRates: boolean
|
|
80
|
+
groups: readonly ReportGroup[]
|
|
81
|
+
rows: readonly ReportRow[]
|
|
82
|
+
totals: { billableMinutes: number; nonbillableMinutes: number; totalAmount: number }
|
|
83
|
+
roundingLabel: string
|
|
84
|
+
labels: ReportExportLabels
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type SerializedReportExport = {
|
|
88
|
+
body: Buffer
|
|
89
|
+
contentType: string
|
|
90
|
+
filename: string
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function formatAmount(value: number | null | undefined, currencyCode: string | null): string {
|
|
94
|
+
if (value === null || value === undefined) return '—'
|
|
95
|
+
const fixed = value.toFixed(2)
|
|
96
|
+
return currencyCode ? `${fixed} ${currencyCode}` : fixed
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const COLUMN_LABEL_X = 42
|
|
100
|
+
const COLUMN_TIME_X = 400
|
|
101
|
+
const COLUMN_RATE_X = 470
|
|
102
|
+
const COLUMN_AMOUNT_X = 553
|
|
103
|
+
|
|
104
|
+
/** Recursion is one level deep by construction (D-2), but written generally. */
|
|
105
|
+
function pdfLinesForLine(
|
|
106
|
+
line: ReportLine,
|
|
107
|
+
depth: number,
|
|
108
|
+
isNonBillable: boolean,
|
|
109
|
+
showRates: boolean,
|
|
110
|
+
currencyCode: string | null,
|
|
111
|
+
labels: ReportExportLabels,
|
|
112
|
+
): PdfLine[] {
|
|
113
|
+
const label = line.hasOverride ? `${line.label} (${labels.overrideBadge})` : line.label
|
|
114
|
+
const cells = [
|
|
115
|
+
{ text: `${' '.repeat(depth)}${label}`, x: COLUMN_LABEL_X, muted: depth > 0 },
|
|
116
|
+
{ text: formatReportMinutes(line.minutes), x: COLUMN_TIME_X, align: 'right' as const },
|
|
117
|
+
]
|
|
118
|
+
if (showRates) {
|
|
119
|
+
cells.push({
|
|
120
|
+
text: isNonBillable ? '—' : formatAmount(line.rate, null),
|
|
121
|
+
x: COLUMN_RATE_X,
|
|
122
|
+
align: 'right' as const,
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
cells.push({
|
|
126
|
+
text: isNonBillable ? '—' : formatAmount(line.amount, null),
|
|
127
|
+
x: COLUMN_AMOUNT_X,
|
|
128
|
+
align: 'right' as const,
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
return [
|
|
132
|
+
{ kind: 'cells', cells },
|
|
133
|
+
...line.children.flatMap((child) =>
|
|
134
|
+
pdfLinesForLine(child, depth + 1, isNonBillable, showRates, currencyCode, labels),
|
|
135
|
+
),
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** The PDF mirrors the on-screen sheet, group for group and line for line. */
|
|
140
|
+
export function buildReportPdfLines(input: ReportExportInput): PdfLine[] {
|
|
141
|
+
const { labels } = input
|
|
142
|
+
const lines: PdfLine[] = [
|
|
143
|
+
{
|
|
144
|
+
kind: 'cells',
|
|
145
|
+
cells: [{ text: labels.documentTitle, x: COLUMN_LABEL_X, size: 8, muted: true }],
|
|
146
|
+
},
|
|
147
|
+
{ kind: 'cells', cells: [{ text: input.customerName, x: COLUMN_LABEL_X, size: 15, bold: true }] },
|
|
148
|
+
{ kind: 'cells', cells: [{ text: input.periodLabel, x: COLUMN_LABEL_X, muted: true }] },
|
|
149
|
+
{
|
|
150
|
+
kind: 'cells',
|
|
151
|
+
cells: [
|
|
152
|
+
{
|
|
153
|
+
text: `${labels.reference}: ${input.reference}`,
|
|
154
|
+
x: COLUMN_AMOUNT_X,
|
|
155
|
+
align: 'right',
|
|
156
|
+
muted: true,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
]
|
|
161
|
+
if (input.issuedByLabel) {
|
|
162
|
+
lines.push({
|
|
163
|
+
kind: 'cells',
|
|
164
|
+
cells: [
|
|
165
|
+
{
|
|
166
|
+
text: `${labels.issuedBy}: ${input.issuedByLabel}${input.issuedAtLabel ? ` · ${input.issuedAtLabel}` : ''}`,
|
|
167
|
+
x: COLUMN_AMOUNT_X,
|
|
168
|
+
align: 'right',
|
|
169
|
+
muted: true,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
lines.push({ kind: 'space', height: 10 }, { kind: 'rule' })
|
|
175
|
+
|
|
176
|
+
for (const group of input.groups) {
|
|
177
|
+
const isNonBillable = group.kind === 'nonbillable'
|
|
178
|
+
lines.push({
|
|
179
|
+
kind: 'cells',
|
|
180
|
+
cells: [
|
|
181
|
+
{ text: group.label, x: COLUMN_LABEL_X, bold: true },
|
|
182
|
+
{ text: formatReportMinutes(group.minutes), x: COLUMN_TIME_X, align: 'right', bold: true },
|
|
183
|
+
{
|
|
184
|
+
text: formatAmount(isNonBillable ? 0 : group.amount, input.currencyCode),
|
|
185
|
+
x: COLUMN_AMOUNT_X,
|
|
186
|
+
align: 'right',
|
|
187
|
+
bold: true,
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
})
|
|
191
|
+
if (input.showRates && !isNonBillable && group.rate !== null) {
|
|
192
|
+
lines.push({
|
|
193
|
+
kind: 'cells',
|
|
194
|
+
cells: [{ text: `${formatAmount(group.rate, input.currencyCode)}/h`, x: COLUMN_LABEL_X, muted: true, size: 8 }],
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const header = [
|
|
199
|
+
{ text: labels.line, x: COLUMN_LABEL_X, size: 8, muted: true },
|
|
200
|
+
{ text: labels.time, x: COLUMN_TIME_X, align: 'right' as const, size: 8, muted: true },
|
|
201
|
+
]
|
|
202
|
+
if (input.showRates) {
|
|
203
|
+
header.push({ text: labels.rate, x: COLUMN_RATE_X, align: 'right' as const, size: 8, muted: true })
|
|
204
|
+
}
|
|
205
|
+
header.push({ text: labels.amount, x: COLUMN_AMOUNT_X, align: 'right' as const, size: 8, muted: true })
|
|
206
|
+
lines.push({ kind: 'cells', cells: header })
|
|
207
|
+
|
|
208
|
+
for (const line of group.lines) {
|
|
209
|
+
lines.push(
|
|
210
|
+
...pdfLinesForLine(line, 0, isNonBillable, input.showRates, input.currencyCode, labels),
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
lines.push({ kind: 'space', height: 8 }, { kind: 'rule' })
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
lines.push(
|
|
217
|
+
{
|
|
218
|
+
kind: 'cells',
|
|
219
|
+
cells: [
|
|
220
|
+
{ text: labels.total, x: COLUMN_LABEL_X, bold: true, size: 11 },
|
|
221
|
+
{
|
|
222
|
+
text: formatAmount(input.totals.totalAmount, input.currencyCode),
|
|
223
|
+
x: COLUMN_AMOUNT_X,
|
|
224
|
+
align: 'right',
|
|
225
|
+
bold: true,
|
|
226
|
+
size: 11,
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
kind: 'cells',
|
|
232
|
+
cells: [
|
|
233
|
+
{
|
|
234
|
+
text: labels.totalHint
|
|
235
|
+
.replace('{billable}', formatReportMinutes(input.totals.billableMinutes))
|
|
236
|
+
.replace('{nonbillable}', formatReportMinutes(input.totals.nonbillableMinutes))
|
|
237
|
+
.replace('{rounding}', input.roundingLabel),
|
|
238
|
+
x: COLUMN_LABEL_X,
|
|
239
|
+
size: 8,
|
|
240
|
+
muted: true,
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
return lines
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* The raw table. `rawMinutes` sits beside `roundedMinutes` on purpose: the
|
|
251
|
+
* difference between them IS the rounding, and an accountant asking why an
|
|
252
|
+
* amount is what it is should be able to see it rather than derive it.
|
|
253
|
+
*/
|
|
254
|
+
export function buildReportTable(input: ReportExportInput): PreparedExport {
|
|
255
|
+
const { labels } = input
|
|
256
|
+
const columns = [
|
|
257
|
+
{ field: 'date', header: labels.date },
|
|
258
|
+
{ field: 'project', header: labels.project },
|
|
259
|
+
{ field: 'task', header: labels.task },
|
|
260
|
+
{ field: 'person', header: labels.person },
|
|
261
|
+
{ field: 'description', header: labels.description },
|
|
262
|
+
{ field: 'rawMinutes', header: labels.rawMinutes },
|
|
263
|
+
{ field: 'roundedMinutes', header: labels.roundedMinutes },
|
|
264
|
+
{ field: 'hours', header: labels.time },
|
|
265
|
+
{ field: 'billable', header: labels.billable },
|
|
266
|
+
...(input.showRates ? [{ field: 'rate', header: labels.rate }] : []),
|
|
267
|
+
{ field: 'amount', header: labels.amount },
|
|
268
|
+
]
|
|
269
|
+
|
|
270
|
+
const rows = input.rows.map((row) => {
|
|
271
|
+
const record: Record<string, unknown> = {
|
|
272
|
+
date: row.date,
|
|
273
|
+
project: row.projectName,
|
|
274
|
+
task: row.taskLabel,
|
|
275
|
+
person: row.personLabel,
|
|
276
|
+
description: row.description,
|
|
277
|
+
rawMinutes: row.rawMinutes,
|
|
278
|
+
roundedMinutes: row.minutes,
|
|
279
|
+
hours: row.hours,
|
|
280
|
+
billable: row.isBillable ? labels.yes : labels.no,
|
|
281
|
+
amount: row.amount === null ? '' : row.amount.toFixed(2),
|
|
282
|
+
}
|
|
283
|
+
if (input.showRates) record.rate = row.rate === null ? '' : row.rate.toFixed(2)
|
|
284
|
+
return record
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
return { columns, rows }
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function exportBaseName(input: ReportExportInput): string {
|
|
291
|
+
return input.reference || 'report'
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
registerBuiltInReportExportFormat({
|
|
295
|
+
id: 'pdf',
|
|
296
|
+
labelKey: 'staff.time_tracking.reports.export.format.pdf',
|
|
297
|
+
mimeType: PDF_CONTENT_TYPE,
|
|
298
|
+
extension: 'pdf',
|
|
299
|
+
serialize: (input) => ({
|
|
300
|
+
body: buildPdf({ title: input.title, lines: buildReportPdfLines(input) }),
|
|
301
|
+
contentType: PDF_CONTENT_TYPE,
|
|
302
|
+
filename: `${exportBaseName(input)}.pdf`,
|
|
303
|
+
}),
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
registerBuiltInReportExportFormat({
|
|
307
|
+
id: 'csv',
|
|
308
|
+
labelKey: 'staff.time_tracking.reports.export.format.csv',
|
|
309
|
+
mimeType: 'text/csv',
|
|
310
|
+
extension: 'csv',
|
|
311
|
+
serialize: (input) => {
|
|
312
|
+
const serialized = serializeExport(buildReportTable(input), 'csv')
|
|
313
|
+
return {
|
|
314
|
+
// The BOM is what makes Excel open a UTF-8 CSV with Polish names intact
|
|
315
|
+
// instead of mojibake; every other consumer ignores it.
|
|
316
|
+
body: Buffer.concat([Buffer.from('', 'utf8'), Buffer.from(serialized.body, 'utf8')]),
|
|
317
|
+
contentType: serialized.contentType,
|
|
318
|
+
filename: `${exportBaseName(input)}.csv`,
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
})
|
|
322
|
+
|
|
323
|
+
registerBuiltInReportExportFormat({
|
|
324
|
+
id: 'xlsx',
|
|
325
|
+
labelKey: 'staff.time_tracking.reports.export.format.xlsx',
|
|
326
|
+
mimeType: XLSX_CONTENT_TYPE,
|
|
327
|
+
extension: 'xlsx',
|
|
328
|
+
serialize: (input) => {
|
|
329
|
+
const table = buildReportTable(input)
|
|
330
|
+
const rows = [
|
|
331
|
+
table.columns.map((column) => column.header),
|
|
332
|
+
...table.rows.map((row) =>
|
|
333
|
+
table.columns.map((column) => {
|
|
334
|
+
const value = row[column.field]
|
|
335
|
+
if (column.field === 'rate' || column.field === 'amount') {
|
|
336
|
+
const parsed = typeof value === 'string' && value.length > 0 ? Number.parseFloat(value) : null
|
|
337
|
+
return parsed !== null && Number.isFinite(parsed) ? parsed : ''
|
|
338
|
+
}
|
|
339
|
+
return typeof value === 'number' ? value : value === null || value === undefined ? '' : String(value)
|
|
340
|
+
}),
|
|
341
|
+
),
|
|
342
|
+
]
|
|
343
|
+
return {
|
|
344
|
+
body: buildXlsx({ name: exportBaseName(input).slice(0, 31), rows }),
|
|
345
|
+
contentType: XLSX_CONTENT_TYPE,
|
|
346
|
+
filename: `${exportBaseName(input)}.xlsx`,
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* A contributed `serialize` is the one strategy whose failure cannot be absorbed:
|
|
353
|
+
* the caller asked for a named format and every fallback would answer with bytes of
|
|
354
|
+
* a different type under the requested filename and MIME. So the throw propagates —
|
|
355
|
+
* but it is caught and re-raised as an internal error naming the format, so the one
|
|
356
|
+
* request fails with something diagnosable instead of a stack trace from a third
|
|
357
|
+
* party's serializer.
|
|
358
|
+
*/
|
|
359
|
+
export function serializeReportExport(
|
|
360
|
+
format: ReportExportFormat,
|
|
361
|
+
input: ReportExportInput,
|
|
362
|
+
): SerializedReportExport {
|
|
363
|
+
const definition = getReportExportFormat(format)
|
|
364
|
+
if (!definition) {
|
|
365
|
+
throw new Error(`[internal] unknown report export format: ${String(format)}`)
|
|
366
|
+
}
|
|
367
|
+
try {
|
|
368
|
+
return definition.serialize(input)
|
|
369
|
+
} catch (err) {
|
|
370
|
+
logger.error('a report export format failed to serialize', { format: definition.id, err })
|
|
371
|
+
throw new Error(`[internal] report export format ${definition.id} failed to serialize`)
|
|
372
|
+
}
|
|
373
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EP-35 — the report export format registry.
|
|
3
|
+
*
|
|
4
|
+
* It lives beside `reportExport.ts` rather than inside it because the built-in
|
|
5
|
+
* `pdf`/`csv`/`xlsx` serializers ARE that file: keeping the registry here lets
|
|
6
|
+
* `reportExport.ts` register into it at module load without an import cycle.
|
|
7
|
+
*
|
|
8
|
+
* Every consumer of the format list — `normalizeReportExportFormat`, the export
|
|
9
|
+
* route's OpenAPI query enum, the 400 body listing the accepted formats — reads
|
|
10
|
+
* this registry, so a contributed format is accepted and documented without
|
|
11
|
+
* touching either file.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { extensionPoints } from '@open-mercato/core/modules/staff/extension-points'
|
|
15
|
+
import { createStrategyRegistry, BUILT_IN_STRATEGY_PRIORITY } from '../time-tracking/registries/registry'
|
|
16
|
+
import type { ReportExportInput, SerializedReportExport } from './reportExport'
|
|
17
|
+
|
|
18
|
+
export const BUILT_IN_REPORT_EXPORT_FORMAT_IDS = ['pdf', 'csv', 'xlsx'] as const
|
|
19
|
+
|
|
20
|
+
export type BuiltInReportExportFormat = (typeof BUILT_IN_REPORT_EXPORT_FORMAT_IDS)[number]
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Widened from the original `'pdf' | 'csv' | 'xlsx'` union so a contributed id
|
|
24
|
+
* is assignable. The union arm keeps the three built-ins as completions.
|
|
25
|
+
*/
|
|
26
|
+
export type ReportExportFormat = BuiltInReportExportFormat | (string & {})
|
|
27
|
+
|
|
28
|
+
export type ReportExportFormatDefinition = {
|
|
29
|
+
id: string
|
|
30
|
+
labelKey: string
|
|
31
|
+
mimeType: string
|
|
32
|
+
extension: string
|
|
33
|
+
priority?: number
|
|
34
|
+
serialize(input: ReportExportInput): SerializedReportExport
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const REPORT_EXPORT_FORMAT_REGISTRY_ID = extensionPoints.hosts.reportExportFormatRegistry.spotId
|
|
38
|
+
|
|
39
|
+
const registry = createStrategyRegistry<ReportExportFormatDefinition>(REPORT_EXPORT_FORMAT_REGISTRY_ID)
|
|
40
|
+
|
|
41
|
+
export function registerReportExportFormat(format: ReportExportFormatDefinition): () => void {
|
|
42
|
+
return registry.register(format)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The three formats the module ships. They register at the built-in priority so
|
|
47
|
+
* `listReportExportFormats()` orders any contribution ahead of them.
|
|
48
|
+
*/
|
|
49
|
+
export function registerBuiltInReportExportFormat(
|
|
50
|
+
format: Omit<ReportExportFormatDefinition, 'priority'>,
|
|
51
|
+
): () => void {
|
|
52
|
+
registry.registerBuiltIn({ ...format, priority: BUILT_IN_STRATEGY_PRIORITY })
|
|
53
|
+
return () => {}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function listReportExportFormats(): ReportExportFormatDefinition[] {
|
|
57
|
+
return registry.list()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Built-ins first, in the order the module shipped them, then contributions. */
|
|
61
|
+
export function reportExportFormatIds(): string[] {
|
|
62
|
+
const builtIn = BUILT_IN_REPORT_EXPORT_FORMAT_IDS.filter((id) => registry.has(id))
|
|
63
|
+
const contributed = registry.ids().filter((id) => !builtIn.includes(id as BuiltInReportExportFormat))
|
|
64
|
+
return [...builtIn, ...contributed]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function getReportExportFormat(
|
|
68
|
+
id: string | null | undefined,
|
|
69
|
+
): ReportExportFormatDefinition | null {
|
|
70
|
+
return registry.get(id)
|
|
71
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EP-36 — the report grouping strategy registry.
|
|
3
|
+
*
|
|
4
|
+
* A grouping decides two things and nothing else: which line an entry lands on
|
|
5
|
+
* (`groupOf`, which may name a parent line so D-2's inclusive task rollup keeps
|
|
6
|
+
* working) and how the finished lines are ordered (`sort`). Labelling is a third
|
|
7
|
+
* concern the strategy owns because only it knows which directory to look the
|
|
8
|
+
* key up in.
|
|
9
|
+
*
|
|
10
|
+
* The three built-ins reproduce `reportTotals.ts`'s original `lineKeyFor` /
|
|
11
|
+
* `labelFor` / line sort exactly. The registry lives in its own file so
|
|
12
|
+
* `reportTotals.ts` can register into it at module load without an import cycle.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { extensionPoints } from '@open-mercato/core/modules/staff/extension-points'
|
|
16
|
+
import { createStrategyRegistry, BUILT_IN_STRATEGY_PRIORITY } from '../time-tracking/registries/registry'
|
|
17
|
+
import type { ReportDirectory, ReportInputEntry, ReportLine } from './reportTotals'
|
|
18
|
+
|
|
19
|
+
export const BUILT_IN_REPORT_GROUPING_IDS = ['project_task', 'project_person', 'project_day'] as const
|
|
20
|
+
|
|
21
|
+
export type BuiltInReportGrouping = (typeof BUILT_IN_REPORT_GROUPING_IDS)[number]
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Widened from the original three-way union so a contributed grouping id is
|
|
25
|
+
* assignable. The union arm keeps the built-ins as completions.
|
|
26
|
+
*/
|
|
27
|
+
export type ReportGrouping = BuiltInReportGrouping | (string & {})
|
|
28
|
+
|
|
29
|
+
export type ReportGroupingFallbackLabels = {
|
|
30
|
+
unassignedTask: string
|
|
31
|
+
unassignedPerson: string
|
|
32
|
+
nonbillableGroup: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ReportGroupingLabelContext = {
|
|
36
|
+
directory: ReportDirectory
|
|
37
|
+
fallbacks: ReportGroupingFallbackLabels
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type ReportGroupingKey = {
|
|
41
|
+
key: string
|
|
42
|
+
parentKey: string | null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type ReportGroupingStrategy = {
|
|
46
|
+
id: string
|
|
47
|
+
labelKey: string
|
|
48
|
+
priority?: number
|
|
49
|
+
groupOf(entry: ReportInputEntry): ReportGroupingKey
|
|
50
|
+
labelOf(key: string, ctx: ReportGroupingLabelContext): string
|
|
51
|
+
sort(left: ReportLine, right: ReportLine): number
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const REPORT_GROUPING_REGISTRY_ID = extensionPoints.hosts.reportGroupingRegistry.spotId
|
|
55
|
+
|
|
56
|
+
const registry = createStrategyRegistry<ReportGroupingStrategy>(REPORT_GROUPING_REGISTRY_ID)
|
|
57
|
+
|
|
58
|
+
export function registerReportGrouping(grouping: ReportGroupingStrategy): () => void {
|
|
59
|
+
return registry.register(grouping)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function listReportGroupings(): ReportGroupingStrategy[] {
|
|
63
|
+
return registry.list()
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function getReportGrouping(id: string | null | undefined): ReportGroupingStrategy | null {
|
|
67
|
+
return registry.get(id)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function hasReportGrouping(id: string | null | undefined): boolean {
|
|
71
|
+
return registry.has(id)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Identity, not membership of `BUILT_IN_REPORT_GROUPING_IDS` — a contribution cannot claim one. */
|
|
75
|
+
export function isBuiltInReportGrouping(id: string | null | undefined): boolean {
|
|
76
|
+
return registry.isBuiltIn(id)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Built-ins first, in the order the module shipped them, then contributions. */
|
|
80
|
+
export function reportGroupingIds(): string[] {
|
|
81
|
+
const builtIn = BUILT_IN_REPORT_GROUPING_IDS.filter((id) => registry.has(id))
|
|
82
|
+
const contributed = registry.ids().filter((id) => !builtIn.includes(id as BuiltInReportGrouping))
|
|
83
|
+
return [...builtIn, ...contributed]
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const DEFAULT_REPORT_GROUPING: BuiltInReportGrouping = 'project_task'
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The grouping a report was stored with, coerced back to something the registry
|
|
90
|
+
* can serve. An id whose contributing module has since been removed falls back
|
|
91
|
+
* to the module default rather than producing an ungrouped sheet.
|
|
92
|
+
*/
|
|
93
|
+
export function normalizeReportGrouping(value: unknown): ReportGrouping {
|
|
94
|
+
if (typeof value === 'string' && registry.has(value)) return value
|
|
95
|
+
return DEFAULT_REPORT_GROUPING
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The line key an entry with nothing to group by lands on. It is part of the
|
|
100
|
+
* grouping contract rather than a `reportTotals` private, because a contributed
|
|
101
|
+
* grouping has to be able to produce the same "unassigned" bucket.
|
|
102
|
+
*/
|
|
103
|
+
export const UNASSIGNED_LINE_KEY = '__unassigned__'
|
|
104
|
+
|
|
105
|
+
/** The line ordering every built-in grouping shares: longest first, then by label. */
|
|
106
|
+
function sortByMinutesThenLabel(left: ReportLine, right: ReportLine): number {
|
|
107
|
+
return right.minutes - left.minutes || left.label.localeCompare(right.label)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function taskLineKey(entry: ReportInputEntry): ReportGroupingKey {
|
|
111
|
+
const rootId = entry.rootTaskId ?? entry.taskId ?? null
|
|
112
|
+
const taskId = entry.taskId ?? null
|
|
113
|
+
if (!rootId) return { key: UNASSIGNED_LINE_KEY, parentKey: null }
|
|
114
|
+
// D-2: a child's time lands on the parent's line and is expandable underneath.
|
|
115
|
+
if (taskId && taskId !== rootId) return { key: taskId, parentKey: rootId }
|
|
116
|
+
return { key: rootId, parentKey: null }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function registerBuiltInReportGrouping(
|
|
120
|
+
grouping: Omit<ReportGroupingStrategy, 'priority'>,
|
|
121
|
+
): ReportGroupingStrategy {
|
|
122
|
+
return registry.registerBuiltIn({ ...grouping, priority: BUILT_IN_STRATEGY_PRIORITY })
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
registerBuiltInReportGrouping({
|
|
126
|
+
id: 'project_task',
|
|
127
|
+
labelKey: 'staff.time_tracking.reports.grouping.project_task',
|
|
128
|
+
groupOf: taskLineKey,
|
|
129
|
+
labelOf: (key, ctx) =>
|
|
130
|
+
key === UNASSIGNED_LINE_KEY
|
|
131
|
+
? ctx.fallbacks.unassignedTask
|
|
132
|
+
: ctx.directory.taskLabelById[key] ?? ctx.fallbacks.unassignedTask,
|
|
133
|
+
sort: sortByMinutesThenLabel,
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
registerBuiltInReportGrouping({
|
|
137
|
+
id: 'project_person',
|
|
138
|
+
labelKey: 'staff.time_tracking.reports.grouping.project_person',
|
|
139
|
+
groupOf: (entry) => ({ key: entry.staffMemberId ?? UNASSIGNED_LINE_KEY, parentKey: null }),
|
|
140
|
+
labelOf: (key, ctx) =>
|
|
141
|
+
key === UNASSIGNED_LINE_KEY
|
|
142
|
+
? ctx.fallbacks.unassignedPerson
|
|
143
|
+
: ctx.directory.personLabelById[key] ?? ctx.fallbacks.unassignedPerson,
|
|
144
|
+
sort: sortByMinutesThenLabel,
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
registerBuiltInReportGrouping({
|
|
148
|
+
id: 'project_day',
|
|
149
|
+
labelKey: 'staff.time_tracking.reports.grouping.project_day',
|
|
150
|
+
groupOf: (entry) => ({ key: entry.date || UNASSIGNED_LINE_KEY, parentKey: null }),
|
|
151
|
+
labelOf: (key, ctx) => (key === UNASSIGNED_LINE_KEY ? ctx.fallbacks.unassignedTask : key),
|
|
152
|
+
sort: sortByMinutesThenLabel,
|
|
153
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three fallback labels a report sheet needs when a line has nothing to name
|
|
3
|
+
* itself with. They live here rather than in a route because the close command,
|
|
4
|
+
* the preview, the sheet and the exports must all use the same ones — a freeze
|
|
5
|
+
* record labelled "No task" and a PDF labelled "Unassigned" would be the same
|
|
6
|
+
* line reading differently in two places a client can compare.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type ReportLabelTranslate = (key: string, fallback: string) => string
|
|
10
|
+
|
|
11
|
+
export type ReportSheetLabels = {
|
|
12
|
+
unassignedTask: string
|
|
13
|
+
unassignedPerson: string
|
|
14
|
+
nonbillableGroup: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function reportSheetLabels(translate: ReportLabelTranslate): ReportSheetLabels {
|
|
18
|
+
return {
|
|
19
|
+
unassignedTask: translate('staff.time_tracking.reports.sheet.noTask', 'No task'),
|
|
20
|
+
unassignedPerson: translate('staff.time_tracking.reports.sheet.noPerson', 'Unassigned'),
|
|
21
|
+
nonbillableGroup: translate('staff.time_tracking.reports.sheet.nonbillable', 'Non-billable time'),
|
|
22
|
+
}
|
|
23
|
+
}
|