@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,632 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Screens 14 and 15 — the report preview, its exports, and the lock/unlock pair.
|
|
5
|
+
*
|
|
6
|
+
* One page, two states, because they are the same document:
|
|
7
|
+
*
|
|
8
|
+
* - **Draft (screen 14).** The sheet is computed live, the header carries the
|
|
9
|
+
* three export buttons and one primary action, "Close & lock". Exporting is
|
|
10
|
+
* deliberately NOT the thing that locks (note 5) — a PDF download that froze
|
|
11
|
+
* a team's timesheet would be a trap.
|
|
12
|
+
* - **Closed (screen 15).** The sheet is what was frozen, an alert states that
|
|
13
|
+
* the entries are read-only and that logging NEW time on the same tasks still
|
|
14
|
+
* works (note 2), the frozen entries are listed, the history timeline shows
|
|
15
|
+
* who closed, unlocked or exported and why, and the unlock button is
|
|
16
|
+
* `destructive-outline` rather than full destructive (note 3): risky, but
|
|
17
|
+
* reversible, since the report can simply be closed again.
|
|
18
|
+
*
|
|
19
|
+
* Unlocking demands a reason (note 1). The dialog shows the export history first
|
|
20
|
+
* so "this was already sent to the client on the 20th" is on screen before
|
|
21
|
+
* anybody restates a billed hour.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import * as React from 'react'
|
|
25
|
+
import { useSearchParams } from 'next/navigation'
|
|
26
|
+
import { Download, Lock, LockOpen } from 'lucide-react'
|
|
27
|
+
import { Page, PageBody } from '@open-mercato/ui/backend/Page'
|
|
28
|
+
import { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'
|
|
29
|
+
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
30
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
31
|
+
import { Label } from '@open-mercato/ui/primitives/label'
|
|
32
|
+
import { Textarea } from '@open-mercato/ui/primitives/textarea'
|
|
33
|
+
import {
|
|
34
|
+
Dialog,
|
|
35
|
+
DialogContent,
|
|
36
|
+
DialogFooter,
|
|
37
|
+
DialogHeader,
|
|
38
|
+
DialogTitle,
|
|
39
|
+
} from '@open-mercato/ui/primitives/dialog'
|
|
40
|
+
import { FormHeader } from '@open-mercato/ui/backend/forms'
|
|
41
|
+
import { ErrorMessage, LoadingMessage } from '@open-mercato/ui/backend/detail'
|
|
42
|
+
import { apiCall, readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'
|
|
43
|
+
import { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'
|
|
44
|
+
import { useBackendChrome } from '@open-mercato/ui/backend/BackendChromeProvider'
|
|
45
|
+
import { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
|
|
46
|
+
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
47
|
+
import { formatCurrency } from '@open-mercato/ui/utils/format'
|
|
48
|
+
import { hasFeature } from '@open-mercato/shared/security/features'
|
|
49
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
50
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
51
|
+
import { ReportSheet } from '../../../../../lib/time-tracking-ui/ReportSheet'
|
|
52
|
+
import { InjectionSpot } from '@open-mercato/ui/backend/injection/InjectionSpot'
|
|
53
|
+
import { extensionPoints } from '@open-mercato/core/modules/staff/extension-points'
|
|
54
|
+
import {
|
|
55
|
+
parseReportSheet,
|
|
56
|
+
type ReportHistoryEvent,
|
|
57
|
+
type ReportSheetPayload,
|
|
58
|
+
} from '../../../../../lib/timesheets-reports/reportSheetData'
|
|
59
|
+
import { formatReportMinutes } from '../../../../../lib/timesheets-reports/reportTotals'
|
|
60
|
+
|
|
61
|
+
const logger = createLogger('staff').child({ component: 'time-tracking/reports/detail' })
|
|
62
|
+
|
|
63
|
+
const REPORTS_HREF = '/backend/staff/time-tracking/reports'
|
|
64
|
+
const REPORTS_API = '/api/staff/timesheets/reports'
|
|
65
|
+
const LOCK_FEATURE = 'staff.timesheets.lock'
|
|
66
|
+
const UNLOCK_FEATURE = 'staff.timesheets.reports.unlock'
|
|
67
|
+
const RATES_FEATURE = 'staff.timesheets.rates.view'
|
|
68
|
+
const MUTATION_CONTEXT_ID = 'staff.time_tracking.reportDetail'
|
|
69
|
+
const RESOURCE_KIND = 'staff.timesheets.time_report'
|
|
70
|
+
const EXPORT_FORMATS = ['pdf', 'csv', 'xlsx'] as const
|
|
71
|
+
|
|
72
|
+
type ExportFormat = (typeof EXPORT_FORMATS)[number]
|
|
73
|
+
|
|
74
|
+
type MutationContext = {
|
|
75
|
+
formId: string
|
|
76
|
+
resourceKind: string
|
|
77
|
+
resourceId: string
|
|
78
|
+
retryLastMutation: () => Promise<boolean>
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const REPORT_ENTITY_ID = 'staff:staff_time_report'
|
|
82
|
+
|
|
83
|
+
type ReportDetailInjectionContext = {
|
|
84
|
+
entityId: string
|
|
85
|
+
recordId: string
|
|
86
|
+
reportId: string
|
|
87
|
+
reference: string
|
|
88
|
+
isClosed: boolean
|
|
89
|
+
periodFrom: string | null
|
|
90
|
+
periodTo: string | null
|
|
91
|
+
retryLastMutation: () => Promise<boolean>
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function readErrorMessage(payload: unknown, fallback: string): string {
|
|
95
|
+
if (payload && typeof payload === 'object') {
|
|
96
|
+
const error = (payload as { error?: unknown }).error
|
|
97
|
+
if (typeof error === 'string' && error.trim().length > 0) return error
|
|
98
|
+
}
|
|
99
|
+
return fallback
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* `params` arrives as a prop, not from `useParams()`.
|
|
104
|
+
*
|
|
105
|
+
* Backend pages render under the `/backend/[[...slug]]` catch-all, so
|
|
106
|
+
* `useParams()` answers `{ slug: [...] }` — there is no `id` key in it, and
|
|
107
|
+
* reading one yields `undefined`. The effect then short-circuits on the empty id
|
|
108
|
+
* and the page sits on its loading state forever, having issued no request at
|
|
109
|
+
* all. The catch-all passes the resolved segment as a prop; that is the contract
|
|
110
|
+
* every other detail page in the module already uses.
|
|
111
|
+
*/
|
|
112
|
+
export default function TimeTrackingReportDetailPage({ params }: { params?: { id?: string } }) {
|
|
113
|
+
const t = useT()
|
|
114
|
+
const searchParams = useSearchParams()
|
|
115
|
+
const reportId = typeof params?.id === 'string' ? params.id : ''
|
|
116
|
+
const { payload: chrome } = useBackendChrome()
|
|
117
|
+
const canClose = hasFeature(chrome?.grantedFeatures, LOCK_FEATURE)
|
|
118
|
+
const canUnlock = hasFeature(chrome?.grantedFeatures, UNLOCK_FEATURE)
|
|
119
|
+
const canSeeMoney = hasFeature(chrome?.grantedFeatures, RATES_FEATURE)
|
|
120
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog()
|
|
121
|
+
|
|
122
|
+
const [sheet, setSheet] = React.useState<ReportSheetPayload | null>(null)
|
|
123
|
+
const [loading, setLoading] = React.useState(true)
|
|
124
|
+
const [error, setError] = React.useState<string | null>(null)
|
|
125
|
+
const [unlockOpen, setUnlockOpen] = React.useState(false)
|
|
126
|
+
const [unlockReason, setUnlockReason] = React.useState('')
|
|
127
|
+
const [busy, setBusy] = React.useState(false)
|
|
128
|
+
const [reloadToken, setReloadToken] = React.useState(0)
|
|
129
|
+
|
|
130
|
+
const isClosed = sheet?.report.status === 'closed'
|
|
131
|
+
// Screen 15 is `?unlock=1`, and it may only mean what the unlock button means:
|
|
132
|
+
// the same closed-report state and the same feature. A draft report or a
|
|
133
|
+
// caller without the feature gets the page, never a dialog it cannot use.
|
|
134
|
+
const canUnlockNow = isClosed && canUnlock
|
|
135
|
+
const unlockRequested = searchParams.get('unlock') === '1'
|
|
136
|
+
|
|
137
|
+
const labels = React.useMemo(
|
|
138
|
+
() => ({
|
|
139
|
+
loadError: t('staff.time_tracking.reports.errors.loadFailed', 'Could not load this report.'),
|
|
140
|
+
closeError: t('staff.time_tracking.reports.errors.closeFailed', 'Could not close this report.'),
|
|
141
|
+
unlockError: t('staff.time_tracking.reports.errors.unlockFailed', 'Could not unlock this report.'),
|
|
142
|
+
exportError: t('staff.time_tracking.reports.errors.exportFailed', 'Could not export this report.'),
|
|
143
|
+
}),
|
|
144
|
+
[t],
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
const { runMutation, retryLastMutation } = useGuardedMutation<MutationContext>({
|
|
148
|
+
contextId: MUTATION_CONTEXT_ID,
|
|
149
|
+
blockedMessage: labels.closeError,
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
const mutationContext = React.useCallback(
|
|
153
|
+
(): MutationContext => ({
|
|
154
|
+
formId: MUTATION_CONTEXT_ID,
|
|
155
|
+
resourceKind: RESOURCE_KIND,
|
|
156
|
+
resourceId: reportId,
|
|
157
|
+
retryLastMutation,
|
|
158
|
+
}),
|
|
159
|
+
[reportId, retryLastMutation],
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
React.useEffect(() => {
|
|
163
|
+
if (!canUnlockNow || !unlockRequested) return
|
|
164
|
+
setUnlockOpen(true)
|
|
165
|
+
}, [canUnlockNow, unlockRequested])
|
|
166
|
+
|
|
167
|
+
React.useEffect(() => {
|
|
168
|
+
if (!reportId) return
|
|
169
|
+
let cancelled = false
|
|
170
|
+
setLoading(true)
|
|
171
|
+
setError(null)
|
|
172
|
+
void readApiResultOrThrow<Record<string, unknown>>(
|
|
173
|
+
`${REPORTS_API}/${reportId}/sheet`,
|
|
174
|
+
undefined,
|
|
175
|
+
{ allowNullResult: true, errorMessage: labels.loadError },
|
|
176
|
+
)
|
|
177
|
+
.then((result) => {
|
|
178
|
+
if (cancelled) return
|
|
179
|
+
const parsed = parseReportSheet(result)
|
|
180
|
+
if (!parsed) {
|
|
181
|
+
setError(labels.loadError)
|
|
182
|
+
setSheet(null)
|
|
183
|
+
return
|
|
184
|
+
}
|
|
185
|
+
setSheet(parsed)
|
|
186
|
+
})
|
|
187
|
+
.catch((err) => {
|
|
188
|
+
if (cancelled) return
|
|
189
|
+
logger.error('staff.time_tracking.reports sheet load failed', { err })
|
|
190
|
+
setError(err instanceof Error ? err.message : labels.loadError)
|
|
191
|
+
})
|
|
192
|
+
.finally(() => {
|
|
193
|
+
if (!cancelled) setLoading(false)
|
|
194
|
+
})
|
|
195
|
+
return () => {
|
|
196
|
+
cancelled = true
|
|
197
|
+
}
|
|
198
|
+
}, [labels.loadError, reloadToken, reportId])
|
|
199
|
+
|
|
200
|
+
const money = React.useCallback(
|
|
201
|
+
(amount: number | null | undefined) => {
|
|
202
|
+
if (amount === null || amount === undefined) return '—'
|
|
203
|
+
return formatCurrency(amount, sheet?.report.currencyCode ?? undefined) ?? '—'
|
|
204
|
+
},
|
|
205
|
+
[sheet?.report.currencyCode],
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
const roundingLabel = React.useMemo(() => {
|
|
209
|
+
const unit = sheet?.report.roundingUnitMinutes ?? 0
|
|
210
|
+
if (!unit) return t('staff.time_tracking.reports.rounding.off', 'no rounding')
|
|
211
|
+
const direction =
|
|
212
|
+
sheet?.report.roundingDirection === 'nearest'
|
|
213
|
+
? t('staff.time_tracking.reports.rounding.nearest', 'to the nearest')
|
|
214
|
+
: t('staff.time_tracking.reports.rounding.up', 'always up')
|
|
215
|
+
return t('staff.time_tracking.reports.rounding.rule', 'rounding {minutes} min, {direction}')
|
|
216
|
+
.replace('{minutes}', String(unit))
|
|
217
|
+
.replace('{direction}', direction)
|
|
218
|
+
}, [sheet?.report.roundingDirection, sheet?.report.roundingUnitMinutes, t])
|
|
219
|
+
|
|
220
|
+
const handleExport = React.useCallback(
|
|
221
|
+
async (format: ExportFormat) => {
|
|
222
|
+
if (!reportId) return
|
|
223
|
+
try {
|
|
224
|
+
const call = await apiCall<Blob>(
|
|
225
|
+
`${REPORTS_API}/${reportId}/export?format=${format}`,
|
|
226
|
+
undefined,
|
|
227
|
+
{ parse: (response) => response.blob() },
|
|
228
|
+
)
|
|
229
|
+
if (!call.ok || !call.result) {
|
|
230
|
+
flash(labels.exportError, 'error')
|
|
231
|
+
return
|
|
232
|
+
}
|
|
233
|
+
if (typeof window === 'undefined') return
|
|
234
|
+
const href = URL.createObjectURL(call.result)
|
|
235
|
+
const anchor = document.createElement('a')
|
|
236
|
+
anchor.href = href
|
|
237
|
+
anchor.download = `${sheet?.report.reference || 'report'}.${format}`
|
|
238
|
+
document.body.appendChild(anchor)
|
|
239
|
+
anchor.click()
|
|
240
|
+
document.body.removeChild(anchor)
|
|
241
|
+
URL.revokeObjectURL(href)
|
|
242
|
+
// The export appended an `exported` event; refresh so the history shows
|
|
243
|
+
// it before anybody reads the unlock dialog's "already sent" warning.
|
|
244
|
+
setReloadToken((current) => current + 1)
|
|
245
|
+
} catch (err) {
|
|
246
|
+
logger.error('staff.time_tracking.reports export failed', { err })
|
|
247
|
+
flash(labels.exportError, 'error')
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
[labels.exportError, reportId, sheet?.report.reference],
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
const handleClose = React.useCallback(async () => {
|
|
254
|
+
if (!reportId || !sheet) return
|
|
255
|
+
const confirmed = await confirm({
|
|
256
|
+
title: t('staff.time_tracking.reports.close.confirmTitle', 'Close and lock this report?'),
|
|
257
|
+
description: t(
|
|
258
|
+
'staff.time_tracking.reports.close.confirmBody',
|
|
259
|
+
'The {count} entries it covers become read-only at their current values. New time can still be logged on the same tasks and will go into the next report.',
|
|
260
|
+
).replace('{count}', String(sheet.totals.entryCount)),
|
|
261
|
+
confirmText: t('staff.time_tracking.reports.close.action', 'Close & lock'),
|
|
262
|
+
})
|
|
263
|
+
if (!confirmed) return
|
|
264
|
+
|
|
265
|
+
setBusy(true)
|
|
266
|
+
try {
|
|
267
|
+
const call = await runMutation({
|
|
268
|
+
operation: () => apiCall<Record<string, unknown>>(`${REPORTS_API}/${reportId}/close`, { method: 'POST' }),
|
|
269
|
+
context: mutationContext(),
|
|
270
|
+
mutationPayload: { id: reportId },
|
|
271
|
+
})
|
|
272
|
+
if (!call.ok) {
|
|
273
|
+
flash(readErrorMessage(call.result, labels.closeError), 'error')
|
|
274
|
+
return
|
|
275
|
+
}
|
|
276
|
+
flash(t('staff.time_tracking.reports.close.done', 'Report closed. Its entries are locked.'), 'success')
|
|
277
|
+
setReloadToken((current) => current + 1)
|
|
278
|
+
} catch (err) {
|
|
279
|
+
logger.error('staff.time_tracking.reports close failed', { err })
|
|
280
|
+
flash(err instanceof Error ? err.message : labels.closeError, 'error')
|
|
281
|
+
} finally {
|
|
282
|
+
setBusy(false)
|
|
283
|
+
}
|
|
284
|
+
}, [confirm, labels.closeError, mutationContext, reportId, runMutation, sheet, t])
|
|
285
|
+
|
|
286
|
+
const handleUnlock = React.useCallback(async () => {
|
|
287
|
+
if (!reportId || unlockReason.trim().length === 0) return
|
|
288
|
+
setBusy(true)
|
|
289
|
+
try {
|
|
290
|
+
const call = await runMutation({
|
|
291
|
+
operation: () =>
|
|
292
|
+
apiCall<Record<string, unknown>>(`${REPORTS_API}/${reportId}/unlock`, {
|
|
293
|
+
method: 'POST',
|
|
294
|
+
headers: { 'content-type': 'application/json' },
|
|
295
|
+
body: JSON.stringify({ reason: unlockReason.trim() }),
|
|
296
|
+
}),
|
|
297
|
+
context: mutationContext(),
|
|
298
|
+
mutationPayload: { id: reportId, reason: unlockReason.trim() },
|
|
299
|
+
})
|
|
300
|
+
if (!call.ok) {
|
|
301
|
+
flash(readErrorMessage(call.result, labels.unlockError), 'error')
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
flash(
|
|
305
|
+
t('staff.time_tracking.reports.unlock.done', 'Report unlocked. Its entries can be edited again.'),
|
|
306
|
+
'success',
|
|
307
|
+
)
|
|
308
|
+
setUnlockOpen(false)
|
|
309
|
+
setUnlockReason('')
|
|
310
|
+
setReloadToken((current) => current + 1)
|
|
311
|
+
} catch (err) {
|
|
312
|
+
logger.error('staff.time_tracking.reports unlock failed', { err })
|
|
313
|
+
flash(err instanceof Error ? err.message : labels.unlockError, 'error')
|
|
314
|
+
} finally {
|
|
315
|
+
setBusy(false)
|
|
316
|
+
}
|
|
317
|
+
}, [labels.unlockError, mutationContext, reportId, runMutation, t, unlockReason])
|
|
318
|
+
|
|
319
|
+
if (loading) {
|
|
320
|
+
return (
|
|
321
|
+
<Page>
|
|
322
|
+
<PageBody>
|
|
323
|
+
<LoadingMessage label={t('staff.time_tracking.reports.detail.loading', 'Loading report…')} />
|
|
324
|
+
</PageBody>
|
|
325
|
+
</Page>
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (error || !sheet) {
|
|
330
|
+
return (
|
|
331
|
+
<Page>
|
|
332
|
+
<PageBody>
|
|
333
|
+
<ErrorMessage label={error ?? labels.loadError} />
|
|
334
|
+
</PageBody>
|
|
335
|
+
</Page>
|
|
336
|
+
)
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const lastExport = sheet.events.find((event) => event.eventType === 'exported') ?? null
|
|
340
|
+
|
|
341
|
+
const reportInjectionContext: ReportDetailInjectionContext = {
|
|
342
|
+
entityId: REPORT_ENTITY_ID,
|
|
343
|
+
recordId: reportId,
|
|
344
|
+
reportId,
|
|
345
|
+
reference: sheet.report.reference,
|
|
346
|
+
isClosed,
|
|
347
|
+
periodFrom: sheet.report.periodFrom ?? null,
|
|
348
|
+
periodTo: sheet.report.periodTo ?? null,
|
|
349
|
+
retryLastMutation,
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return (
|
|
353
|
+
<Page>
|
|
354
|
+
<PageBody>
|
|
355
|
+
<FormHeader
|
|
356
|
+
mode="detail"
|
|
357
|
+
backHref={REPORTS_HREF}
|
|
358
|
+
title={sheet.report.title}
|
|
359
|
+
subtitle={`${sheet.report.periodFrom ?? ''} – ${sheet.report.periodTo ?? ''}`}
|
|
360
|
+
statusBadge={
|
|
361
|
+
<>
|
|
362
|
+
{isClosed ? (
|
|
363
|
+
<Badge variant="success">
|
|
364
|
+
<Lock aria-hidden="true" className="size-3" />
|
|
365
|
+
{t('staff.time_tracking.reports.status.closed', 'Closed')}
|
|
366
|
+
</Badge>
|
|
367
|
+
) : (
|
|
368
|
+
<Badge variant="warning">{t('staff.time_tracking.reports.status.draft', 'Draft')}</Badge>
|
|
369
|
+
)}
|
|
370
|
+
<InjectionSpot
|
|
371
|
+
spotId={extensionPoints.hosts.reportDetailStatusBadges.spotId}
|
|
372
|
+
context={reportInjectionContext}
|
|
373
|
+
data={sheet.report}
|
|
374
|
+
/>
|
|
375
|
+
</>
|
|
376
|
+
}
|
|
377
|
+
actionsContent={
|
|
378
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
379
|
+
{EXPORT_FORMATS.map((format) => (
|
|
380
|
+
<Button
|
|
381
|
+
key={format}
|
|
382
|
+
variant="outline"
|
|
383
|
+
onClick={() => void handleExport(format)}
|
|
384
|
+
disabled={busy}
|
|
385
|
+
>
|
|
386
|
+
<Download aria-hidden="true" />
|
|
387
|
+
{format.toUpperCase()}
|
|
388
|
+
</Button>
|
|
389
|
+
))}
|
|
390
|
+
{isClosed ? (
|
|
391
|
+
canUnlockNow ? (
|
|
392
|
+
<Button
|
|
393
|
+
variant="destructive-outline"
|
|
394
|
+
onClick={() => setUnlockOpen(true)}
|
|
395
|
+
disabled={busy}
|
|
396
|
+
>
|
|
397
|
+
<LockOpen aria-hidden="true" />
|
|
398
|
+
{t('staff.time_tracking.reports.unlock.action', 'Unlock entries')}
|
|
399
|
+
</Button>
|
|
400
|
+
) : null
|
|
401
|
+
) : canClose ? (
|
|
402
|
+
<Button onClick={() => void handleClose()} disabled={busy}>
|
|
403
|
+
<Lock aria-hidden="true" />
|
|
404
|
+
{t('staff.time_tracking.reports.close.action', 'Close & lock')}
|
|
405
|
+
</Button>
|
|
406
|
+
) : null}
|
|
407
|
+
<InjectionSpot
|
|
408
|
+
spotId={extensionPoints.hosts.reportDetailHeader.spotId}
|
|
409
|
+
context={reportInjectionContext}
|
|
410
|
+
data={sheet.report}
|
|
411
|
+
/>
|
|
412
|
+
</div>
|
|
413
|
+
}
|
|
414
|
+
/>
|
|
415
|
+
|
|
416
|
+
{isClosed ? (
|
|
417
|
+
<Alert status="success" icon={<Lock aria-hidden="true" />} className="mb-4">
|
|
418
|
+
<AlertTitle>
|
|
419
|
+
{t('staff.time_tracking.reports.locked.title', 'The entries in this report are read-only')}
|
|
420
|
+
</AlertTitle>
|
|
421
|
+
<AlertDescription>
|
|
422
|
+
{t(
|
|
423
|
+
'staff.time_tracking.reports.locked.body',
|
|
424
|
+
'Their time, rate and billable flag cannot change without unlocking. New time can still be logged on the same tasks — it goes into the next report.',
|
|
425
|
+
)}
|
|
426
|
+
</AlertDescription>
|
|
427
|
+
</Alert>
|
|
428
|
+
) : null}
|
|
429
|
+
|
|
430
|
+
{sheet.alreadyReportedCount > 0 && !sheet.report.includeAlreadyReported ? (
|
|
431
|
+
<Alert status="warning" className="mb-4">
|
|
432
|
+
<AlertDescription>
|
|
433
|
+
{t(
|
|
434
|
+
'staff.time_tracking.reports.detail.excludedHint',
|
|
435
|
+
'{count} entries in this period are already frozen in another report and are excluded here ({hours}).',
|
|
436
|
+
)
|
|
437
|
+
.replace('{count}', String(sheet.alreadyReportedCount))
|
|
438
|
+
.replace('{hours}', formatReportMinutes(sheet.alreadyReportedMinutes))}
|
|
439
|
+
</AlertDescription>
|
|
440
|
+
</Alert>
|
|
441
|
+
) : null}
|
|
442
|
+
|
|
443
|
+
<ReportSheet
|
|
444
|
+
reference={sheet.report.reference}
|
|
445
|
+
customerName={sheet.report.customerName ?? sheet.report.title}
|
|
446
|
+
periodLabel={`${sheet.report.periodFrom ?? ''} – ${sheet.report.periodTo ?? ''}`}
|
|
447
|
+
issuedByLabel={null}
|
|
448
|
+
issuedAtLabel={sheet.report.closedAt ? sheet.report.closedAt.slice(0, 10) : null}
|
|
449
|
+
currencyCode={sheet.report.currencyCode}
|
|
450
|
+
showRates={sheet.report.showRates && canSeeMoney}
|
|
451
|
+
groups={sheet.groups}
|
|
452
|
+
totals={{
|
|
453
|
+
billableMinutes: sheet.totals.billableMinutes,
|
|
454
|
+
nonbillableMinutes: sheet.totals.nonbillableMinutes,
|
|
455
|
+
totalAmount: sheet.totals.totalAmount,
|
|
456
|
+
}}
|
|
457
|
+
roundingLabel={roundingLabel}
|
|
458
|
+
reportId={reportId}
|
|
459
|
+
/>
|
|
460
|
+
|
|
461
|
+
{isClosed ? (
|
|
462
|
+
<section className="mt-6 rounded-lg border border-border">
|
|
463
|
+
<header className="flex flex-wrap items-center justify-between gap-2 border-b border-border p-4">
|
|
464
|
+
<h3 className="text-sm font-semibold">
|
|
465
|
+
{t('staff.time_tracking.reports.locked.tableTitle', 'Locked entries')}
|
|
466
|
+
</h3>
|
|
467
|
+
<span className="font-mono text-xs text-muted-foreground">
|
|
468
|
+
{t('staff.time_tracking.reports.locked.tableCount', '{count} entries · {hours}')
|
|
469
|
+
.replace('{count}', String(sheet.rowCount))
|
|
470
|
+
.replace('{hours}', formatReportMinutes(sheet.totals.billableMinutes))}
|
|
471
|
+
</span>
|
|
472
|
+
</header>
|
|
473
|
+
<div className="overflow-x-auto">
|
|
474
|
+
<table className="w-full text-sm">
|
|
475
|
+
<thead>
|
|
476
|
+
<tr className="border-b border-border text-xs uppercase tracking-wide text-muted-foreground">
|
|
477
|
+
<th className="px-4 py-2 text-left font-medium">
|
|
478
|
+
{t('staff.time_tracking.reports.export.date', 'Date')}
|
|
479
|
+
</th>
|
|
480
|
+
<th className="px-4 py-2 text-left font-medium">
|
|
481
|
+
{t('staff.time_tracking.reports.export.task', 'Task')}
|
|
482
|
+
</th>
|
|
483
|
+
<th className="px-4 py-2 text-left font-medium">
|
|
484
|
+
{t('staff.time_tracking.reports.export.person', 'Person')}
|
|
485
|
+
</th>
|
|
486
|
+
<th className="px-4 py-2 text-right font-medium">
|
|
487
|
+
{t('staff.time_tracking.reports.sheet.time', 'Time')}
|
|
488
|
+
</th>
|
|
489
|
+
<th className="px-4 py-2 text-right font-medium">
|
|
490
|
+
{t('staff.time_tracking.reports.sheet.amount', 'Amount')}
|
|
491
|
+
</th>
|
|
492
|
+
<th className="w-10 px-4 py-2" />
|
|
493
|
+
</tr>
|
|
494
|
+
</thead>
|
|
495
|
+
<tbody>
|
|
496
|
+
{sheet.rows.map((row) => (
|
|
497
|
+
<tr key={row.entryId} className="border-b border-border/60 last:border-b-0">
|
|
498
|
+
<td className="px-4 py-2 text-muted-foreground">{row.date}</td>
|
|
499
|
+
<td className="px-4 py-2">{row.taskLabel}</td>
|
|
500
|
+
<td className="px-4 py-2">{row.personLabel}</td>
|
|
501
|
+
<td className="px-4 py-2 text-right font-mono tabular-nums">{row.hours}</td>
|
|
502
|
+
<td className="px-4 py-2 text-right font-mono tabular-nums">{money(row.amount)}</td>
|
|
503
|
+
<td className="px-4 py-2 text-muted-foreground">
|
|
504
|
+
<Lock aria-hidden="true" className="size-4" />
|
|
505
|
+
</td>
|
|
506
|
+
</tr>
|
|
507
|
+
))}
|
|
508
|
+
</tbody>
|
|
509
|
+
</table>
|
|
510
|
+
</div>
|
|
511
|
+
{sheet.rowsTruncated ? (
|
|
512
|
+
<p className="border-t border-border p-3 text-xs text-muted-foreground">
|
|
513
|
+
{t(
|
|
514
|
+
'staff.time_tracking.reports.locked.truncated',
|
|
515
|
+
'Showing the first {shown} of {total} entries — export the report for the full list.',
|
|
516
|
+
)
|
|
517
|
+
.replace('{shown}', String(sheet.rows.length))
|
|
518
|
+
.replace('{total}', String(sheet.rowCount))}
|
|
519
|
+
</p>
|
|
520
|
+
) : null}
|
|
521
|
+
</section>
|
|
522
|
+
) : null}
|
|
523
|
+
|
|
524
|
+
{sheet.events.length > 0 ? (
|
|
525
|
+
<section className="mt-6">
|
|
526
|
+
<h3 className="mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
|
527
|
+
{t('staff.time_tracking.reports.history.title', 'History')}
|
|
528
|
+
</h3>
|
|
529
|
+
<ReportHistory events={sheet.events} />
|
|
530
|
+
</section>
|
|
531
|
+
) : null}
|
|
532
|
+
|
|
533
|
+
<Dialog open={unlockOpen} onOpenChange={(open) => setUnlockOpen(open)}>
|
|
534
|
+
<DialogContent
|
|
535
|
+
onKeyDown={(event) => {
|
|
536
|
+
if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') {
|
|
537
|
+
event.preventDefault()
|
|
538
|
+
void handleUnlock()
|
|
539
|
+
}
|
|
540
|
+
}}
|
|
541
|
+
>
|
|
542
|
+
<DialogHeader>
|
|
543
|
+
<DialogTitle>
|
|
544
|
+
{t('staff.time_tracking.reports.unlock.dialogTitle', 'Unlock {count} entries?').replace(
|
|
545
|
+
'{count}',
|
|
546
|
+
String(sheet.rowCount),
|
|
547
|
+
)}
|
|
548
|
+
</DialogTitle>
|
|
549
|
+
</DialogHeader>
|
|
550
|
+
{lastExport ? (
|
|
551
|
+
<Alert status="warning">
|
|
552
|
+
<AlertTitle>
|
|
553
|
+
{t('staff.time_tracking.reports.unlock.sentTitle', 'This report has already been exported')}
|
|
554
|
+
</AlertTitle>
|
|
555
|
+
<AlertDescription>
|
|
556
|
+
{t(
|
|
557
|
+
'staff.time_tracking.reports.unlock.sentBody',
|
|
558
|
+
'A file was downloaded on {date}. Changes to unlocked entries will diverge from the copy the client holds.',
|
|
559
|
+
).replace('{date}', lastExport.createdAt?.slice(0, 10) ?? '')}
|
|
560
|
+
</AlertDescription>
|
|
561
|
+
</Alert>
|
|
562
|
+
) : null}
|
|
563
|
+
<div className="flex flex-col gap-1.5">
|
|
564
|
+
<Label htmlFor="unlock-reason">
|
|
565
|
+
{t('staff.time_tracking.reports.unlock.reason', 'Reason for unlocking')}
|
|
566
|
+
</Label>
|
|
567
|
+
<Textarea
|
|
568
|
+
id="unlock-reason"
|
|
569
|
+
value={unlockReason}
|
|
570
|
+
onChange={(event) => setUnlockReason(event.target.value)}
|
|
571
|
+
placeholder={t(
|
|
572
|
+
'staff.time_tracking.reports.unlock.reasonPlaceholder',
|
|
573
|
+
'e.g. the client disputed 4h on the refactor — correction agreed on the 21st.',
|
|
574
|
+
)}
|
|
575
|
+
/>
|
|
576
|
+
<span className="text-xs text-muted-foreground">
|
|
577
|
+
{t(
|
|
578
|
+
'staff.time_tracking.reports.unlock.reasonHint',
|
|
579
|
+
'The reason is recorded in the report history with your name and the date.',
|
|
580
|
+
)}
|
|
581
|
+
</span>
|
|
582
|
+
</div>
|
|
583
|
+
<DialogFooter>
|
|
584
|
+
<Button variant="ghost" onClick={() => setUnlockOpen(false)}>
|
|
585
|
+
{t('staff.time_tracking.reports.unlock.cancel', 'Cancel')}
|
|
586
|
+
</Button>
|
|
587
|
+
<Button
|
|
588
|
+
variant="destructive"
|
|
589
|
+
onClick={() => void handleUnlock()}
|
|
590
|
+
disabled={busy || unlockReason.trim().length === 0}
|
|
591
|
+
>
|
|
592
|
+
<LockOpen aria-hidden="true" />
|
|
593
|
+
{t('staff.time_tracking.reports.unlock.action', 'Unlock entries')}
|
|
594
|
+
</Button>
|
|
595
|
+
</DialogFooter>
|
|
596
|
+
</DialogContent>
|
|
597
|
+
</Dialog>
|
|
598
|
+
|
|
599
|
+
<InjectionSpot
|
|
600
|
+
spotId={extensionPoints.hosts.reportDetailFooter.spotId}
|
|
601
|
+
context={reportInjectionContext}
|
|
602
|
+
data={sheet.report}
|
|
603
|
+
/>
|
|
604
|
+
|
|
605
|
+
{ConfirmDialogElement}
|
|
606
|
+
</PageBody>
|
|
607
|
+
</Page>
|
|
608
|
+
)
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
function ReportHistory({ events }: { events: readonly ReportHistoryEvent[] }) {
|
|
612
|
+
const t = useT()
|
|
613
|
+
return (
|
|
614
|
+
<ol className="flex flex-col gap-3">
|
|
615
|
+
{events.map((event) => (
|
|
616
|
+
<li key={event.id} className="rounded-md border border-border p-3">
|
|
617
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
618
|
+
<span className="text-sm font-medium">
|
|
619
|
+
{event.eventType === 'closed'
|
|
620
|
+
? t('staff.time_tracking.reports.history.closed', 'Closed the report and locked its entries.')
|
|
621
|
+
: event.eventType === 'unlocked'
|
|
622
|
+
? t('staff.time_tracking.reports.history.unlocked', 'Unlocked the report entries.')
|
|
623
|
+
: t('staff.time_tracking.reports.history.exported', 'Exported the report.')}
|
|
624
|
+
</span>
|
|
625
|
+
<span className="text-xs text-muted-foreground">{event.createdAt?.replace('T', ' ').slice(0, 16)}</span>
|
|
626
|
+
</div>
|
|
627
|
+
{event.reason ? <p className="mt-1 text-sm text-muted-foreground">{event.reason}</p> : null}
|
|
628
|
+
</li>
|
|
629
|
+
))}
|
|
630
|
+
</ol>
|
|
631
|
+
)
|
|
632
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const metadata = {
|
|
2
|
+
requireAuth: true,
|
|
3
|
+
requireFeatures: ['staff.timesheets.reports.manage'],
|
|
4
|
+
pageTitle: 'New report',
|
|
5
|
+
pageTitleKey: 'staff.time_tracking.reports.create.title',
|
|
6
|
+
navHidden: true,
|
|
7
|
+
breadcrumb: [
|
|
8
|
+
{ label: 'Time tracking', labelKey: 'staff.time_tracking.nav.group', href: '/backend/staff/time-tracking' },
|
|
9
|
+
{ label: 'Reports', labelKey: 'staff.time_tracking.nav.reports', href: '/backend/staff/time-tracking/reports' },
|
|
10
|
+
{ label: 'New report', labelKey: 'staff.time_tracking.reports.create.title' },
|
|
11
|
+
],
|
|
12
|
+
}
|