@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,95 @@
|
|
|
1
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
2
|
+
import { resolveNotificationService } from '../../notifications/lib/notificationService'
|
|
3
|
+
import { buildFeatureNotificationFromType } from '../../notifications/lib/notificationBuilder'
|
|
4
|
+
import { notificationTypes } from '../notifications'
|
|
5
|
+
import { MANAGE_PROJECTS_FEATURE } from '../lib/time-tracking/access'
|
|
6
|
+
|
|
7
|
+
const logger = createLogger('staff').child({ component: 'subscribers/time-project-access-requested' })
|
|
8
|
+
|
|
9
|
+
const NOTIFICATION_TYPE = 'staff.timesheets.project_access.requested'
|
|
10
|
+
const PROJECTS_LIST_HREF = '/backend/staff/time-tracking/projects'
|
|
11
|
+
|
|
12
|
+
export const metadata = {
|
|
13
|
+
event: 'staff.timesheets.project_access.requested',
|
|
14
|
+
persistent: true,
|
|
15
|
+
id: 'staff:time-project-access-requested-notification',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type ProjectAccessRequestedPayload = {
|
|
19
|
+
tenantId: string
|
|
20
|
+
organizationId?: string | null
|
|
21
|
+
requesterUserId: string
|
|
22
|
+
requesterName?: string | null
|
|
23
|
+
timeProjectId?: string | null
|
|
24
|
+
timeProjectName?: string | null
|
|
25
|
+
requestedAt?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type ResolverContext = {
|
|
29
|
+
resolve: <T = unknown>(name: string) => T
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Spec D-6: the notification action opens the project team drawer with the
|
|
34
|
+
* requester pre-selected, so a Team Leader grants access without hunting for
|
|
35
|
+
* the row. A general request carries no project, so it lands on the list.
|
|
36
|
+
*/
|
|
37
|
+
export function buildProjectAccessRequestLinkHref(input: {
|
|
38
|
+
requesterUserId: string
|
|
39
|
+
timeProjectId?: string | null
|
|
40
|
+
}): string {
|
|
41
|
+
if (!input.timeProjectId) return PROJECTS_LIST_HREF
|
|
42
|
+
const projectSegment = encodeURIComponent(input.timeProjectId)
|
|
43
|
+
const requesterParam = encodeURIComponent(input.requesterUserId)
|
|
44
|
+
return `${PROJECTS_LIST_HREF}/${projectSegment}?panel=team&requesterUserId=${requesterParam}`
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function buildProjectAccessRequestGroupKey(input: {
|
|
48
|
+
requesterUserId: string
|
|
49
|
+
timeProjectId?: string | null
|
|
50
|
+
}): string {
|
|
51
|
+
return `staff:time-project-access:${input.requesterUserId}:${input.timeProjectId ?? 'general'}`
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default async function handle(payload: ProjectAccessRequestedPayload, ctx: ResolverContext) {
|
|
55
|
+
try {
|
|
56
|
+
if (!payload?.tenantId || !payload?.requesterUserId) return
|
|
57
|
+
const typeDef = notificationTypes.find((type) => type.type === NOTIFICATION_TYPE)
|
|
58
|
+
if (!typeDef) return
|
|
59
|
+
|
|
60
|
+
const notificationService = resolveNotificationService(ctx)
|
|
61
|
+
const requesterName = payload.requesterName?.trim() || payload.requesterUserId
|
|
62
|
+
const timeProjectId = payload.timeProjectId ?? null
|
|
63
|
+
|
|
64
|
+
const notificationInput = buildFeatureNotificationFromType(typeDef, {
|
|
65
|
+
requiredFeature: MANAGE_PROJECTS_FEATURE,
|
|
66
|
+
bodyVariables: {
|
|
67
|
+
requesterName,
|
|
68
|
+
...(payload.timeProjectName ? { projectName: payload.timeProjectName } : {}),
|
|
69
|
+
},
|
|
70
|
+
sourceEntityType: 'staff:time_project',
|
|
71
|
+
sourceEntityId: timeProjectId ?? undefined,
|
|
72
|
+
linkHref: buildProjectAccessRequestLinkHref({
|
|
73
|
+
requesterUserId: payload.requesterUserId,
|
|
74
|
+
timeProjectId,
|
|
75
|
+
}),
|
|
76
|
+
groupKey: buildProjectAccessRequestGroupKey({
|
|
77
|
+
requesterUserId: payload.requesterUserId,
|
|
78
|
+
timeProjectId,
|
|
79
|
+
}),
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
await notificationService.createForFeature(
|
|
83
|
+
{ ...notificationInput, restrictRecipientsToOrganization: true },
|
|
84
|
+
{
|
|
85
|
+
tenantId: payload.tenantId,
|
|
86
|
+
organizationId: payload.organizationId ?? null,
|
|
87
|
+
},
|
|
88
|
+
)
|
|
89
|
+
} catch (err) {
|
|
90
|
+
logger.error('Failed to create the project access request notification', {
|
|
91
|
+
subscriber: metadata.id,
|
|
92
|
+
err,
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
2
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
3
|
+
import type { NotificationSeverity } from '@open-mercato/shared/modules/notifications/types'
|
|
4
|
+
import { resolveNotificationService } from '../../notifications/lib/notificationService'
|
|
5
|
+
import {
|
|
6
|
+
buildFeatureNotificationFromType,
|
|
7
|
+
buildNotificationFromType,
|
|
8
|
+
} from '../../notifications/lib/notificationBuilder'
|
|
9
|
+
import { notificationTypes } from '../notifications'
|
|
10
|
+
import { emitStaffEvent } from '../events'
|
|
11
|
+
import { MANAGE_PROJECTS_FEATURE } from '../lib/time-tracking/access'
|
|
12
|
+
import { computeProjectFinancials } from '../lib/timesheets-projects/computeProjectFinancials'
|
|
13
|
+
import { FULL_BUDGET_PERCENT, evaluateBudgetThreshold } from '../lib/timesheets-projects/budgetThreshold'
|
|
14
|
+
import {
|
|
15
|
+
claimBudgetThresholdAlert,
|
|
16
|
+
loadTimeProjectBudgetStateForEntry,
|
|
17
|
+
} from '../lib/timesheets-projects/budgetThresholdState'
|
|
18
|
+
|
|
19
|
+
const logger = createLogger('staff').child({ component: 'subscribers/time-project-budget-threshold' })
|
|
20
|
+
|
|
21
|
+
const NOTIFICATION_TYPE = 'staff.timesheets.time_project.budget_threshold_reached'
|
|
22
|
+
const PROJECTS_LIST_HREF = '/backend/staff/time-tracking/projects'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Every write that can move a project's logged minutes or cost travels as a
|
|
26
|
+
* `staff.timesheets.time_entry.*` event, but not all of them by the same route:
|
|
27
|
+
*
|
|
28
|
+
* - create / update / delete (soft) are emitted by the time-entry **commands**
|
|
29
|
+
* through `staffTimeEntryCrudEvents` (`lib/crud.ts`), which the CRUD route and
|
|
30
|
+
* `/copy-day` and `/[id]/duplicate` all drive;
|
|
31
|
+
* - `/bulk` emits the same config itself, once per changed row, because it writes
|
|
32
|
+
* through the EntityManager instead of the command bus;
|
|
33
|
+
* - the timer transitions emit `…timer_started` / `…timer_stopped` explicitly.
|
|
34
|
+
*
|
|
35
|
+
* All of those carry the `{ id, tenantId, organizationId }` payload this handler
|
|
36
|
+
* needs. The batch-level members of the family — `…bulk_updated`, `…locked`,
|
|
37
|
+
* `…unlocked` — deliberately carry no `id` and fall out at the guard below, because
|
|
38
|
+
* the per-row events of the same write already covered every affected project.
|
|
39
|
+
*
|
|
40
|
+
* Subscribing to the family rather than three exact ids is what keeps a future write
|
|
41
|
+
* path from silently skipping the budget check.
|
|
42
|
+
*
|
|
43
|
+
* `persistent: true`: this ends in a user-visible alert about money and hours
|
|
44
|
+
* already spent. It has to survive a worker restart and be retried on failure — an
|
|
45
|
+
* ephemeral subscription would drop the alert whenever the process handling the
|
|
46
|
+
* entry write went away, and nothing would ever raise it again.
|
|
47
|
+
*/
|
|
48
|
+
export const metadata = {
|
|
49
|
+
event: 'staff.timesheets.time_entry.*',
|
|
50
|
+
persistent: true,
|
|
51
|
+
id: 'staff:time-project-budget-threshold-notification',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type TimeEntryWritePayload = {
|
|
55
|
+
id?: string | null
|
|
56
|
+
tenantId?: string | null
|
|
57
|
+
organizationId?: string | null
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type ResolverContext = {
|
|
61
|
+
resolve: <T = unknown>(name: string) => T
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function buildBudgetThresholdLinkHref(timeProjectId: string): string {
|
|
65
|
+
return `${PROJECTS_LIST_HREF}/${encodeURIComponent(timeProjectId)}`
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* One group key per project AND threshold, so the 80% alert and the 100% alert are
|
|
70
|
+
* two separate items in the bell, while a retry of the same crossing refreshes the
|
|
71
|
+
* existing item instead of stacking a duplicate.
|
|
72
|
+
*/
|
|
73
|
+
export function buildBudgetThresholdGroupKey(input: {
|
|
74
|
+
timeProjectId: string
|
|
75
|
+
thresholdPercent: number
|
|
76
|
+
}): string {
|
|
77
|
+
return `staff:time-project-budget:${input.timeProjectId}:${input.thresholdPercent}`
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function resolveBudgetThresholdSeverity(thresholdPercent: number): NotificationSeverity {
|
|
81
|
+
return thresholdPercent >= FULL_BUDGET_PERCENT ? 'error' : 'warning'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default async function handle(payload: TimeEntryWritePayload, ctx: ResolverContext) {
|
|
85
|
+
try {
|
|
86
|
+
const timeEntryId = payload?.id ?? null
|
|
87
|
+
const tenantId = payload?.tenantId ?? null
|
|
88
|
+
const organizationId = payload?.organizationId ?? null
|
|
89
|
+
if (!timeEntryId || !tenantId || !organizationId) return
|
|
90
|
+
|
|
91
|
+
const typeDef = notificationTypes.find((type) => type.type === NOTIFICATION_TYPE)
|
|
92
|
+
if (!typeDef) return
|
|
93
|
+
|
|
94
|
+
const em = (ctx.resolve('em') as EntityManager).fork()
|
|
95
|
+
const project = await loadTimeProjectBudgetStateForEntry({ em, tenantId, organizationId, timeEntryId })
|
|
96
|
+
if (!project) return
|
|
97
|
+
// A project without a budget never notifies. It is also the common case, so it
|
|
98
|
+
// exits before the aggregate query — unless a stale marker from a budget that
|
|
99
|
+
// has since been switched off still needs clearing.
|
|
100
|
+
if (project.budgetKind === 'none' && project.budgetAlertedAtPercent === null) return
|
|
101
|
+
|
|
102
|
+
const financials = await computeProjectFinancials({
|
|
103
|
+
em,
|
|
104
|
+
tenantId,
|
|
105
|
+
organizationId,
|
|
106
|
+
projectIds: [project.timeProjectId],
|
|
107
|
+
hourlyRateByProjectId: new Map([[project.timeProjectId, project.hourlyRate]]),
|
|
108
|
+
})
|
|
109
|
+
const totals = financials.get(project.timeProjectId)
|
|
110
|
+
|
|
111
|
+
const evaluation = evaluateBudgetThreshold({
|
|
112
|
+
budgetKind: project.budgetKind,
|
|
113
|
+
budgetValue: project.budgetValue,
|
|
114
|
+
budgetWarnAtPercent: project.budgetWarnAtPercent,
|
|
115
|
+
budgetAlertedAtPercent: project.budgetAlertedAtPercent,
|
|
116
|
+
totalMinutes: totals?.totalMinutes ?? 0,
|
|
117
|
+
cost: totals?.cost ?? null,
|
|
118
|
+
currencyCode: project.currencyCode,
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
if (!evaluation.shouldPersistAlertedAt) return
|
|
122
|
+
|
|
123
|
+
// Compare-and-swap on the marker: the loser of a race between two concurrent
|
|
124
|
+
// entry writes stops here, so a threshold is announced exactly once. The marker
|
|
125
|
+
// is written before the alert, which makes this at-most-once by design — a
|
|
126
|
+
// repeated alert about the same crossing is worse than a missed retry.
|
|
127
|
+
const claimed = await claimBudgetThresholdAlert({
|
|
128
|
+
em,
|
|
129
|
+
tenantId,
|
|
130
|
+
organizationId,
|
|
131
|
+
timeProjectId: project.timeProjectId,
|
|
132
|
+
expectedAlertedAtPercent: project.budgetAlertedAtPercent,
|
|
133
|
+
nextAlertedAtPercent: evaluation.nextAlertedAtPercent,
|
|
134
|
+
})
|
|
135
|
+
if (!claimed) return
|
|
136
|
+
|
|
137
|
+
const thresholdPercent = evaluation.crossedThresholdPercent
|
|
138
|
+
// The marker moved down (usage fell back under the band it was raised for) or
|
|
139
|
+
// the budget was switched off. Nothing to announce; the reset is the point.
|
|
140
|
+
if (thresholdPercent === null) return
|
|
141
|
+
|
|
142
|
+
// This event is `clientBroadcast: true`, and the DOM Event Bridge filters only by
|
|
143
|
+
// tenant and organization — every signed-in user of the organization receives the
|
|
144
|
+
// payload, whether or not they hold `staff.timesheets.rates.view`. An `amount`
|
|
145
|
+
// budget states money (`budgetValue` is the contract value, `usedValue` the cost
|
|
146
|
+
// burned against it), so those two are carried only for an `hours` budget, exactly
|
|
147
|
+
// as `/my-work` withholds an amount budget from a caller who may not see money.
|
|
148
|
+
// The percentages are not money and are what a live budget badge actually renders.
|
|
149
|
+
const budgetIsMoney = evaluation.kind === 'amount'
|
|
150
|
+
await emitStaffEvent(
|
|
151
|
+
'staff.timesheets.time_project.budget_threshold_reached',
|
|
152
|
+
{
|
|
153
|
+
id: project.timeProjectId,
|
|
154
|
+
timeProjectId: project.timeProjectId,
|
|
155
|
+
tenantId,
|
|
156
|
+
organizationId,
|
|
157
|
+
thresholdPercent,
|
|
158
|
+
percent: evaluation.percent,
|
|
159
|
+
budgetKind: evaluation.kind,
|
|
160
|
+
...(budgetIsMoney ? {} : { budgetValue: evaluation.budgetValue, usedValue: evaluation.usedValue }),
|
|
161
|
+
},
|
|
162
|
+
{ persistent: true },
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
const notificationService = resolveNotificationService(ctx)
|
|
166
|
+
const scope = { tenantId, organizationId }
|
|
167
|
+
const severity = resolveBudgetThresholdSeverity(thresholdPercent)
|
|
168
|
+
const commonOptions = {
|
|
169
|
+
bodyVariables: {
|
|
170
|
+
projectName: project.name || project.timeProjectId,
|
|
171
|
+
percent: String(evaluation.percent ?? 0),
|
|
172
|
+
thresholdPercent: String(thresholdPercent),
|
|
173
|
+
},
|
|
174
|
+
sourceEntityType: 'staff:time_project',
|
|
175
|
+
sourceEntityId: project.timeProjectId,
|
|
176
|
+
linkHref: buildBudgetThresholdLinkHref(project.timeProjectId),
|
|
177
|
+
groupKey: buildBudgetThresholdGroupKey({ timeProjectId: project.timeProjectId, thresholdPercent }),
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Manage-feature holders are resolved through the notification service's feature
|
|
181
|
+
// fan-out, which matches grants with the shared feature policy — a `staff.*`
|
|
182
|
+
// wildcard counts — and then re-checks each candidate against this organization
|
|
183
|
+
// through the RBAC service.
|
|
184
|
+
const featureNotifications = await notificationService.createForFeature(
|
|
185
|
+
{
|
|
186
|
+
...buildFeatureNotificationFromType(typeDef, {
|
|
187
|
+
...commonOptions,
|
|
188
|
+
requiredFeature: MANAGE_PROJECTS_FEATURE,
|
|
189
|
+
}),
|
|
190
|
+
severity,
|
|
191
|
+
restrictRecipientsToOrganization: true,
|
|
192
|
+
},
|
|
193
|
+
scope,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
const ownerUserId = project.ownerUserId
|
|
197
|
+
if (!ownerUserId) return
|
|
198
|
+
const ownerAlreadyNotified = featureNotifications.some(
|
|
199
|
+
(notification) => notification?.recipientUserId === ownerUserId,
|
|
200
|
+
)
|
|
201
|
+
if (ownerAlreadyNotified) return
|
|
202
|
+
|
|
203
|
+
// The owner is notified even without the manage feature — it is their project's
|
|
204
|
+
// budget. An owner who has left the scope is not an error worth failing on.
|
|
205
|
+
try {
|
|
206
|
+
await notificationService.create(
|
|
207
|
+
{
|
|
208
|
+
...buildNotificationFromType(typeDef, { ...commonOptions, recipientUserId: ownerUserId }),
|
|
209
|
+
severity,
|
|
210
|
+
},
|
|
211
|
+
scope,
|
|
212
|
+
)
|
|
213
|
+
} catch (err) {
|
|
214
|
+
logger.warn('Skipped the budget threshold notification for an out-of-scope project owner', {
|
|
215
|
+
subscriber: metadata.id,
|
|
216
|
+
timeProjectId: project.timeProjectId,
|
|
217
|
+
err,
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
} catch (err) {
|
|
221
|
+
logger.error('Failed to evaluate the time project budget threshold', {
|
|
222
|
+
subscriber: metadata.id,
|
|
223
|
+
err,
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
2
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
3
|
+
import { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'
|
|
4
|
+
import { resolveNotificationService } from '../../notifications/lib/notificationService'
|
|
5
|
+
import { buildNotificationFromType } from '../../notifications/lib/notificationBuilder'
|
|
6
|
+
import { notificationTypes } from '../notifications'
|
|
7
|
+
import { StaffTimeReport } from '../data/entities'
|
|
8
|
+
|
|
9
|
+
const logger = createLogger('staff').child({ component: 'subscribers/time-report-approved' })
|
|
10
|
+
|
|
11
|
+
const NOTIFICATION_TYPE = 'staff.timesheets.time_report.approved'
|
|
12
|
+
const REPORTS_LIST_HREF = '/backend/staff/time-tracking/reports'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* EP-48. Closing a report IS its approval in this module: the close freezes every
|
|
16
|
+
* per-entry rate and amount, locks the entries against further edits, and is
|
|
17
|
+
* gated on `staff.timesheets.lock`. There is no separate "approved" transition to
|
|
18
|
+
* subscribe to, and adding one would be a behaviour change, not an extension
|
|
19
|
+
* point — so this subscribes to the close and announces it to the one person who
|
|
20
|
+
* otherwise finds out by reopening the screen: whoever drafted the report.
|
|
21
|
+
*
|
|
22
|
+
* The closer is deliberately not notified about their own action, and a report
|
|
23
|
+
* with no recorded author is a normal outcome (a seeded or imported report), not
|
|
24
|
+
* an error.
|
|
25
|
+
*
|
|
26
|
+
* `persistent: true` — a report closing is a billing milestone; the alert has to
|
|
27
|
+
* survive a worker restart and be retried, the same reasoning as the budget
|
|
28
|
+
* threshold subscriber next to it.
|
|
29
|
+
*/
|
|
30
|
+
export const metadata = {
|
|
31
|
+
event: 'staff.timesheets.time_report.closed',
|
|
32
|
+
persistent: true,
|
|
33
|
+
id: 'staff:time-report-approved-notification',
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type TimeReportClosedPayload = {
|
|
37
|
+
id?: string | null
|
|
38
|
+
reportId?: string | null
|
|
39
|
+
reference?: string | null
|
|
40
|
+
tenantId?: string | null
|
|
41
|
+
organizationId?: string | null
|
|
42
|
+
closedByUserId?: string | null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type ResolverContext = {
|
|
46
|
+
resolve: <T = unknown>(name: string) => T
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function buildTimeReportLinkHref(reportId: string): string {
|
|
50
|
+
return `${REPORTS_LIST_HREF}/${encodeURIComponent(reportId)}`
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** One item per report, so a re-close after an unlock refreshes rather than stacks. */
|
|
54
|
+
export function buildTimeReportApprovedGroupKey(reportId: string): string {
|
|
55
|
+
return `staff:time-report-approved:${reportId}`
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function readId(...candidates: Array<unknown>): string | null {
|
|
59
|
+
for (const candidate of candidates) {
|
|
60
|
+
if (typeof candidate !== 'string') continue
|
|
61
|
+
const trimmed = candidate.trim()
|
|
62
|
+
if (trimmed.length > 0) return trimmed
|
|
63
|
+
}
|
|
64
|
+
return null
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default async function handle(
|
|
68
|
+
payload: TimeReportClosedPayload,
|
|
69
|
+
ctx: ResolverContext,
|
|
70
|
+
): Promise<void> {
|
|
71
|
+
try {
|
|
72
|
+
const reportId = readId(payload?.reportId, payload?.id)
|
|
73
|
+
const tenantId = readId(payload?.tenantId)
|
|
74
|
+
const organizationId = readId(payload?.organizationId)
|
|
75
|
+
if (!reportId || !tenantId || !organizationId) return
|
|
76
|
+
|
|
77
|
+
const typeDef = notificationTypes.find((entry) => entry.type === NOTIFICATION_TYPE)
|
|
78
|
+
if (!typeDef) return
|
|
79
|
+
|
|
80
|
+
const em = ctx.resolve<EntityManager>('em').fork()
|
|
81
|
+
const scope = { tenantId, organizationId }
|
|
82
|
+
const report = await findOneWithDecryption(
|
|
83
|
+
em,
|
|
84
|
+
StaffTimeReport,
|
|
85
|
+
{ id: reportId, tenantId, organizationId, deletedAt: null },
|
|
86
|
+
{},
|
|
87
|
+
scope,
|
|
88
|
+
)
|
|
89
|
+
if (!report) return
|
|
90
|
+
|
|
91
|
+
const recipientUserId = readId(report.createdByUserId)
|
|
92
|
+
if (!recipientUserId) return
|
|
93
|
+
if (recipientUserId === readId(report.closedByUserId, payload?.closedByUserId)) return
|
|
94
|
+
|
|
95
|
+
const notificationService = resolveNotificationService(ctx)
|
|
96
|
+
await notificationService.create(
|
|
97
|
+
buildNotificationFromType(typeDef, {
|
|
98
|
+
recipientUserId,
|
|
99
|
+
bodyVariables: {
|
|
100
|
+
reference: report.reference,
|
|
101
|
+
title: report.title,
|
|
102
|
+
},
|
|
103
|
+
sourceEntityType: 'staff:time_report',
|
|
104
|
+
sourceEntityId: report.id,
|
|
105
|
+
linkHref: buildTimeReportLinkHref(report.id),
|
|
106
|
+
groupKey: buildTimeReportApprovedGroupKey(report.id),
|
|
107
|
+
}),
|
|
108
|
+
scope,
|
|
109
|
+
)
|
|
110
|
+
} catch (err) {
|
|
111
|
+
logger.error('Failed to raise the time report approved notification', {
|
|
112
|
+
subscriber: metadata.id,
|
|
113
|
+
err,
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
2
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
3
|
+
import { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'
|
|
4
|
+
import { emitStaffEvent } from '../events'
|
|
5
|
+
import { StaffTimeReport } from '../data/entities'
|
|
6
|
+
import { resolvePortalRecipientUserIds } from '../lib/time-tracking/portalRecipients'
|
|
7
|
+
|
|
8
|
+
const logger = createLogger('staff').child({ component: 'subscribers/time-report-portal-broadcast' })
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* EP-06 / EP-50. Mirrors a closed report to the customer portal — and is the only
|
|
12
|
+
* emitter of `staff.timesheets.time_report.portal_published`.
|
|
13
|
+
*
|
|
14
|
+
* The glue lives here, in an optional consumer, rather than in the close command,
|
|
15
|
+
* because resolving "which portal users belong to this customer" reads a
|
|
16
|
+
* `customer_accounts` table. As a subscriber it is skippable: if the query fails
|
|
17
|
+
* the recipient list is empty and nothing is emitted, so a deployment without the
|
|
18
|
+
* portal installed behaves exactly as it did before.
|
|
19
|
+
*
|
|
20
|
+
* Two invariants this file exists to hold:
|
|
21
|
+
*
|
|
22
|
+
* 1. **No recipients, no event.** The portal SSE stream falls back to an
|
|
23
|
+
* organization-wide audience for a payload with no `recipientUserIds`, and one
|
|
24
|
+
* organization serves many customers. Emitting an unpinned report event would
|
|
25
|
+
* be a cross-customer disclosure.
|
|
26
|
+
* 2. **No money on the wire.** The payload carries the reference and the period
|
|
27
|
+
* only. Amounts are gated on `staff.timesheets.rates.view`, which SSE cannot
|
|
28
|
+
* apply, and a portal user never holds it in any case.
|
|
29
|
+
*
|
|
30
|
+
* `persistent: true`: a client-visible publication should survive a worker restart.
|
|
31
|
+
*/
|
|
32
|
+
export const metadata = {
|
|
33
|
+
event: 'staff.timesheets.time_report.closed',
|
|
34
|
+
persistent: true,
|
|
35
|
+
id: 'staff:time-report-portal-broadcast',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type TimeReportClosedPayload = {
|
|
39
|
+
id?: string | null
|
|
40
|
+
reportId?: string | null
|
|
41
|
+
tenantId?: string | null
|
|
42
|
+
organizationId?: string | null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type ResolverContext = {
|
|
46
|
+
resolve: <T = unknown>(name: string) => T
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function readId(...candidates: Array<unknown>): string | null {
|
|
50
|
+
for (const candidate of candidates) {
|
|
51
|
+
if (typeof candidate !== 'string') continue
|
|
52
|
+
const trimmed = candidate.trim()
|
|
53
|
+
if (trimmed.length > 0) return trimmed
|
|
54
|
+
}
|
|
55
|
+
return null
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function toIsoDate(value: unknown): string | null {
|
|
59
|
+
if (value instanceof Date) {
|
|
60
|
+
if (Number.isNaN(value.getTime())) return null
|
|
61
|
+
return value.toISOString().slice(0, 10)
|
|
62
|
+
}
|
|
63
|
+
if (typeof value === 'string' && value.trim().length > 0) return value.trim().slice(0, 10)
|
|
64
|
+
return null
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default async function handle(
|
|
68
|
+
payload: TimeReportClosedPayload,
|
|
69
|
+
ctx: ResolverContext,
|
|
70
|
+
): Promise<void> {
|
|
71
|
+
try {
|
|
72
|
+
const reportId = readId(payload?.reportId, payload?.id)
|
|
73
|
+
const tenantId = readId(payload?.tenantId)
|
|
74
|
+
const organizationId = readId(payload?.organizationId)
|
|
75
|
+
if (!reportId || !tenantId || !organizationId) return
|
|
76
|
+
|
|
77
|
+
const em = ctx.resolve<EntityManager>('em').fork()
|
|
78
|
+
const report = await findOneWithDecryption(
|
|
79
|
+
em,
|
|
80
|
+
StaffTimeReport,
|
|
81
|
+
{ id: reportId, tenantId, organizationId, deletedAt: null },
|
|
82
|
+
{},
|
|
83
|
+
{ tenantId, organizationId },
|
|
84
|
+
)
|
|
85
|
+
if (!report || report.status !== 'closed') return
|
|
86
|
+
|
|
87
|
+
const customerId = readId(report.customerId)
|
|
88
|
+
if (!customerId) return
|
|
89
|
+
|
|
90
|
+
const recipientUserIds = await resolvePortalRecipientUserIds(em, {
|
|
91
|
+
tenantId,
|
|
92
|
+
organizationId,
|
|
93
|
+
customerId,
|
|
94
|
+
})
|
|
95
|
+
if (recipientUserIds.length === 0) return
|
|
96
|
+
|
|
97
|
+
const periodFrom = toIsoDate(report.periodFrom)
|
|
98
|
+
const periodTo = toIsoDate(report.periodTo)
|
|
99
|
+
if (!periodFrom || !periodTo) return
|
|
100
|
+
|
|
101
|
+
await emitStaffEvent(
|
|
102
|
+
'staff.timesheets.time_report.portal_published',
|
|
103
|
+
{
|
|
104
|
+
id: report.id,
|
|
105
|
+
tenantId,
|
|
106
|
+
organizationId,
|
|
107
|
+
reference: report.reference,
|
|
108
|
+
periodFrom,
|
|
109
|
+
periodTo,
|
|
110
|
+
recipientUserIds,
|
|
111
|
+
},
|
|
112
|
+
{ persistent: true },
|
|
113
|
+
)
|
|
114
|
+
} catch (err) {
|
|
115
|
+
logger.error('Failed to publish a closed time report to the customer portal', {
|
|
116
|
+
subscriber: metadata.id,
|
|
117
|
+
err,
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EP-45 — entity fields a tenant may translate per locale.
|
|
3
|
+
*
|
|
4
|
+
* Keys are entity ids, values are **database column** names (snake_case), matching the
|
|
5
|
+
* `staff_team_member` entry this file shipped with. Adding a field here does not change
|
|
6
|
+
* any rendered output on its own: the translation overlay only substitutes a value when
|
|
7
|
+
* a translation row exists for the request locale, and there are none until a tenant
|
|
8
|
+
* writes one.
|
|
9
|
+
*
|
|
10
|
+
* Only columns that actually exist are listed. `staff_time_task_statuses` has no
|
|
11
|
+
* description column and `staff_time_tags` names its label `label`, so the spec's
|
|
12
|
+
* "name / description" reads as "the human-readable columns of each" rather than two
|
|
13
|
+
* literal column names.
|
|
14
|
+
*/
|
|
1
15
|
export const translatableFields: Record<string, string[]> = {
|
|
2
16
|
'staff:staff_team_member': ['display_name', 'description'],
|
|
17
|
+
'staff:staff_time_project': ['name', 'description'],
|
|
18
|
+
'staff:staff_time_task_status': ['name'],
|
|
19
|
+
'staff:staff_time_tag': ['label'],
|
|
3
20
|
}
|
|
4
21
|
|
|
5
22
|
export default translatableFields
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentOverride } from '@open-mercato/shared/modules/widgets/component-registry'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Component replacement handles the staff module publishes (EP-31 of
|
|
5
|
+
* `.ai/specs/2026-08-24-time-tracking-umes-extension-points.md`).
|
|
6
|
+
*
|
|
7
|
+
* Each handle is registered by the component's own module through
|
|
8
|
+
* `registerComponent`, and the shipping component resolves itself through
|
|
9
|
+
* `useRegisteredComponent`, so another module can `replace`, `wrapper` or
|
|
10
|
+
* `props`-transform it without forking the screen that renders it. Every entry
|
|
11
|
+
* publishes a zod `propsSchema` — in development `useRegisteredComponent` parses
|
|
12
|
+
* the resolved props against it and falls back to the original component when a
|
|
13
|
+
* replacement does not satisfy it, so the schema is the contract, not a comment.
|
|
14
|
+
*
|
|
15
|
+
* | Handle | Registered by | Props |
|
|
16
|
+
* |---|---|---|
|
|
17
|
+
* | `staff.time_entry_dialog` | `lib/time-tracking-ui/TimeEntryDialog.tsx` | `TimeEntryDialogProps` |
|
|
18
|
+
* | `staff.timer_bar` | `lib/timesheets-ui/TimerBar.tsx` | `TimerBarProps` |
|
|
19
|
+
* | `staff.kanban_card` | `lib/time-tracking-ui/KanbanCard.tsx` | `KanbanCardProps` |
|
|
20
|
+
* | `staff.kanban_column` | `lib/time-tracking-ui/KanbanColumn.tsx` | `KanbanColumnProps` |
|
|
21
|
+
* | `staff.timesheet_grid` | `backend/staff/time-tracking/timesheet/GridView.tsx`| `GridViewProps` |
|
|
22
|
+
* | `staff.timesheet_list` | `lib/timesheets-ui/ListView.tsx` | `ListViewProps` |
|
|
23
|
+
* | `staff.timesheet_calendar` | `lib/time-tracking-ui/TimesheetCalendar.tsx` | `TimesheetCalendarProps` |
|
|
24
|
+
* | `staff.report_sheet` | `lib/time-tracking-ui/ReportSheet.tsx` | `ReportSheetProps` |
|
|
25
|
+
* | `staff.project_card` | `lib/timesheets-projects-ui/ProjectCard.tsx` | `ProjectCardProps` |
|
|
26
|
+
* | `staff.entries_summary_footer` | `lib/time-tracking-ui/TimeEntriesSummaryFooter.tsx` | `TimeEntriesSummaryFooterProps` |
|
|
27
|
+
*
|
|
28
|
+
* The array below is the staff module's own *outgoing* overrides — it targets no
|
|
29
|
+
* other module's components today, so it is empty. Adding an entry here would
|
|
30
|
+
* override somebody else's component, not one of the handles above.
|
|
31
|
+
*/
|
|
32
|
+
export const componentOverrides: ComponentOverride[] = []
|
|
33
|
+
|
|
34
|
+
export default componentOverrides
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
|
+
import Link from 'next/link'
|
|
4
5
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
5
6
|
import type { InjectionWidgetModule } from '@open-mercato/shared/modules/widgets/injection'
|
|
6
7
|
import { ProjectColorDot } from '../../../lib/timesheets-ui/ProjectColorDot'
|
|
@@ -40,14 +41,14 @@ function TimerSidebarIndicator() {
|
|
|
40
41
|
if (!timer.running || !timer.entryId) return null
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
|
-
<
|
|
44
|
-
href="/backend/staff/
|
|
44
|
+
<Link
|
|
45
|
+
href="/backend/staff/time-tracking/timesheet"
|
|
45
46
|
className="flex items-center gap-2 rounded-md px-2 py-1.5 text-xs hover:bg-muted transition-colors cursor-pointer"
|
|
46
47
|
title={t('staff.timesheets.sidebar.timerRunning', 'Timer running — click to view')}
|
|
47
48
|
>
|
|
48
49
|
<span className="relative flex h-2.5 w-2.5 shrink-0">
|
|
49
|
-
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-
|
|
50
|
-
<span className="relative inline-flex h-2.5 w-2.5 rounded-full bg-
|
|
50
|
+
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-status-error-icon opacity-75" />
|
|
51
|
+
<span className="relative inline-flex h-2.5 w-2.5 rounded-full bg-status-error-icon" />
|
|
51
52
|
</span>
|
|
52
53
|
{timer.projectName ? (
|
|
53
54
|
<span className="inline-flex items-center gap-1 truncate">
|
|
@@ -56,7 +57,7 @@ function TimerSidebarIndicator() {
|
|
|
56
57
|
</span>
|
|
57
58
|
) : null}
|
|
58
59
|
<span className="ml-auto font-mono tabular-nums shrink-0">{formatElapsed(elapsed)}</span>
|
|
59
|
-
</
|
|
60
|
+
</Link>
|
|
60
61
|
)
|
|
61
62
|
}
|
|
62
63
|
|