@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,1014 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Page, PageBody } from "@open-mercato/ui/backend/Page";
|
|
5
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
6
|
+
import { Badge } from "@open-mercato/ui/primitives/badge";
|
|
7
|
+
import { Spinner } from "@open-mercato/ui/primitives/spinner";
|
|
8
|
+
import { Input } from "@open-mercato/ui/primitives/input";
|
|
9
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@open-mercato/ui/primitives/dialog";
|
|
10
|
+
import { LookupSelect } from "@open-mercato/ui/backend/inputs/LookupSelect";
|
|
11
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@open-mercato/ui/primitives/tabs";
|
|
12
|
+
import { apiCall, readApiResultOrThrow } from "@open-mercato/ui/backend/utils/apiCall";
|
|
13
|
+
import { deleteCrud, createCrud } from "@open-mercato/ui/backend/utils/crud";
|
|
14
|
+
import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
|
|
15
|
+
import { surfaceRecordConflict } from "@open-mercato/ui/backend/conflicts";
|
|
16
|
+
import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
|
|
17
|
+
import { InjectionSpot, useInjectionWidgets } from "@open-mercato/ui/backend/injection/InjectionSpot";
|
|
18
|
+
import { extensionPoints } from "@open-mercato/core/modules/staff/extension-points";
|
|
19
|
+
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
20
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
21
|
+
import { useOrganizationScopeVersion } from "@open-mercato/shared/lib/frontend/useOrganizationScope";
|
|
22
|
+
import { LoadingMessage } from "@open-mercato/ui/backend/detail";
|
|
23
|
+
import { ErrorMessage, RecordNotFoundState } from "@open-mercato/ui/backend/detail";
|
|
24
|
+
import { ArrowLeft, Plus, Pencil, ChevronDown, Trash2, User, Users } from "lucide-react";
|
|
25
|
+
import Link from "next/link";
|
|
26
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
27
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
28
|
+
import { formatCurrency } from "@open-mercato/ui/utils/format";
|
|
29
|
+
import { KpiCard, Sparkline } from "@open-mercato/ui/backend/charts";
|
|
30
|
+
import { ProjectTeamDrawer } from "../../../../../lib/time-tracking-ui/ProjectTeamDrawer.js";
|
|
31
|
+
import { NoProjectAccess } from "../../../../../lib/time-tracking-ui/NoProjectAccess.js";
|
|
32
|
+
import { ProjectBudgetCell } from "../../../../../lib/timesheets-projects-ui/ProjectBudgetCell.js";
|
|
33
|
+
import { computeBudgetBurn } from "../../../../../lib/timesheets-projects/budgetBurn.js";
|
|
34
|
+
import { resolveProjectColorHex } from "../../../../../lib/timesheets-ui/colors.js";
|
|
35
|
+
const logger = createLogger("staff");
|
|
36
|
+
const BACK_HREF = "/backend/staff/time-tracking/projects";
|
|
37
|
+
const EMPLOYEE_MUTATION_CONTEXT_ID = "staff-time-project-detail:employees";
|
|
38
|
+
const EMPLOYEE_RESOURCE_KIND = "staff.time_project_member";
|
|
39
|
+
const NO_PROJECT_ACCESS_REASON = "no_project_access";
|
|
40
|
+
const PROJECT_ENTITY_ID = "staff:staff_time_project";
|
|
41
|
+
function readDenialReason(payload) {
|
|
42
|
+
if (!payload || typeof payload !== "object") return null;
|
|
43
|
+
const reason = payload.reason;
|
|
44
|
+
return typeof reason === "string" ? reason : null;
|
|
45
|
+
}
|
|
46
|
+
function RailGroup({ label, first }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: `border-b pb-1.5 text-overline font-semibold uppercase tracking-widest text-muted-foreground ${first ? "" : "pt-4"}`,
|
|
51
|
+
children: label
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function RailFact({ label, value }) {
|
|
56
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3 border-b py-2 text-sm last:border-b-0", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("dt", { className: "shrink-0 text-muted-foreground", children: label }),
|
|
58
|
+
/* @__PURE__ */ jsx("dd", { className: "text-right font-medium tabular-nums", children: value })
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
function TimesheetProjectDetailPage({ params }) {
|
|
62
|
+
const projectId = params?.id;
|
|
63
|
+
const t = useT();
|
|
64
|
+
const scopeVersion = useOrganizationScopeVersion();
|
|
65
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog();
|
|
66
|
+
const router = useRouter();
|
|
67
|
+
const pathname = usePathname();
|
|
68
|
+
const searchParams = useSearchParams();
|
|
69
|
+
const [project, setProject] = React.useState(null);
|
|
70
|
+
const [loading, setLoading] = React.useState(true);
|
|
71
|
+
const [error, setError] = React.useState(null);
|
|
72
|
+
const [isNotFound, setIsNotFound] = React.useState(false);
|
|
73
|
+
const [accessDenied, setAccessDenied] = React.useState(false);
|
|
74
|
+
const [employees, setEmployees] = React.useState([]);
|
|
75
|
+
const [employeesLoading, setEmployeesLoading] = React.useState(false);
|
|
76
|
+
const [expandedCards, setExpandedCards] = React.useState(/* @__PURE__ */ new Set());
|
|
77
|
+
const [reloadToken, setReloadToken] = React.useState(0);
|
|
78
|
+
const [activeTab, setActiveTab] = React.useState("team");
|
|
79
|
+
const [recentEntries, setRecentEntries] = React.useState([]);
|
|
80
|
+
const [recentEntriesLoading, setRecentEntriesLoading] = React.useState(false);
|
|
81
|
+
const [projectTasks, setProjectTasks] = React.useState([]);
|
|
82
|
+
const [projectTasksLoading, setProjectTasksLoading] = React.useState(false);
|
|
83
|
+
const [canManageProjects, setCanManageProjects] = React.useState(false);
|
|
84
|
+
const [canSeeMoney, setCanSeeMoney] = React.useState(false);
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
let cancelled = false;
|
|
87
|
+
void (async () => {
|
|
88
|
+
try {
|
|
89
|
+
const res = await apiCall("/api/auth/feature-check", {
|
|
90
|
+
method: "POST",
|
|
91
|
+
headers: { "content-type": "application/json" },
|
|
92
|
+
body: JSON.stringify({
|
|
93
|
+
features: ["staff.timesheets.projects.manage", "staff.timesheets.rates.view"]
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
if (!cancelled) {
|
|
97
|
+
const granted = new Set(res.result?.granted ?? []);
|
|
98
|
+
setCanManageProjects(granted.has("staff.timesheets.projects.manage"));
|
|
99
|
+
setCanSeeMoney(granted.has("staff.timesheets.rates.view"));
|
|
100
|
+
}
|
|
101
|
+
} catch {
|
|
102
|
+
}
|
|
103
|
+
})();
|
|
104
|
+
return () => {
|
|
105
|
+
cancelled = true;
|
|
106
|
+
};
|
|
107
|
+
}, []);
|
|
108
|
+
const [addDialogOpen, setAddDialogOpen] = React.useState(false);
|
|
109
|
+
const [addStaffMemberId, setAddStaffMemberId] = React.useState(null);
|
|
110
|
+
const [addRole, setAddRole] = React.useState("");
|
|
111
|
+
const [addStartDate, setAddStartDate] = React.useState("");
|
|
112
|
+
const [addSaving, setAddSaving] = React.useState(false);
|
|
113
|
+
const [staffLookupError, setStaffLookupError] = React.useState(null);
|
|
114
|
+
React.useEffect(() => {
|
|
115
|
+
if (!projectId || activeTab !== "time") return;
|
|
116
|
+
let cancelled = false;
|
|
117
|
+
void (async () => {
|
|
118
|
+
setRecentEntriesLoading(true);
|
|
119
|
+
try {
|
|
120
|
+
const res = await apiCall(
|
|
121
|
+
`/api/staff/timesheets/time-entries?projectId=${encodeURIComponent(projectId)}&page=1&pageSize=25&sortField=date&sortDir=desc`
|
|
122
|
+
);
|
|
123
|
+
if (cancelled || !res.ok) return;
|
|
124
|
+
const items = Array.isArray(res.result?.items) ? res.result.items : [];
|
|
125
|
+
setRecentEntries(
|
|
126
|
+
items.map((row) => {
|
|
127
|
+
const id = typeof row.id === "string" ? row.id : null;
|
|
128
|
+
if (!id) return null;
|
|
129
|
+
const raw = row;
|
|
130
|
+
const minutes = raw.duration_minutes ?? raw.durationMinutes;
|
|
131
|
+
return {
|
|
132
|
+
id,
|
|
133
|
+
date: typeof raw.date === "string" ? raw.date.slice(0, 10) : "",
|
|
134
|
+
description: typeof raw.description === "string" ? raw.description : typeof raw.notes === "string" ? raw.notes : null,
|
|
135
|
+
durationMinutes: typeof minutes === "number" ? minutes : Number(minutes ?? 0) || 0,
|
|
136
|
+
isBillable: raw.is_billable === true || raw.isBillable === true,
|
|
137
|
+
taskId: typeof (raw.task_id ?? raw.taskId) === "string" ? String(raw.task_id ?? raw.taskId) : null,
|
|
138
|
+
staffMemberId: typeof (raw.staff_member_id ?? raw.staffMemberId) === "string" ? String(raw.staff_member_id ?? raw.staffMemberId) : null
|
|
139
|
+
};
|
|
140
|
+
}).filter((row) => row !== null)
|
|
141
|
+
);
|
|
142
|
+
} catch (err) {
|
|
143
|
+
logger.warn("staff.timesheets.projects.detail recent entries failed", { err });
|
|
144
|
+
} finally {
|
|
145
|
+
if (!cancelled) setRecentEntriesLoading(false);
|
|
146
|
+
}
|
|
147
|
+
})();
|
|
148
|
+
return () => {
|
|
149
|
+
cancelled = true;
|
|
150
|
+
};
|
|
151
|
+
}, [projectId, activeTab, reloadToken]);
|
|
152
|
+
React.useEffect(() => {
|
|
153
|
+
if (!projectId || activeTab !== "tasks") return;
|
|
154
|
+
let cancelled = false;
|
|
155
|
+
void (async () => {
|
|
156
|
+
setProjectTasksLoading(true);
|
|
157
|
+
try {
|
|
158
|
+
const res = await apiCall(
|
|
159
|
+
// `timeProjectId`, not `projectId`: the tasks list schema declares the
|
|
160
|
+
// former and is `.passthrough()`, so the wrong name is accepted, never
|
|
161
|
+
// read, and the tab silently lists every task in the tenant.
|
|
162
|
+
`/api/staff/timesheets/tasks?timeProjectId=${encodeURIComponent(projectId)}&page=1&pageSize=50&sortField=reference&sortDir=asc`
|
|
163
|
+
);
|
|
164
|
+
if (cancelled || !res.ok) return;
|
|
165
|
+
const items = Array.isArray(res.result?.items) ? res.result.items : [];
|
|
166
|
+
setProjectTasks(
|
|
167
|
+
items.map((row) => {
|
|
168
|
+
const id = typeof row.id === "string" ? row.id : null;
|
|
169
|
+
const title = typeof row.title === "string" ? row.title : null;
|
|
170
|
+
if (!id || !title) return null;
|
|
171
|
+
const raw = row;
|
|
172
|
+
const logged = raw.loggedMinutes ?? raw.logged_minutes;
|
|
173
|
+
return {
|
|
174
|
+
id,
|
|
175
|
+
reference: typeof raw.reference === "string" ? raw.reference : null,
|
|
176
|
+
title,
|
|
177
|
+
statusId: typeof (raw.task_status_id ?? raw.taskStatusId) === "string" ? String(raw.task_status_id ?? raw.taskStatusId) : null,
|
|
178
|
+
assigneeStaffMemberId: typeof (raw.assignee_staff_member_id ?? raw.assigneeStaffMemberId) === "string" ? String(raw.assignee_staff_member_id ?? raw.assigneeStaffMemberId) : null,
|
|
179
|
+
loggedMinutes: typeof logged === "number" ? logged : null
|
|
180
|
+
};
|
|
181
|
+
}).filter((row) => row !== null)
|
|
182
|
+
);
|
|
183
|
+
} catch (err) {
|
|
184
|
+
logger.warn("staff.timesheets.projects.detail tasks failed", { err });
|
|
185
|
+
} finally {
|
|
186
|
+
if (!cancelled) setProjectTasksLoading(false);
|
|
187
|
+
}
|
|
188
|
+
})();
|
|
189
|
+
return () => {
|
|
190
|
+
cancelled = true;
|
|
191
|
+
};
|
|
192
|
+
}, [projectId, activeTab, reloadToken]);
|
|
193
|
+
const employeeNameById = React.useMemo(
|
|
194
|
+
() => new Map(employees.map((emp) => [emp.staffMemberId, emp.displayName ?? ""])),
|
|
195
|
+
[employees]
|
|
196
|
+
);
|
|
197
|
+
const activeCount = employees.filter((emp) => emp.status === "active").length;
|
|
198
|
+
const inactiveCount = employees.length - activeCount;
|
|
199
|
+
React.useEffect(() => {
|
|
200
|
+
if (!projectId) return;
|
|
201
|
+
let cancelled = false;
|
|
202
|
+
async function loadProject() {
|
|
203
|
+
setLoading(true);
|
|
204
|
+
setError(null);
|
|
205
|
+
setIsNotFound(false);
|
|
206
|
+
setAccessDenied(false);
|
|
207
|
+
try {
|
|
208
|
+
const queryParams = new URLSearchParams({ page: "1", pageSize: "1", ids: projectId });
|
|
209
|
+
const call = await apiCall(
|
|
210
|
+
`/api/staff/timesheets/time-projects?${queryParams.toString()}`
|
|
211
|
+
);
|
|
212
|
+
if (call.status === 404 && readDenialReason(call.result) === NO_PROJECT_ACCESS_REASON) {
|
|
213
|
+
if (!cancelled) setAccessDenied(true);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (!call.ok) {
|
|
217
|
+
throw new Error(t("staff.timesheets.projects.errors.load", "Failed to load project."));
|
|
218
|
+
}
|
|
219
|
+
const payload = call.result;
|
|
220
|
+
const record = Array.isArray(payload?.items) ? payload.items[0] : null;
|
|
221
|
+
if (!record) {
|
|
222
|
+
if (!cancelled) setIsNotFound(true);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (!cancelled) setProject(record);
|
|
226
|
+
} catch (loadError) {
|
|
227
|
+
if (!cancelled) {
|
|
228
|
+
setError(loadError instanceof Error ? loadError.message : t("staff.timesheets.projects.errors.load", "Failed to load project."));
|
|
229
|
+
}
|
|
230
|
+
} finally {
|
|
231
|
+
if (!cancelled) setLoading(false);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
loadProject();
|
|
235
|
+
return () => {
|
|
236
|
+
cancelled = true;
|
|
237
|
+
};
|
|
238
|
+
}, [projectId, t, scopeVersion]);
|
|
239
|
+
const loadEmployees = React.useCallback(async () => {
|
|
240
|
+
if (!projectId || accessDenied) return;
|
|
241
|
+
setEmployeesLoading(true);
|
|
242
|
+
try {
|
|
243
|
+
const payload = await readApiResultOrThrow(
|
|
244
|
+
`/api/staff/timesheets/time-projects/${projectId}/employees?page=1&pageSize=100`,
|
|
245
|
+
void 0,
|
|
246
|
+
{ errorMessage: t("staff.timesheets.projects.employees.empty", "No employees assigned yet."), fallback: { items: [], total: 0 } }
|
|
247
|
+
);
|
|
248
|
+
const items = Array.isArray(payload.items) ? payload.items : [];
|
|
249
|
+
const staffMemberIds = items.map((item) => String(item.staff_member_id ?? item.staffMemberId ?? "")).filter((id) => id.length > 0);
|
|
250
|
+
let staffMap = /* @__PURE__ */ new Map();
|
|
251
|
+
if (staffMemberIds.length > 0) {
|
|
252
|
+
try {
|
|
253
|
+
const staffRes = await apiCall(
|
|
254
|
+
`/api/staff/team-members?ids=${staffMemberIds.join(",")}&pageSize=100`
|
|
255
|
+
);
|
|
256
|
+
if (staffRes.ok) {
|
|
257
|
+
const staffItems = Array.isArray(staffRes.result?.items) ? staffRes.result.items : [];
|
|
258
|
+
staffMap = new Map(staffItems.map((member) => [member.id, member]));
|
|
259
|
+
}
|
|
260
|
+
} catch {
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const mapped = items.map((item) => {
|
|
264
|
+
const staffMemberId = String(item.staff_member_id ?? item.staffMemberId ?? "");
|
|
265
|
+
const staff = staffMap.get(staffMemberId);
|
|
266
|
+
return {
|
|
267
|
+
id: String(item.id ?? ""),
|
|
268
|
+
staffMemberId,
|
|
269
|
+
role: typeof item.role === "string" ? item.role : null,
|
|
270
|
+
status: typeof item.status === "string" ? item.status : null,
|
|
271
|
+
assignedStartDate: String(item.assigned_start_date ?? item.assignedStartDate ?? ""),
|
|
272
|
+
assignedEndDate: typeof (item.assigned_end_date ?? item.assignedEndDate) === "string" ? String(item.assigned_end_date ?? item.assignedEndDate) : null,
|
|
273
|
+
displayName: staff?.display_name ?? staff?.displayName ?? null,
|
|
274
|
+
teamName: staff?.team?.name ?? null
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
setEmployees(mapped);
|
|
278
|
+
} catch (loadError) {
|
|
279
|
+
logger.error("staff.timesheets.projects.employees.list", { err: loadError });
|
|
280
|
+
} finally {
|
|
281
|
+
setEmployeesLoading(false);
|
|
282
|
+
}
|
|
283
|
+
}, [projectId, accessDenied, t]);
|
|
284
|
+
React.useEffect(() => {
|
|
285
|
+
void loadEmployees();
|
|
286
|
+
}, [loadEmployees, reloadToken, scopeVersion]);
|
|
287
|
+
const toggleCard = React.useCallback((employeeId) => {
|
|
288
|
+
setExpandedCards((prev) => {
|
|
289
|
+
const next = new Set(prev);
|
|
290
|
+
if (next.has(employeeId)) next.delete(employeeId);
|
|
291
|
+
else next.add(employeeId);
|
|
292
|
+
return next;
|
|
293
|
+
});
|
|
294
|
+
}, []);
|
|
295
|
+
const { runMutation, retryLastMutation } = useGuardedMutation({
|
|
296
|
+
contextId: EMPLOYEE_MUTATION_CONTEXT_ID,
|
|
297
|
+
blockedMessage: t("ui.forms.flash.saveBlocked", "Save blocked by validation")
|
|
298
|
+
});
|
|
299
|
+
const projectInjectionContext = React.useMemo(
|
|
300
|
+
() => ({
|
|
301
|
+
entityId: PROJECT_ENTITY_ID,
|
|
302
|
+
recordId: projectId ?? null,
|
|
303
|
+
projectId: projectId ?? null,
|
|
304
|
+
path: pathname ?? null,
|
|
305
|
+
retryLastMutation
|
|
306
|
+
}),
|
|
307
|
+
[pathname, projectId, retryLastMutation]
|
|
308
|
+
);
|
|
309
|
+
const { widgets: injectedTabWidgets } = useInjectionWidgets(
|
|
310
|
+
extensionPoints.hosts.projectDetailTabs.spotId,
|
|
311
|
+
{ context: projectInjectionContext, triggerOnLoad: true }
|
|
312
|
+
);
|
|
313
|
+
const employeeMutationContext = React.useCallback(
|
|
314
|
+
(resourceId) => ({
|
|
315
|
+
formId: EMPLOYEE_MUTATION_CONTEXT_ID,
|
|
316
|
+
resourceKind: EMPLOYEE_RESOURCE_KIND,
|
|
317
|
+
resourceId,
|
|
318
|
+
retryLastMutation
|
|
319
|
+
}),
|
|
320
|
+
[retryLastMutation]
|
|
321
|
+
);
|
|
322
|
+
const handleRemoveEmployee = React.useCallback(async (emp) => {
|
|
323
|
+
const confirmed = await confirm({
|
|
324
|
+
title: t("staff.timesheets.projects.employees.remove", "Remove"),
|
|
325
|
+
text: t("staff.timesheets.projects.employees.removeConfirm", "Remove this employee from the project?"),
|
|
326
|
+
variant: "destructive"
|
|
327
|
+
});
|
|
328
|
+
if (!confirmed) return;
|
|
329
|
+
try {
|
|
330
|
+
await runMutation({
|
|
331
|
+
operation: () => deleteCrud(
|
|
332
|
+
`staff/timesheets/time-projects/${projectId}/employees`,
|
|
333
|
+
emp.id,
|
|
334
|
+
{ errorMessage: t("staff.timesheets.projects.employees.removeError", "Failed to remove employee.") }
|
|
335
|
+
),
|
|
336
|
+
context: employeeMutationContext(emp.id),
|
|
337
|
+
mutationPayload: { id: emp.id }
|
|
338
|
+
});
|
|
339
|
+
flash(t("staff.timesheets.projects.employees.removed", "Employee removed."), "success");
|
|
340
|
+
setReloadToken((token) => token + 1);
|
|
341
|
+
} catch (removeError) {
|
|
342
|
+
if (surfaceRecordConflict(removeError, t)) return;
|
|
343
|
+
flash(t("staff.timesheets.projects.employees.removeError", "Failed to remove employee."), "error");
|
|
344
|
+
}
|
|
345
|
+
}, [projectId, confirm, employeeMutationContext, runMutation, t]);
|
|
346
|
+
const openAddDialog = React.useCallback(() => {
|
|
347
|
+
setAddStaffMemberId(null);
|
|
348
|
+
setAddRole("");
|
|
349
|
+
setAddStartDate((/* @__PURE__ */ new Date()).toISOString().slice(0, 10));
|
|
350
|
+
setStaffLookupError(null);
|
|
351
|
+
setAddDialogOpen(true);
|
|
352
|
+
}, []);
|
|
353
|
+
const staffLookupErrorMessage = t(
|
|
354
|
+
"staff.timesheets.projects.employees.loadError",
|
|
355
|
+
"Could not load team members. Check your connection and try again."
|
|
356
|
+
);
|
|
357
|
+
const fetchStaffMembers = React.useCallback(async (query) => {
|
|
358
|
+
const params2 = new URLSearchParams({ search: query, pageSize: "20", isActive: "true" });
|
|
359
|
+
try {
|
|
360
|
+
const payload = await readApiResultOrThrow(
|
|
361
|
+
`/api/staff/team-members?${params2.toString()}`,
|
|
362
|
+
void 0,
|
|
363
|
+
{ errorMessage: staffLookupErrorMessage, fallback: { items: [] } }
|
|
364
|
+
);
|
|
365
|
+
const items = Array.isArray(payload.items) ? payload.items : [];
|
|
366
|
+
setStaffLookupError(null);
|
|
367
|
+
return items.map((member) => ({
|
|
368
|
+
id: member.id,
|
|
369
|
+
title: member.display_name ?? member.displayName ?? member.id,
|
|
370
|
+
subtitle: member.team?.name ?? null
|
|
371
|
+
}));
|
|
372
|
+
} catch (lookupError) {
|
|
373
|
+
logger.error("staff.timesheets.projects.employees.lookup", { err: lookupError });
|
|
374
|
+
setStaffLookupError(staffLookupErrorMessage);
|
|
375
|
+
throw lookupError;
|
|
376
|
+
}
|
|
377
|
+
}, [staffLookupErrorMessage]);
|
|
378
|
+
const handleAddEmployee = React.useCallback(async () => {
|
|
379
|
+
if (!projectId || !addStaffMemberId || !addStartDate) return;
|
|
380
|
+
const payload = {
|
|
381
|
+
staffMemberId: addStaffMemberId,
|
|
382
|
+
timeProjectId: projectId,
|
|
383
|
+
role: addRole.trim() || null,
|
|
384
|
+
assignedStartDate: addStartDate
|
|
385
|
+
};
|
|
386
|
+
setAddSaving(true);
|
|
387
|
+
try {
|
|
388
|
+
await runMutation({
|
|
389
|
+
operation: () => createCrud(`staff/timesheets/time-projects/${projectId}/employees`, payload, {
|
|
390
|
+
errorMessage: t("staff.timesheets.projects.employees.addError", "Failed to add employee.")
|
|
391
|
+
}),
|
|
392
|
+
context: employeeMutationContext(addStaffMemberId),
|
|
393
|
+
mutationPayload: payload
|
|
394
|
+
});
|
|
395
|
+
flash(t("staff.timesheets.projects.employees.added", "Employee added."), "success");
|
|
396
|
+
setAddDialogOpen(false);
|
|
397
|
+
setReloadToken((token) => token + 1);
|
|
398
|
+
} catch (addError) {
|
|
399
|
+
if (surfaceRecordConflict(addError, t)) return;
|
|
400
|
+
flash(addError instanceof Error ? addError.message : t("staff.timesheets.projects.employees.addError", "Failed to add employee."), "error");
|
|
401
|
+
} finally {
|
|
402
|
+
setAddSaving(false);
|
|
403
|
+
}
|
|
404
|
+
}, [projectId, addStaffMemberId, addRole, addStartDate, employeeMutationContext, runMutation, t]);
|
|
405
|
+
const teamPanelRequested = searchParams?.get("panel") === "team";
|
|
406
|
+
const teamDrawerOpen = teamPanelRequested && canManageProjects;
|
|
407
|
+
const requesterUserId = searchParams?.get("requesterUserId") ?? null;
|
|
408
|
+
const openTeamDrawer = React.useCallback(() => {
|
|
409
|
+
router.replace(`${pathname}?panel=team`);
|
|
410
|
+
}, [pathname, router]);
|
|
411
|
+
const handleTeamDrawerOpenChange = React.useCallback((next) => {
|
|
412
|
+
if (next) openTeamDrawer();
|
|
413
|
+
else router.replace(pathname ?? BACK_HREF);
|
|
414
|
+
}, [openTeamDrawer, pathname, router]);
|
|
415
|
+
const handleTeamSaved = React.useCallback(() => {
|
|
416
|
+
setReloadToken((token) => token + 1);
|
|
417
|
+
}, []);
|
|
418
|
+
const handleAddDialogKeyDown = React.useCallback((event) => {
|
|
419
|
+
if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
|
|
420
|
+
event.preventDefault();
|
|
421
|
+
void handleAddEmployee();
|
|
422
|
+
}
|
|
423
|
+
}, [handleAddEmployee]);
|
|
424
|
+
if (loading) {
|
|
425
|
+
return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsx(LoadingMessage, { label: t("staff.timesheets.projects.loading", "Loading project...") }) }) });
|
|
426
|
+
}
|
|
427
|
+
if (accessDenied) {
|
|
428
|
+
return /* @__PURE__ */ jsx(NoProjectAccess, { timeProjectId: projectId });
|
|
429
|
+
}
|
|
430
|
+
if (isNotFound) {
|
|
431
|
+
return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsx(
|
|
432
|
+
RecordNotFoundState,
|
|
433
|
+
{
|
|
434
|
+
label: t("staff.timesheets.projects.errors.notFound", "Project not found."),
|
|
435
|
+
backHref: BACK_HREF,
|
|
436
|
+
backLabel: t("staff.timesheets.projects.actions.backToList", "Back to projects")
|
|
437
|
+
}
|
|
438
|
+
) }) });
|
|
439
|
+
}
|
|
440
|
+
if (error || !project) {
|
|
441
|
+
return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsx(ErrorMessage, { label: error ?? t("staff.timesheets.projects.errors.load", "Failed to load project.") }) }) });
|
|
442
|
+
}
|
|
443
|
+
const projectStatus = project.status ?? "active";
|
|
444
|
+
const projectType = project.projectType ?? project.project_type ?? null;
|
|
445
|
+
const projectStartDate = project.startDate ?? project.start_date ?? null;
|
|
446
|
+
const projectCode = project.code;
|
|
447
|
+
const readString = (...keys) => {
|
|
448
|
+
for (const key of keys) {
|
|
449
|
+
const raw = project[key];
|
|
450
|
+
if (typeof raw === "string" && raw.trim().length > 0) return raw.trim();
|
|
451
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
|
|
452
|
+
}
|
|
453
|
+
return null;
|
|
454
|
+
};
|
|
455
|
+
const readNumber = (...keys) => {
|
|
456
|
+
for (const key of keys) {
|
|
457
|
+
const raw = project[key];
|
|
458
|
+
const parsed = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw) : NaN;
|
|
459
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
460
|
+
}
|
|
461
|
+
return null;
|
|
462
|
+
};
|
|
463
|
+
const readBool = (...keys) => {
|
|
464
|
+
for (const key of keys) {
|
|
465
|
+
const raw = project[key];
|
|
466
|
+
if (typeof raw === "boolean") return raw;
|
|
467
|
+
}
|
|
468
|
+
return null;
|
|
469
|
+
};
|
|
470
|
+
const enrichment = project._staff ?? {};
|
|
471
|
+
const readEnriched = (key) => {
|
|
472
|
+
const raw = enrichment[key];
|
|
473
|
+
return typeof raw === "number" && Number.isFinite(raw) ? raw : null;
|
|
474
|
+
};
|
|
475
|
+
const customerSnapshot = project.customerSnapshot ?? project.customer_snapshot;
|
|
476
|
+
const customerName = (typeof customerSnapshot?.name === "string" ? customerSnapshot.name : null) ?? (typeof enrichment.customerName === "string" ? enrichment.customerName : null);
|
|
477
|
+
const customerId = readString("customerId", "customer_id");
|
|
478
|
+
const projectColor = readString("color");
|
|
479
|
+
const costCenter = readString("costCenter", "cost_center");
|
|
480
|
+
const currencyCode = readString("currencyCode", "currency_code");
|
|
481
|
+
const hourlyRate = readNumber("hourlyRate", "hourly_rate");
|
|
482
|
+
const billableByDefault = readBool("billableByDefault", "billable_by_default");
|
|
483
|
+
const createdAt = readString("createdAt", "created_at");
|
|
484
|
+
const updatedAt = readString("updatedAt", "updated_at");
|
|
485
|
+
const entryCount = readNumber("entryCount");
|
|
486
|
+
const currencyLocked = readBool("currencyLocked") ?? false;
|
|
487
|
+
const lockedEntryCount = readNumber("lockedEntryCount");
|
|
488
|
+
const totalMinutes = readEnriched("totalMinutes") ?? 0;
|
|
489
|
+
const billableMinutes = readEnriched("billableMinutes");
|
|
490
|
+
const cost = readEnriched("cost");
|
|
491
|
+
const nonBillableMinutes = billableMinutes === null ? null : Math.max(0, totalMinutes - billableMinutes);
|
|
492
|
+
const billablePercent = billableMinutes === null || totalMinutes <= 0 ? null : Math.round(billableMinutes / totalMinutes * 100);
|
|
493
|
+
const hoursTrend = Array.isArray(enrichment.hoursTrend) ? enrichment.hoursTrend.filter((value) => typeof value === "number") : [];
|
|
494
|
+
const budgetKind = readString("budgetKind", "budget_kind");
|
|
495
|
+
const budgetValue = readNumber("budgetValue", "budget_value");
|
|
496
|
+
const budgetWarnAt = readNumber("budgetWarnAtPercent", "budget_warn_at_percent");
|
|
497
|
+
const budgetBurn = computeBudgetBurn({
|
|
498
|
+
kind: budgetKind,
|
|
499
|
+
budgetValue,
|
|
500
|
+
warnAtPercent: budgetWarnAt,
|
|
501
|
+
totalMinutes,
|
|
502
|
+
cost
|
|
503
|
+
});
|
|
504
|
+
const formatHours = (minutes) => {
|
|
505
|
+
if (minutes === null) return "\u2014";
|
|
506
|
+
const sign = minutes < 0 ? "-" : "";
|
|
507
|
+
const abs = Math.abs(minutes);
|
|
508
|
+
return `${sign}${Math.floor(abs / 60)}:${String(abs % 60).padStart(2, "0")}`;
|
|
509
|
+
};
|
|
510
|
+
const formatDateTime = (value) => {
|
|
511
|
+
if (!value) return "\u2014";
|
|
512
|
+
const normalized = value.replace(" ", "T").replace(/(T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)([+-]\d{2})$/, "$1$2:00");
|
|
513
|
+
const parsed = new Date(normalized);
|
|
514
|
+
return Number.isNaN(parsed.getTime()) ? value : parsed.toLocaleDateString();
|
|
515
|
+
};
|
|
516
|
+
const budgetUsageLabel = budgetBurn ? budgetBurn.kind === "hours" ? t("staff.timesheets.projects.detail.budgetHours", "{percent}% of {value} h", {
|
|
517
|
+
percent: budgetBurn.percent,
|
|
518
|
+
value: budgetBurn.budgetValue
|
|
519
|
+
}) : t("staff.timesheets.projects.detail.budgetAmount", "{percent}% of {value}", {
|
|
520
|
+
percent: budgetBurn.percent,
|
|
521
|
+
value: formatCurrency(budgetBurn.budgetValue, currencyCode ?? void 0) ?? String(budgetBurn.budgetValue)
|
|
522
|
+
}) : null;
|
|
523
|
+
const injectedTabs = injectedTabWidgets.filter((widget) => (widget.placement?.kind ?? "tab") === "tab").map((widget) => {
|
|
524
|
+
const tabId = widget.placement?.groupId ?? widget.widgetId;
|
|
525
|
+
const groupLabel = widget.placement?.groupLabel;
|
|
526
|
+
const label = groupLabel ? t(groupLabel, groupLabel) : widget.module.metadata.title ?? tabId;
|
|
527
|
+
const priority = typeof widget.placement?.priority === "number" ? widget.placement.priority : 0;
|
|
528
|
+
return { tabId, label, priority, Widget: widget.module.Widget };
|
|
529
|
+
}).sort((left, right) => right.priority - left.priority);
|
|
530
|
+
return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsxs(PageBody, { children: [
|
|
531
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
532
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start justify-between gap-4", children: [
|
|
533
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-start gap-3", children: [
|
|
534
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", asChild: true, children: /* @__PURE__ */ jsx(Link, { href: BACK_HREF, children: /* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4", "aria-hidden": true }) }) }),
|
|
535
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
|
|
536
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
537
|
+
/* @__PURE__ */ jsx(
|
|
538
|
+
"span",
|
|
539
|
+
{
|
|
540
|
+
className: "size-3 shrink-0 rounded-sm border border-border",
|
|
541
|
+
style: { backgroundColor: resolveProjectColorHex(projectColor, project.name) },
|
|
542
|
+
"aria-hidden": true
|
|
543
|
+
}
|
|
544
|
+
),
|
|
545
|
+
/* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold", children: project.name }),
|
|
546
|
+
/* @__PURE__ */ jsx(
|
|
547
|
+
Badge,
|
|
548
|
+
{
|
|
549
|
+
variant: projectStatus === "active" ? "success" : projectStatus === "on_hold" ? "warning" : "neutral",
|
|
550
|
+
className: "capitalize",
|
|
551
|
+
children: projectStatus
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
canSeeMoney && budgetBurn && budgetBurn.tone !== "accent" ? /* @__PURE__ */ jsx(Badge, { variant: budgetBurn.tone === "destructive" ? "destructive" : "warning", children: t("staff.timesheets.projects.detail.budgetBadge", "Budget {percent}%", {
|
|
555
|
+
percent: budgetBurn.percent
|
|
556
|
+
}) }) : null,
|
|
557
|
+
/* @__PURE__ */ jsx(
|
|
558
|
+
InjectionSpot,
|
|
559
|
+
{
|
|
560
|
+
spotId: extensionPoints.hosts.projectDetailStatusBadges.spotId,
|
|
561
|
+
context: projectInjectionContext,
|
|
562
|
+
data: project
|
|
563
|
+
}
|
|
564
|
+
)
|
|
565
|
+
] }),
|
|
566
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm text-muted-foreground", children: [
|
|
567
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-sm border border-border bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground", children: projectCode }),
|
|
568
|
+
customerName ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
569
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7" }),
|
|
570
|
+
customerId ? /* @__PURE__ */ jsx(Link, { className: "underline underline-offset-2", href: `/backend/customers/companies/${customerId}`, children: customerName }) : /* @__PURE__ */ jsx("span", { children: customerName })
|
|
571
|
+
] }) : null,
|
|
572
|
+
projectType ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
573
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7" }),
|
|
574
|
+
/* @__PURE__ */ jsx("span", { children: projectType })
|
|
575
|
+
] }) : null,
|
|
576
|
+
projectStartDate ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
577
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7" }),
|
|
578
|
+
/* @__PURE__ */ jsx("span", { children: t("staff.timesheets.projects.detail.startedOn", "Started {date}", {
|
|
579
|
+
date: formatDateTime(projectStartDate)
|
|
580
|
+
}) })
|
|
581
|
+
] }) : null
|
|
582
|
+
] })
|
|
583
|
+
] })
|
|
584
|
+
] }),
|
|
585
|
+
canManageProjects && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
586
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: openTeamDrawer, children: [
|
|
587
|
+
/* @__PURE__ */ jsx(Users, { className: "mr-2 h-4 w-4", "aria-hidden": true }),
|
|
588
|
+
t("staff.time_tracking.projects.team.manage", "Manage team")
|
|
589
|
+
] }),
|
|
590
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsxs(Link, { href: `/backend/staff/time-tracking/projects/${projectId}/edit`, children: [
|
|
591
|
+
/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-4 w-4", "aria-hidden": true }),
|
|
592
|
+
t("staff.timesheets.projects.form.actions.edit", "Edit Project")
|
|
593
|
+
] }) })
|
|
594
|
+
] }),
|
|
595
|
+
/* @__PURE__ */ jsx(
|
|
596
|
+
InjectionSpot,
|
|
597
|
+
{
|
|
598
|
+
spotId: extensionPoints.hosts.projectDetailHeader.spotId,
|
|
599
|
+
context: projectInjectionContext,
|
|
600
|
+
data: project
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
] }),
|
|
604
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-4", children: [
|
|
605
|
+
/* @__PURE__ */ jsx(
|
|
606
|
+
KpiCard,
|
|
607
|
+
{
|
|
608
|
+
title: t("staff.timesheets.projects.detail.loggedHours", "Logged hours"),
|
|
609
|
+
value: totalMinutes / 60,
|
|
610
|
+
formatValue: () => formatHours(totalMinutes),
|
|
611
|
+
footer: hoursTrend.length > 0 ? /* @__PURE__ */ jsx(
|
|
612
|
+
Sparkline,
|
|
613
|
+
{
|
|
614
|
+
values: hoursTrend,
|
|
615
|
+
ariaLabel: t("staff.timesheets.projects.detail.trendAria", "Hours per week, last 7 weeks")
|
|
616
|
+
}
|
|
617
|
+
) : void 0,
|
|
618
|
+
headerAction: entryCount !== null ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: entryCount === 1 ? t("staff.timesheets.projects.detail.entryCountOne", "1 entry") : t("staff.timesheets.projects.detail.entryCountShort", "{count} entries", { count: entryCount }) }) : void 0
|
|
619
|
+
}
|
|
620
|
+
),
|
|
621
|
+
/* @__PURE__ */ jsx(
|
|
622
|
+
KpiCard,
|
|
623
|
+
{
|
|
624
|
+
title: t("staff.timesheets.projects.detail.billableHours", "Billable hours"),
|
|
625
|
+
value: (billableMinutes ?? 0) / 60,
|
|
626
|
+
formatValue: () => formatHours(billableMinutes),
|
|
627
|
+
headerAction: billablePercent !== null ? /* @__PURE__ */ jsx(Badge, { variant: billablePercent >= 80 ? "success" : "neutral", children: `${billablePercent}%` }) : void 0,
|
|
628
|
+
footer: nonBillableMinutes !== null ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("staff.timesheets.projects.detail.nonBillable", "{hours} non-billable", {
|
|
629
|
+
hours: formatHours(nonBillableMinutes)
|
|
630
|
+
}) }) : void 0
|
|
631
|
+
}
|
|
632
|
+
),
|
|
633
|
+
canSeeMoney ? /* @__PURE__ */ jsx(
|
|
634
|
+
KpiCard,
|
|
635
|
+
{
|
|
636
|
+
title: t("staff.timesheets.projects.detail.cost", "Cost to date"),
|
|
637
|
+
value: cost,
|
|
638
|
+
formatValue: (value) => formatCurrency(value, currencyCode ?? void 0) ?? String(value),
|
|
639
|
+
footer: hourlyRate !== null ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("staff.timesheets.projects.detail.costBasis", "{hours} \xD7 {rate}", {
|
|
640
|
+
hours: formatHours(billableMinutes),
|
|
641
|
+
rate: `${formatCurrency(hourlyRate, currencyCode ?? void 0) ?? hourlyRate}/h`
|
|
642
|
+
}) }) : void 0
|
|
643
|
+
}
|
|
644
|
+
) : null,
|
|
645
|
+
canSeeMoney ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
646
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
647
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-muted-foreground", children: t("staff.timesheets.projects.form.budget", "Budget") }),
|
|
648
|
+
budgetBurn ? /* @__PURE__ */ jsx(
|
|
649
|
+
Badge,
|
|
650
|
+
{
|
|
651
|
+
variant: budgetBurn.tone === "destructive" ? "destructive" : budgetBurn.tone === "warning" ? "warning" : "neutral",
|
|
652
|
+
children: `${budgetBurn.percent}%`
|
|
653
|
+
}
|
|
654
|
+
) : /* @__PURE__ */ jsx(Badge, { variant: "neutral", children: t("staff.timesheets.projects.detail.noBudget", "No budget") })
|
|
655
|
+
] }),
|
|
656
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 space-y-2", children: [
|
|
657
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xl font-semibold tabular-nums", children: budgetBurn ? `${budgetBurn.percent}%` : "\u2014" }),
|
|
658
|
+
/* @__PURE__ */ jsx(
|
|
659
|
+
ProjectBudgetCell,
|
|
660
|
+
{
|
|
661
|
+
burn: budgetBurn,
|
|
662
|
+
usageLabel: budgetUsageLabel,
|
|
663
|
+
noBudgetLabel: t("staff.timesheets.projects.detail.budgetHint", "Set one to track burn"),
|
|
664
|
+
ariaLabel: t("staff.timesheets.projects.detail.budgetUsage", "Budget usage")
|
|
665
|
+
}
|
|
666
|
+
)
|
|
667
|
+
] })
|
|
668
|
+
] }) : null
|
|
669
|
+
] }),
|
|
670
|
+
/* @__PURE__ */ jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]", children: [
|
|
671
|
+
/* @__PURE__ */ jsxs(
|
|
672
|
+
Tabs,
|
|
673
|
+
{
|
|
674
|
+
value: activeTab,
|
|
675
|
+
onValueChange: setActiveTab,
|
|
676
|
+
variant: "underline",
|
|
677
|
+
className: "min-w-0",
|
|
678
|
+
children: [
|
|
679
|
+
/* @__PURE__ */ jsxs(TabsList, { "aria-label": t("staff.timesheets.projects.detail.tabs", "Project sections"), children: [
|
|
680
|
+
/* @__PURE__ */ jsx(TabsTrigger, { value: "team", count: activeCount, children: t("staff.timesheets.projects.detail.tabTeam", "Team") }),
|
|
681
|
+
/* @__PURE__ */ jsx(TabsTrigger, { value: "time", count: entryCount ?? void 0, children: t("staff.timesheets.projects.detail.tabTime", "Time") }),
|
|
682
|
+
/* @__PURE__ */ jsx(TabsTrigger, { value: "tasks", children: t("staff.timesheets.projects.detail.tabTasks", "Tasks") }),
|
|
683
|
+
injectedTabs.map((tab) => /* @__PURE__ */ jsx(TabsTrigger, { value: tab.tabId, children: tab.label }, tab.tabId))
|
|
684
|
+
] }),
|
|
685
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "team", children: /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
686
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
687
|
+
/* @__PURE__ */ jsx("h2", { className: "sr-only", children: t("staff.timesheets.projects.employees.title", "Assigned Employees") }),
|
|
688
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
689
|
+
canManageProjects && /* @__PURE__ */ jsxs(Button, { size: "sm", onClick: openAddDialog, children: [
|
|
690
|
+
/* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4", "aria-hidden": true }),
|
|
691
|
+
t("staff.timesheets.projects.add_employee", "Add Employee")
|
|
692
|
+
] })
|
|
693
|
+
] }),
|
|
694
|
+
employeesLoading ? /* @__PURE__ */ jsx(LoadingMessage, { label: t("staff.timesheets.projects.employees.loading", "Loading employees...") }) : employees.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed p-8 text-center", children: [
|
|
695
|
+
/* @__PURE__ */ jsx(User, { className: "mx-auto h-8 w-8 text-muted-foreground/50", "aria-hidden": true }),
|
|
696
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: t("staff.timesheets.projects.employees.empty", "No employees assigned yet.") })
|
|
697
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "space-y-2", children: employees.map((emp) => {
|
|
698
|
+
const isExpanded = expandedCards.has(emp.id);
|
|
699
|
+
const isInactive = emp.status !== "active";
|
|
700
|
+
return /* @__PURE__ */ jsxs(
|
|
701
|
+
"div",
|
|
702
|
+
{
|
|
703
|
+
className: `rounded-lg border ${isInactive ? "opacity-60" : ""}`,
|
|
704
|
+
children: [
|
|
705
|
+
/* @__PURE__ */ jsxs(
|
|
706
|
+
"button",
|
|
707
|
+
{
|
|
708
|
+
type: "button",
|
|
709
|
+
className: "flex w-full items-center justify-between p-4 text-left hover:bg-muted/50 transition-colors",
|
|
710
|
+
onClick: () => toggleCard(emp.id),
|
|
711
|
+
children: [
|
|
712
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
713
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ jsx(User, { className: "h-4 w-4 text-muted-foreground", "aria-hidden": true }) }),
|
|
714
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
715
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: emp.displayName ?? emp.staffMemberId }),
|
|
716
|
+
emp.role ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: emp.role }) : null
|
|
717
|
+
] })
|
|
718
|
+
] }),
|
|
719
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 shrink-0", children: [
|
|
720
|
+
/* @__PURE__ */ jsx(
|
|
721
|
+
Badge,
|
|
722
|
+
{
|
|
723
|
+
variant: (emp.status ?? "active") === "active" ? "success" : "neutral",
|
|
724
|
+
className: "capitalize",
|
|
725
|
+
children: emp.status ?? "active"
|
|
726
|
+
}
|
|
727
|
+
),
|
|
728
|
+
emp.assignedStartDate ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground hidden sm:inline", children: emp.assignedStartDate }) : null,
|
|
729
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: `h-4 w-4 text-muted-foreground transition-transform ${isExpanded ? "rotate-180" : ""}`, "aria-hidden": true })
|
|
730
|
+
] })
|
|
731
|
+
]
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
isExpanded ? /* @__PURE__ */ jsxs("div", { className: "border-t px-4 pb-4 pt-3 space-y-3", children: [
|
|
735
|
+
/* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-2 gap-3 text-sm", children: [
|
|
736
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
737
|
+
/* @__PURE__ */ jsx("dt", { className: "font-medium text-muted-foreground", children: t("staff.timesheets.projects.employees.role", "Role") }),
|
|
738
|
+
/* @__PURE__ */ jsx("dd", { children: emp.role || "-" })
|
|
739
|
+
] }),
|
|
740
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
741
|
+
/* @__PURE__ */ jsx("dt", { className: "font-medium text-muted-foreground", children: t("staff.timesheets.projects.employees.status", "Status") }),
|
|
742
|
+
/* @__PURE__ */ jsx("dd", { className: "capitalize", children: emp.status ?? "active" })
|
|
743
|
+
] }),
|
|
744
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
745
|
+
/* @__PURE__ */ jsx("dt", { className: "font-medium text-muted-foreground", children: t("staff.timesheets.projects.employees.startDate", "Assignment start") }),
|
|
746
|
+
/* @__PURE__ */ jsx("dd", { children: emp.assignedStartDate || "-" })
|
|
747
|
+
] }),
|
|
748
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
749
|
+
/* @__PURE__ */ jsx("dt", { className: "font-medium text-muted-foreground", children: t("staff.timesheets.projects.employees.endDate", "Assignment end") }),
|
|
750
|
+
/* @__PURE__ */ jsx("dd", { children: emp.assignedEndDate || "-" })
|
|
751
|
+
] }),
|
|
752
|
+
emp.teamName ? /* @__PURE__ */ jsxs("div", { children: [
|
|
753
|
+
/* @__PURE__ */ jsx("dt", { className: "font-medium text-muted-foreground", children: t("staff.timesheets.projects.employees.department", "Department") }),
|
|
754
|
+
/* @__PURE__ */ jsx("dd", { children: emp.teamName })
|
|
755
|
+
] }) : null
|
|
756
|
+
] }),
|
|
757
|
+
canManageProjects && /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs(
|
|
758
|
+
Button,
|
|
759
|
+
{
|
|
760
|
+
variant: "outline",
|
|
761
|
+
size: "sm",
|
|
762
|
+
className: "text-destructive hover:text-destructive",
|
|
763
|
+
onClick: () => {
|
|
764
|
+
void handleRemoveEmployee(emp);
|
|
765
|
+
},
|
|
766
|
+
children: [
|
|
767
|
+
/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-3.5 w-3.5", "aria-hidden": true }),
|
|
768
|
+
t("staff.timesheets.projects.employees.remove", "Remove")
|
|
769
|
+
]
|
|
770
|
+
}
|
|
771
|
+
) })
|
|
772
|
+
] }) : null
|
|
773
|
+
]
|
|
774
|
+
},
|
|
775
|
+
emp.id
|
|
776
|
+
);
|
|
777
|
+
}) })
|
|
778
|
+
] }) }),
|
|
779
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "time", children: recentEntriesLoading ? /* @__PURE__ */ jsx(LoadingMessage, { label: t("staff.timesheets.projects.detail.loadingTime", "Loading time entries\u2026") }) : recentEntries.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed p-8 text-center", children: [
|
|
780
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: t("staff.timesheets.projects.detail.noTime", "No time logged yet") }),
|
|
781
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: t("staff.timesheets.projects.detail.noTimeHint", "Hours logged against this project appear here.") })
|
|
782
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-x-auto rounded-lg border", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
|
|
783
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b bg-muted/40 text-left", children: [
|
|
784
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 font-medium text-muted-foreground", children: t("staff.timesheets.projects.detail.colDate", "Date") }),
|
|
785
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 font-medium text-muted-foreground", children: t("staff.timesheets.projects.detail.colWho", "Person") }),
|
|
786
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 font-medium text-muted-foreground", children: t("staff.timesheets.projects.detail.colDescription", "Description") }),
|
|
787
|
+
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-right font-medium text-muted-foreground", children: t("staff.timesheets.projects.detail.colHours", "Hours") })
|
|
788
|
+
] }) }),
|
|
789
|
+
/* @__PURE__ */ jsx("tbody", { children: recentEntries.map((entry) => /* @__PURE__ */ jsxs("tr", { className: "border-b last:border-b-0", children: [
|
|
790
|
+
/* @__PURE__ */ jsx("td", { className: "whitespace-nowrap px-3 py-2", children: entry.date }),
|
|
791
|
+
/* @__PURE__ */ jsx("td", { className: "whitespace-nowrap px-3 py-2", children: employeeNameById.get(entry.staffMemberId ?? "") ?? "\u2014" }),
|
|
792
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
793
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: entry.description ?? "\u2014" }),
|
|
794
|
+
entry.isBillable ? null : /* @__PURE__ */ jsx(Badge, { variant: "neutral", children: t("staff.timesheets.projects.detail.nonBillableTag", "non-billable") })
|
|
795
|
+
] }) }),
|
|
796
|
+
/* @__PURE__ */ jsx("td", { className: "whitespace-nowrap px-3 py-2 text-right font-mono tabular-nums", children: formatHours(entry.durationMinutes) })
|
|
797
|
+
] }, entry.id)) })
|
|
798
|
+
] }) }) }),
|
|
799
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "tasks", children: projectTasksLoading ? /* @__PURE__ */ jsx(LoadingMessage, { label: t("staff.timesheets.projects.detail.loadingTasks", "Loading tasks\u2026") }) : projectTasks.length === 0 ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-dashed p-8 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: t("staff.timesheets.projects.detail.noTasks", "No tasks yet") }) }) : /* @__PURE__ */ jsx("div", { className: "divide-y rounded-lg border", children: projectTasks.map((task) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-3 py-2 text-sm", children: [
|
|
800
|
+
task.reference ? /* @__PURE__ */ jsx("span", { className: "shrink-0 rounded-sm border border-border bg-muted px-1.5 py-0.5 font-mono text-xs", children: task.reference }) : null,
|
|
801
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: task.title }),
|
|
802
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: employeeNameById.get(task.assigneeStaffMemberId ?? "") ?? "" }),
|
|
803
|
+
task.loggedMinutes !== null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground", children: formatHours(task.loggedMinutes) }) : null
|
|
804
|
+
] }, task.id)) }) }),
|
|
805
|
+
injectedTabs.map((tab) => /* @__PURE__ */ jsx(TabsContent, { value: tab.tabId, children: /* @__PURE__ */ jsx(tab.Widget, { context: projectInjectionContext, data: project }) }, tab.tabId))
|
|
806
|
+
]
|
|
807
|
+
}
|
|
808
|
+
),
|
|
809
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card", children: [
|
|
810
|
+
/* @__PURE__ */ jsx("div", { className: "border-b px-4 py-3", children: /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold", children: t("staff.timesheets.projects.detail.details", "Details") }) }),
|
|
811
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 py-3", children: [
|
|
812
|
+
canSeeMoney ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
813
|
+
/* @__PURE__ */ jsx(RailGroup, { label: t("staff.timesheets.projects.detail.commercials", "Billing"), first: true }),
|
|
814
|
+
/* @__PURE__ */ jsxs("dl", { children: [
|
|
815
|
+
/* @__PURE__ */ jsx(
|
|
816
|
+
RailFact,
|
|
817
|
+
{
|
|
818
|
+
label: t("staff.timesheets.projects.form.hourlyRate", "Hourly rate"),
|
|
819
|
+
value: hourlyRate === null ? "\u2014" : `${formatCurrency(hourlyRate, currencyCode ?? void 0) ?? hourlyRate} / h`
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
/* @__PURE__ */ jsx(
|
|
823
|
+
RailFact,
|
|
824
|
+
{
|
|
825
|
+
label: t("staff.timesheets.projects.form.currency", "Currency"),
|
|
826
|
+
value: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
827
|
+
currencyCode ?? "\u2014",
|
|
828
|
+
currencyLocked ? /* @__PURE__ */ jsx(
|
|
829
|
+
Badge,
|
|
830
|
+
{
|
|
831
|
+
variant: "neutral",
|
|
832
|
+
title: t(
|
|
833
|
+
"staff.timesheets.projects.detail.currencyLockedHint",
|
|
834
|
+
"Locked because hours are already logged against this project."
|
|
835
|
+
),
|
|
836
|
+
children: t("staff.timesheets.projects.detail.locked", "locked")
|
|
837
|
+
}
|
|
838
|
+
) : null
|
|
839
|
+
] })
|
|
840
|
+
}
|
|
841
|
+
),
|
|
842
|
+
/* @__PURE__ */ jsx(
|
|
843
|
+
RailFact,
|
|
844
|
+
{
|
|
845
|
+
label: t("staff.timesheets.projects.form.billableByDefault", "Billable by default"),
|
|
846
|
+
value: billableByDefault === null ? "\u2014" : /* @__PURE__ */ jsx(Badge, { variant: billableByDefault ? "success" : "neutral", children: billableByDefault ? t("staff.timesheets.projects.detail.yes", "Yes") : t("staff.timesheets.projects.detail.no", "No") })
|
|
847
|
+
}
|
|
848
|
+
)
|
|
849
|
+
] })
|
|
850
|
+
] }) : null,
|
|
851
|
+
/* @__PURE__ */ jsx(
|
|
852
|
+
RailGroup,
|
|
853
|
+
{
|
|
854
|
+
label: t("staff.timesheets.projects.detail.delivery", "Delivery"),
|
|
855
|
+
first: !canSeeMoney
|
|
856
|
+
}
|
|
857
|
+
),
|
|
858
|
+
/* @__PURE__ */ jsxs("dl", { children: [
|
|
859
|
+
/* @__PURE__ */ jsx(
|
|
860
|
+
RailFact,
|
|
861
|
+
{
|
|
862
|
+
label: t("staff.timesheets.projects.detail.entryCount", "Time entries"),
|
|
863
|
+
value: entryCount ?? "\u2014"
|
|
864
|
+
}
|
|
865
|
+
),
|
|
866
|
+
/* @__PURE__ */ jsx(
|
|
867
|
+
RailFact,
|
|
868
|
+
{
|
|
869
|
+
label: t("staff.timesheets.projects.detail.lockedEntries", "Locked in reports"),
|
|
870
|
+
value: lockedEntryCount ?? "\u2014"
|
|
871
|
+
}
|
|
872
|
+
)
|
|
873
|
+
] }),
|
|
874
|
+
/* @__PURE__ */ jsx(RailGroup, { label: t("staff.timesheets.projects.detail.administration", "Administration") }),
|
|
875
|
+
/* @__PURE__ */ jsxs("dl", { children: [
|
|
876
|
+
/* @__PURE__ */ jsx(
|
|
877
|
+
RailFact,
|
|
878
|
+
{
|
|
879
|
+
label: t("staff.timesheets.projects.form.costCenter", "Cost center"),
|
|
880
|
+
value: costCenter ?? "\u2014"
|
|
881
|
+
}
|
|
882
|
+
),
|
|
883
|
+
/* @__PURE__ */ jsx(
|
|
884
|
+
RailFact,
|
|
885
|
+
{
|
|
886
|
+
label: t("staff.timesheets.projects.form.color", "Project color"),
|
|
887
|
+
value: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 capitalize", children: [
|
|
888
|
+
/* @__PURE__ */ jsx(
|
|
889
|
+
"span",
|
|
890
|
+
{
|
|
891
|
+
className: "size-2.5 rounded-full border border-border",
|
|
892
|
+
style: { backgroundColor: resolveProjectColorHex(projectColor, project.name) },
|
|
893
|
+
"aria-hidden": true
|
|
894
|
+
}
|
|
895
|
+
),
|
|
896
|
+
projectColor ?? t("staff.timesheets.projects.detail.autoColor", "Auto")
|
|
897
|
+
] })
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
/* @__PURE__ */ jsx(
|
|
901
|
+
RailFact,
|
|
902
|
+
{
|
|
903
|
+
label: t("staff.timesheets.projects.detail.createdAt", "Created"),
|
|
904
|
+
value: formatDateTime(createdAt)
|
|
905
|
+
}
|
|
906
|
+
),
|
|
907
|
+
/* @__PURE__ */ jsx(
|
|
908
|
+
RailFact,
|
|
909
|
+
{
|
|
910
|
+
label: t("staff.timesheets.projects.detail.updatedAt", "Last updated"),
|
|
911
|
+
value: formatDateTime(updatedAt)
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
] }),
|
|
915
|
+
project.description ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
916
|
+
/* @__PURE__ */ jsx(RailGroup, { label: t("staff.timesheets.projects.form.description", "Description") }),
|
|
917
|
+
/* @__PURE__ */ jsx("p", { className: "whitespace-pre-wrap pt-2 text-sm text-muted-foreground", children: project.description })
|
|
918
|
+
] }) : null,
|
|
919
|
+
/* @__PURE__ */ jsx(
|
|
920
|
+
InjectionSpot,
|
|
921
|
+
{
|
|
922
|
+
spotId: extensionPoints.hosts.projectDetailSidebar.spotId,
|
|
923
|
+
context: projectInjectionContext,
|
|
924
|
+
data: project
|
|
925
|
+
}
|
|
926
|
+
)
|
|
927
|
+
] })
|
|
928
|
+
] })
|
|
929
|
+
] }),
|
|
930
|
+
/* @__PURE__ */ jsx(
|
|
931
|
+
InjectionSpot,
|
|
932
|
+
{
|
|
933
|
+
spotId: extensionPoints.hosts.projectDetailFooter.spotId,
|
|
934
|
+
context: projectInjectionContext,
|
|
935
|
+
data: project
|
|
936
|
+
}
|
|
937
|
+
)
|
|
938
|
+
] }),
|
|
939
|
+
ConfirmDialogElement,
|
|
940
|
+
projectId && teamDrawerOpen ? /* @__PURE__ */ jsx(
|
|
941
|
+
ProjectTeamDrawer,
|
|
942
|
+
{
|
|
943
|
+
projectId,
|
|
944
|
+
projectName: project.name,
|
|
945
|
+
open: teamDrawerOpen,
|
|
946
|
+
onOpenChange: handleTeamDrawerOpenChange,
|
|
947
|
+
preselectUserId: requesterUserId,
|
|
948
|
+
onSaved: handleTeamSaved
|
|
949
|
+
}
|
|
950
|
+
) : null,
|
|
951
|
+
/* @__PURE__ */ jsx(Dialog, { open: addDialogOpen, onOpenChange: setAddDialogOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", onKeyDown: handleAddDialogKeyDown, children: [
|
|
952
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("staff.timesheets.projects.add_employee", "Add Employee") }) }),
|
|
953
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
954
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
955
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: t("staff.timesheets.projects.employees.selectEmployee", "Select Employee") }),
|
|
956
|
+
/* @__PURE__ */ jsx(
|
|
957
|
+
LookupSelect,
|
|
958
|
+
{
|
|
959
|
+
value: addStaffMemberId,
|
|
960
|
+
onChange: setAddStaffMemberId,
|
|
961
|
+
fetchItems: fetchStaffMembers,
|
|
962
|
+
searchPlaceholder: t("staff.timesheets.projects.employees.searchEmployee", "Search team members..."),
|
|
963
|
+
emptyLabel: t("staff.timesheets.projects.employees.noResults", "No team members found")
|
|
964
|
+
}
|
|
965
|
+
),
|
|
966
|
+
staffLookupError ? /* @__PURE__ */ jsx("p", { className: "text-xs text-status-error-text", role: "alert", children: staffLookupError }) : null
|
|
967
|
+
] }),
|
|
968
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
969
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: "add-role", children: t("staff.timesheets.projects.employees.roleOnProject", "Role on Project") }),
|
|
970
|
+
/* @__PURE__ */ jsx(
|
|
971
|
+
Input,
|
|
972
|
+
{
|
|
973
|
+
id: "add-role",
|
|
974
|
+
value: addRole,
|
|
975
|
+
onChange: (event) => setAddRole(event.target.value),
|
|
976
|
+
placeholder: t("staff.timesheets.projects.employees.rolePlaceholder", "e.g. Developer, Designer...")
|
|
977
|
+
}
|
|
978
|
+
)
|
|
979
|
+
] }),
|
|
980
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
981
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: "add-start-date", children: t("staff.timesheets.projects.employees.assignmentStartDate", "Assignment Start Date") }),
|
|
982
|
+
/* @__PURE__ */ jsx(
|
|
983
|
+
Input,
|
|
984
|
+
{
|
|
985
|
+
id: "add-start-date",
|
|
986
|
+
type: "date",
|
|
987
|
+
value: addStartDate,
|
|
988
|
+
onChange: (event) => setAddStartDate(event.target.value)
|
|
989
|
+
}
|
|
990
|
+
)
|
|
991
|
+
] }),
|
|
992
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
993
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => setAddDialogOpen(false), children: t("staff.timesheets.projects.form.actions.cancel", "Cancel") }),
|
|
994
|
+
/* @__PURE__ */ jsxs(
|
|
995
|
+
Button,
|
|
996
|
+
{
|
|
997
|
+
size: "sm",
|
|
998
|
+
disabled: addSaving || !addStaffMemberId || !addStartDate,
|
|
999
|
+
onClick: handleAddEmployee,
|
|
1000
|
+
children: [
|
|
1001
|
+
addSaving ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : null,
|
|
1002
|
+
t("staff.timesheets.projects.add_employee", "Add Employee")
|
|
1003
|
+
]
|
|
1004
|
+
}
|
|
1005
|
+
)
|
|
1006
|
+
] })
|
|
1007
|
+
] })
|
|
1008
|
+
] }) })
|
|
1009
|
+
] }) });
|
|
1010
|
+
}
|
|
1011
|
+
export {
|
|
1012
|
+
TimesheetProjectDetailPage as default
|
|
1013
|
+
};
|
|
1014
|
+
//# sourceMappingURL=page.js.map
|