@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
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { registerCommand } from "@open-mercato/shared/lib/commands";
|
|
2
3
|
import { UniqueConstraintViolationException } from "@mikro-orm/core";
|
|
3
4
|
import { CrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
4
5
|
import { resolveTranslations } from "@open-mercato/shared/lib/i18n/server";
|
|
5
6
|
import { findOneWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
6
|
-
import { buildChanges, emitCrudSideEffects, emitCrudUndoSideEffects } from "@open-mercato/shared/lib/commands/helpers";
|
|
7
|
+
import { buildChanges, emitCrudSideEffects, emitCrudUndoSideEffects, setCustomFieldsIfAny } from "@open-mercato/shared/lib/commands/helpers";
|
|
8
|
+
import { extractCustomFieldValuesFromPayload } from "@open-mercato/shared/lib/crud/custom-fields";
|
|
9
|
+
import { E } from "../../../generated/entities.ids.generated.js";
|
|
10
|
+
import { withAtomicFlush } from "@open-mercato/shared/lib/commands/flush";
|
|
7
11
|
import { makeCreateRedo } from "@open-mercato/shared/lib/commands/redo";
|
|
8
|
-
import {
|
|
12
|
+
import { CustomerEntity } from "@open-mercato/core/modules/customers/data/entities";
|
|
13
|
+
import {
|
|
14
|
+
StaffTeamMember,
|
|
15
|
+
StaffTimeEntry,
|
|
16
|
+
StaffTimeProject,
|
|
17
|
+
StaffTimeProjectMember,
|
|
18
|
+
StaffTimeReport
|
|
19
|
+
} from "../data/entities.js";
|
|
9
20
|
const timeProjectCrudIndexer = {
|
|
10
21
|
entityType: "staff:staff_time_project"
|
|
11
22
|
};
|
|
@@ -15,9 +26,13 @@ const timeProjectMemberCrudIndexer = {
|
|
|
15
26
|
import {
|
|
16
27
|
staffTimeProjectCreateSchema,
|
|
17
28
|
staffTimeProjectUpdateSchema,
|
|
18
|
-
|
|
29
|
+
staffTimeProjectChangeCurrencySchema,
|
|
30
|
+
staffTimeProjectMemberAssignSchema,
|
|
31
|
+
staffTimeProjectMemberUpdateSchema
|
|
19
32
|
} from "../data/validators.js";
|
|
20
33
|
import { staffTimeProjectCrudEvents, staffTimeProjectMemberCrudEvents } from "../lib/crud.js";
|
|
34
|
+
import { DEFAULT_BUDGET_WARN_AT_PERCENT } from "../lib/timesheets-projects/budgetBurn.js";
|
|
35
|
+
import { seedProjectTaskStatuses } from "../lib/timesheets-tasks/seedProjectStatuses.js";
|
|
21
36
|
import {
|
|
22
37
|
applyScopeToWhere,
|
|
23
38
|
commandActorScope,
|
|
@@ -39,6 +54,40 @@ function isUniqueViolation(error) {
|
|
|
39
54
|
const message = error.message;
|
|
40
55
|
return typeof message === "string" && message.toLowerCase().includes("duplicate key");
|
|
41
56
|
}
|
|
57
|
+
function readSnapshotText(value) {
|
|
58
|
+
if (typeof value !== "string") return null;
|
|
59
|
+
const trimmed = value.trim();
|
|
60
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
61
|
+
}
|
|
62
|
+
async function resolveCustomerSnapshot(em, scope, customerId) {
|
|
63
|
+
if (!customerId) return null;
|
|
64
|
+
let customer = null;
|
|
65
|
+
try {
|
|
66
|
+
customer = await findOneWithDecryption(
|
|
67
|
+
em,
|
|
68
|
+
CustomerEntity,
|
|
69
|
+
{
|
|
70
|
+
id: customerId,
|
|
71
|
+
tenantId: scope.tenantId,
|
|
72
|
+
organizationId: scope.organizationId,
|
|
73
|
+
deletedAt: null
|
|
74
|
+
},
|
|
75
|
+
void 0,
|
|
76
|
+
{ tenantId: scope.tenantId, organizationId: scope.organizationId }
|
|
77
|
+
);
|
|
78
|
+
} catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
if (!customer) return null;
|
|
82
|
+
const email = readSnapshotText(customer.primaryEmail);
|
|
83
|
+
const name = readSnapshotText(customer.displayName) ?? email;
|
|
84
|
+
if (!name) return null;
|
|
85
|
+
const snapshot = { name };
|
|
86
|
+
const kind = readSnapshotText(customer.kind);
|
|
87
|
+
if (kind) snapshot.kind = kind;
|
|
88
|
+
if (email) snapshot.email = email;
|
|
89
|
+
return snapshot;
|
|
90
|
+
}
|
|
42
91
|
async function loadTimeProjectSnapshot(em, id, scope) {
|
|
43
92
|
const project = await findOneWithDecryption(
|
|
44
93
|
em,
|
|
@@ -54,6 +103,7 @@ async function loadTimeProjectSnapshot(em, id, scope) {
|
|
|
54
103
|
organizationId: project.organizationId,
|
|
55
104
|
name: project.name,
|
|
56
105
|
customerId: project.customerId ?? null,
|
|
106
|
+
customerSnapshot: project.customerSnapshot ?? null,
|
|
57
107
|
code: project.code,
|
|
58
108
|
description: project.description ?? null,
|
|
59
109
|
projectType: project.projectType ?? null,
|
|
@@ -62,6 +112,12 @@ async function loadTimeProjectSnapshot(em, id, scope) {
|
|
|
62
112
|
ownerUserId: project.ownerUserId ?? null,
|
|
63
113
|
costCenter: project.costCenter ?? null,
|
|
64
114
|
startDate: project.startDate instanceof Date ? project.startDate.toISOString().split("T")[0] : project.startDate ?? null,
|
|
115
|
+
hourlyRate: project.hourlyRate ?? null,
|
|
116
|
+
currencyCode: project.currencyCode ?? null,
|
|
117
|
+
billableByDefault: project.billableByDefault ?? true,
|
|
118
|
+
budgetKind: project.budgetKind ?? "none",
|
|
119
|
+
budgetValue: project.budgetValue ?? null,
|
|
120
|
+
budgetWarnAtPercent: project.budgetWarnAtPercent ?? DEFAULT_BUDGET_WARN_AT_PERCENT,
|
|
65
121
|
deletedAt: project.deletedAt ? project.deletedAt.toISOString() : null
|
|
66
122
|
};
|
|
67
123
|
}
|
|
@@ -95,6 +151,7 @@ function timeProjectSeedFromSnapshot(snapshot) {
|
|
|
95
151
|
organizationId: snapshot.organizationId,
|
|
96
152
|
name: snapshot.name,
|
|
97
153
|
customerId: snapshot.customerId ?? null,
|
|
154
|
+
customerSnapshot: snapshot.customerSnapshot ?? null,
|
|
98
155
|
code: snapshot.code,
|
|
99
156
|
description: snapshot.description ?? null,
|
|
100
157
|
projectType: snapshot.projectType ?? null,
|
|
@@ -103,6 +160,12 @@ function timeProjectSeedFromSnapshot(snapshot) {
|
|
|
103
160
|
ownerUserId: snapshot.ownerUserId ?? null,
|
|
104
161
|
costCenter: snapshot.costCenter ?? null,
|
|
105
162
|
startDate: snapshot.startDate ? new Date(snapshot.startDate) : null,
|
|
163
|
+
hourlyRate: snapshot.hourlyRate ?? null,
|
|
164
|
+
currencyCode: snapshot.currencyCode ?? null,
|
|
165
|
+
billableByDefault: snapshot.billableByDefault ?? true,
|
|
166
|
+
budgetKind: snapshot.budgetKind ?? "none",
|
|
167
|
+
budgetValue: snapshot.budgetValue ?? null,
|
|
168
|
+
budgetWarnAtPercent: snapshot.budgetWarnAtPercent ?? DEFAULT_BUDGET_WARN_AT_PERCENT,
|
|
106
169
|
createdAt: /* @__PURE__ */ new Date(),
|
|
107
170
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
108
171
|
deletedAt: null
|
|
@@ -133,12 +196,18 @@ const createTimeProjectCommand = {
|
|
|
133
196
|
ensureOrganizationScope(ctx, parsed.organizationId);
|
|
134
197
|
commandInputScope(ctx, parsed.tenantId, parsed.organizationId);
|
|
135
198
|
const em = ctx.container.resolve("em").fork();
|
|
199
|
+
const customerSnapshot = parsed.customerSnapshot ?? await resolveCustomerSnapshot(
|
|
200
|
+
em,
|
|
201
|
+
{ tenantId: parsed.tenantId, organizationId: parsed.organizationId },
|
|
202
|
+
parsed.customerId
|
|
203
|
+
);
|
|
136
204
|
const now = /* @__PURE__ */ new Date();
|
|
137
205
|
const project = em.create(StaffTimeProject, {
|
|
138
206
|
tenantId: parsed.tenantId,
|
|
139
207
|
organizationId: parsed.organizationId,
|
|
140
208
|
name: parsed.name,
|
|
141
|
-
customerId: parsed.customerId
|
|
209
|
+
customerId: parsed.customerId,
|
|
210
|
+
customerSnapshot,
|
|
142
211
|
code: parsed.code,
|
|
143
212
|
description: parsed.description ?? null,
|
|
144
213
|
projectType: parsed.projectType ?? null,
|
|
@@ -147,16 +216,37 @@ const createTimeProjectCommand = {
|
|
|
147
216
|
ownerUserId: parsed.ownerUserId ?? null,
|
|
148
217
|
costCenter: parsed.costCenter ?? null,
|
|
149
218
|
startDate: parsed.startDate ?? null,
|
|
219
|
+
hourlyRate: parsed.hourlyRate ?? null,
|
|
220
|
+
// D-3: creation is the one moment the currency may be chosen freely.
|
|
221
|
+
currencyCode: parsed.currencyCode ?? null,
|
|
222
|
+
billableByDefault: parsed.billableByDefault ?? true,
|
|
223
|
+
budgetKind: parsed.budgetKind ?? "none",
|
|
224
|
+
budgetValue: parsed.budgetValue ?? null,
|
|
225
|
+
budgetWarnAtPercent: parsed.budgetWarnAtPercent ?? DEFAULT_BUDGET_WARN_AT_PERCENT,
|
|
150
226
|
createdAt: now,
|
|
151
227
|
updatedAt: now,
|
|
152
228
|
deletedAt: null
|
|
153
229
|
});
|
|
154
|
-
|
|
230
|
+
const { translate } = await resolveTranslations();
|
|
155
231
|
try {
|
|
156
|
-
await
|
|
232
|
+
await withAtomicFlush(
|
|
233
|
+
em,
|
|
234
|
+
[
|
|
235
|
+
() => {
|
|
236
|
+
em.persist(project);
|
|
237
|
+
},
|
|
238
|
+
() => {
|
|
239
|
+
seedProjectTaskStatuses(
|
|
240
|
+
em,
|
|
241
|
+
{ tenantId: project.tenantId, organizationId: project.organizationId, timeProjectId: project.id },
|
|
242
|
+
translate
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
{ transaction: true, label: "staff.timesheets.time_projects.create" }
|
|
247
|
+
);
|
|
157
248
|
} catch (err) {
|
|
158
249
|
if (isUniqueViolation(err)) {
|
|
159
|
-
const { translate } = await resolveTranslations();
|
|
160
250
|
throw new CrudHttpError(409, {
|
|
161
251
|
error: translate("staff.timesheets.errors.projectCodeDuplicate", "A project with this code already exists."),
|
|
162
252
|
fieldErrors: { code: translate("staff.timesheets.errors.projectCodeDuplicate", "A project with this code already exists.") }
|
|
@@ -164,6 +254,16 @@ const createTimeProjectCommand = {
|
|
|
164
254
|
}
|
|
165
255
|
throw err;
|
|
166
256
|
}
|
|
257
|
+
await setCustomFieldsIfAny({
|
|
258
|
+
dataEngine: ctx.container.resolve("dataEngine"),
|
|
259
|
+
entityId: E.staff.staff_time_project,
|
|
260
|
+
recordId: project.id,
|
|
261
|
+
tenantId: project.tenantId,
|
|
262
|
+
organizationId: project.organizationId,
|
|
263
|
+
values: extractCustomFieldValuesFromPayload(
|
|
264
|
+
rawInput && typeof rawInput === "object" ? rawInput : {}
|
|
265
|
+
)
|
|
266
|
+
});
|
|
167
267
|
await emitCrudSideEffects({
|
|
168
268
|
dataEngine: ctx.container.resolve("dataEngine"),
|
|
169
269
|
action: "created",
|
|
@@ -258,8 +358,20 @@ const updateTimeProjectCommand = {
|
|
|
258
358
|
if (!project) throw new CrudHttpError(404, { error: "Time project not found." });
|
|
259
359
|
ensureTenantScope(ctx, project.tenantId);
|
|
260
360
|
ensureOrganizationScope(ctx, project.organizationId);
|
|
361
|
+
const customerTouched = parsed.customerId !== void 0 || parsed.customerSnapshot !== void 0;
|
|
362
|
+
const nextCustomerId = parsed.customerId !== void 0 ? parsed.customerId ?? null : project.customerId ?? null;
|
|
363
|
+
const customerUnchanged = nextCustomerId === (project.customerId ?? null);
|
|
364
|
+
let nextCustomerSnapshot;
|
|
365
|
+
if (customerTouched) {
|
|
366
|
+
nextCustomerSnapshot = parsed.customerSnapshot ?? await resolveCustomerSnapshot(
|
|
367
|
+
em,
|
|
368
|
+
{ tenantId: project.tenantId, organizationId: project.organizationId },
|
|
369
|
+
nextCustomerId
|
|
370
|
+
) ?? (customerUnchanged && nextCustomerId ? project.customerSnapshot ?? null : null);
|
|
371
|
+
}
|
|
261
372
|
if (parsed.name !== void 0) project.name = parsed.name;
|
|
262
373
|
if (parsed.customerId !== void 0) project.customerId = parsed.customerId ?? null;
|
|
374
|
+
if (nextCustomerSnapshot !== void 0) project.customerSnapshot = nextCustomerSnapshot;
|
|
263
375
|
if (parsed.code !== void 0) project.code = parsed.code;
|
|
264
376
|
if (parsed.description !== void 0) project.description = parsed.description ?? null;
|
|
265
377
|
if (parsed.projectType !== void 0) project.projectType = parsed.projectType ?? null;
|
|
@@ -268,6 +380,11 @@ const updateTimeProjectCommand = {
|
|
|
268
380
|
if (parsed.ownerUserId !== void 0) project.ownerUserId = parsed.ownerUserId ?? null;
|
|
269
381
|
if (parsed.costCenter !== void 0) project.costCenter = parsed.costCenter ?? null;
|
|
270
382
|
if (parsed.startDate !== void 0) project.startDate = parsed.startDate ?? null;
|
|
383
|
+
if (parsed.hourlyRate !== void 0) project.hourlyRate = parsed.hourlyRate ?? null;
|
|
384
|
+
if (parsed.billableByDefault !== void 0) project.billableByDefault = parsed.billableByDefault;
|
|
385
|
+
if (parsed.budgetKind !== void 0) project.budgetKind = parsed.budgetKind;
|
|
386
|
+
if (parsed.budgetValue !== void 0) project.budgetValue = parsed.budgetValue ?? null;
|
|
387
|
+
if (parsed.budgetWarnAtPercent !== void 0) project.budgetWarnAtPercent = parsed.budgetWarnAtPercent;
|
|
271
388
|
project.updatedAt = /* @__PURE__ */ new Date();
|
|
272
389
|
try {
|
|
273
390
|
await em.flush();
|
|
@@ -281,6 +398,16 @@ const updateTimeProjectCommand = {
|
|
|
281
398
|
}
|
|
282
399
|
throw err;
|
|
283
400
|
}
|
|
401
|
+
await setCustomFieldsIfAny({
|
|
402
|
+
dataEngine: ctx.container.resolve("dataEngine"),
|
|
403
|
+
entityId: E.staff.staff_time_project,
|
|
404
|
+
recordId: project.id,
|
|
405
|
+
tenantId: project.tenantId,
|
|
406
|
+
organizationId: project.organizationId,
|
|
407
|
+
values: extractCustomFieldValuesFromPayload(
|
|
408
|
+
rawInput && typeof rawInput === "object" ? rawInput : {}
|
|
409
|
+
)
|
|
410
|
+
});
|
|
284
411
|
await emitCrudSideEffects({
|
|
285
412
|
dataEngine: ctx.container.resolve("dataEngine"),
|
|
286
413
|
action: "updated",
|
|
@@ -312,8 +439,16 @@ const updateTimeProjectCommand = {
|
|
|
312
439
|
"ownerUserId",
|
|
313
440
|
"costCenter",
|
|
314
441
|
"startDate",
|
|
442
|
+
"hourlyRate",
|
|
443
|
+
"billableByDefault",
|
|
444
|
+
"budgetKind",
|
|
445
|
+
"budgetValue",
|
|
446
|
+
"budgetWarnAtPercent",
|
|
315
447
|
"deletedAt"
|
|
316
448
|
]);
|
|
449
|
+
if (JSON.stringify(before.customerSnapshot ?? null) !== JSON.stringify(after.customerSnapshot ?? null)) {
|
|
450
|
+
changes.customerSnapshot = { from: before.customerSnapshot ?? null, to: after.customerSnapshot ?? null };
|
|
451
|
+
}
|
|
317
452
|
const { translate } = await resolveTranslations();
|
|
318
453
|
return {
|
|
319
454
|
actionLabel: translate("staff.audit.timesheets.time_projects.update", "Update time project"),
|
|
@@ -341,6 +476,7 @@ const updateTimeProjectCommand = {
|
|
|
341
476
|
if (!project) return;
|
|
342
477
|
project.name = before.name;
|
|
343
478
|
project.customerId = before.customerId ?? null;
|
|
479
|
+
project.customerSnapshot = before.customerSnapshot ?? null;
|
|
344
480
|
project.code = before.code;
|
|
345
481
|
project.description = before.description ?? null;
|
|
346
482
|
project.projectType = before.projectType ?? null;
|
|
@@ -349,6 +485,11 @@ const updateTimeProjectCommand = {
|
|
|
349
485
|
project.ownerUserId = before.ownerUserId ?? null;
|
|
350
486
|
project.costCenter = before.costCenter ?? null;
|
|
351
487
|
project.startDate = before.startDate ? new Date(before.startDate) : null;
|
|
488
|
+
project.hourlyRate = before.hourlyRate ?? null;
|
|
489
|
+
project.billableByDefault = before.billableByDefault ?? true;
|
|
490
|
+
project.budgetKind = before.budgetKind ?? "none";
|
|
491
|
+
project.budgetValue = before.budgetValue ?? null;
|
|
492
|
+
project.budgetWarnAtPercent = before.budgetWarnAtPercent ?? DEFAULT_BUDGET_WARN_AT_PERCENT;
|
|
352
493
|
project.deletedAt = before.deletedAt ? new Date(before.deletedAt) : null;
|
|
353
494
|
project.updatedAt = /* @__PURE__ */ new Date();
|
|
354
495
|
await em.flush();
|
|
@@ -439,6 +580,7 @@ const deleteTimeProjectCommand = {
|
|
|
439
580
|
organizationId: before.organizationId,
|
|
440
581
|
name: before.name,
|
|
441
582
|
customerId: before.customerId ?? null,
|
|
583
|
+
customerSnapshot: before.customerSnapshot ?? null,
|
|
442
584
|
code: before.code,
|
|
443
585
|
description: before.description ?? null,
|
|
444
586
|
projectType: before.projectType ?? null,
|
|
@@ -446,6 +588,12 @@ const deleteTimeProjectCommand = {
|
|
|
446
588
|
ownerUserId: before.ownerUserId ?? null,
|
|
447
589
|
costCenter: before.costCenter ?? null,
|
|
448
590
|
startDate: before.startDate ? new Date(before.startDate) : null,
|
|
591
|
+
hourlyRate: before.hourlyRate ?? null,
|
|
592
|
+
currencyCode: before.currencyCode ?? null,
|
|
593
|
+
billableByDefault: before.billableByDefault ?? true,
|
|
594
|
+
budgetKind: before.budgetKind ?? "none",
|
|
595
|
+
budgetValue: before.budgetValue ?? null,
|
|
596
|
+
budgetWarnAtPercent: before.budgetWarnAtPercent ?? DEFAULT_BUDGET_WARN_AT_PERCENT,
|
|
449
597
|
deletedAt: null,
|
|
450
598
|
createdAt: /* @__PURE__ */ new Date(),
|
|
451
599
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -454,6 +602,7 @@ const deleteTimeProjectCommand = {
|
|
|
454
602
|
} else {
|
|
455
603
|
project.name = before.name;
|
|
456
604
|
project.customerId = before.customerId ?? null;
|
|
605
|
+
project.customerSnapshot = before.customerSnapshot ?? null;
|
|
457
606
|
project.code = before.code;
|
|
458
607
|
project.description = before.description ?? null;
|
|
459
608
|
project.projectType = before.projectType ?? null;
|
|
@@ -461,6 +610,12 @@ const deleteTimeProjectCommand = {
|
|
|
461
610
|
project.ownerUserId = before.ownerUserId ?? null;
|
|
462
611
|
project.costCenter = before.costCenter ?? null;
|
|
463
612
|
project.startDate = before.startDate ? new Date(before.startDate) : null;
|
|
613
|
+
project.hourlyRate = before.hourlyRate ?? null;
|
|
614
|
+
project.currencyCode = before.currencyCode ?? null;
|
|
615
|
+
project.billableByDefault = before.billableByDefault ?? true;
|
|
616
|
+
project.budgetKind = before.budgetKind ?? "none";
|
|
617
|
+
project.budgetValue = before.budgetValue ?? null;
|
|
618
|
+
project.budgetWarnAtPercent = before.budgetWarnAtPercent ?? DEFAULT_BUDGET_WARN_AT_PERCENT;
|
|
464
619
|
project.deletedAt = null;
|
|
465
620
|
project.updatedAt = /* @__PURE__ */ new Date();
|
|
466
621
|
}
|
|
@@ -479,6 +634,184 @@ const deleteTimeProjectCommand = {
|
|
|
479
634
|
});
|
|
480
635
|
}
|
|
481
636
|
};
|
|
637
|
+
const staffTimeProjectChangeCurrencyCommandId = "staff.timesheets.time_projects.change_currency";
|
|
638
|
+
const PROJECT_HAS_LOCKED_ENTRIES_CODE = "project_has_locked_entries";
|
|
639
|
+
const changeTimeProjectCurrencyCommandSchema = staffTimeProjectChangeCurrencySchema.extend({
|
|
640
|
+
id: z.string().uuid()
|
|
641
|
+
});
|
|
642
|
+
async function findLockedEntryBlock(em, project) {
|
|
643
|
+
const scope = { tenantId: project.tenantId, organizationId: project.organizationId };
|
|
644
|
+
const lockedEntries = await em.find(
|
|
645
|
+
StaffTimeEntry,
|
|
646
|
+
{ ...scope, timeProjectId: project.id, lockedReportId: { $ne: null }, deletedAt: null },
|
|
647
|
+
{ fields: ["id", "lockedReportId"] }
|
|
648
|
+
);
|
|
649
|
+
if (lockedEntries.length === 0) return { lockedEntryCount: 0, reports: [] };
|
|
650
|
+
const reportIds = Array.from(
|
|
651
|
+
new Set(lockedEntries.map((entry) => entry.lockedReportId).filter((value) => typeof value === "string"))
|
|
652
|
+
);
|
|
653
|
+
const reports = reportIds.length ? await em.find(
|
|
654
|
+
StaffTimeReport,
|
|
655
|
+
{ ...scope, id: { $in: reportIds } },
|
|
656
|
+
{ fields: ["id", "reference", "title"] }
|
|
657
|
+
) : [];
|
|
658
|
+
const known = new Map(reports.map((report) => [report.id, report]));
|
|
659
|
+
return {
|
|
660
|
+
lockedEntryCount: lockedEntries.length,
|
|
661
|
+
reports: reportIds.map((id) => ({
|
|
662
|
+
id,
|
|
663
|
+
reference: known.get(id)?.reference ?? null,
|
|
664
|
+
title: known.get(id)?.title ?? null
|
|
665
|
+
}))
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
async function assertNoLockedEntries(em, project) {
|
|
669
|
+
const block = await findLockedEntryBlock(em, project);
|
|
670
|
+
if (block.lockedEntryCount === 0) return;
|
|
671
|
+
const { translate } = await resolveTranslations();
|
|
672
|
+
throw new CrudHttpError(409, {
|
|
673
|
+
code: PROJECT_HAS_LOCKED_ENTRIES_CODE,
|
|
674
|
+
error: translate(
|
|
675
|
+
"staff.timesheets.errors.projectCurrencyLocked",
|
|
676
|
+
"This project has time entries frozen in a closed report. Unlock those reports before changing the currency."
|
|
677
|
+
),
|
|
678
|
+
lockedEntryCount: block.lockedEntryCount,
|
|
679
|
+
lockedReports: block.reports
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
function timeProjectCurrencyChangeEvents(previousCurrencyCode, currencyCode) {
|
|
683
|
+
return {
|
|
684
|
+
...staffTimeProjectCrudEvents,
|
|
685
|
+
buildPayload: (emitCtx) => ({
|
|
686
|
+
id: emitCtx.identifiers.id,
|
|
687
|
+
organizationId: emitCtx.identifiers.organizationId,
|
|
688
|
+
tenantId: emitCtx.identifiers.tenantId,
|
|
689
|
+
changedField: "currencyCode",
|
|
690
|
+
previousCurrencyCode,
|
|
691
|
+
currencyCode,
|
|
692
|
+
converted: false
|
|
693
|
+
})
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
const changeTimeProjectCurrencyCommand = {
|
|
697
|
+
id: staffTimeProjectChangeCurrencyCommandId,
|
|
698
|
+
async prepare(rawInput, ctx) {
|
|
699
|
+
const parsed = changeTimeProjectCurrencyCommandSchema.parse(rawInput);
|
|
700
|
+
const em = ctx.container.resolve("em");
|
|
701
|
+
const snapshot = await loadTimeProjectSnapshot(em, parsed.id, staffSnapshotScopeFromContext(ctx));
|
|
702
|
+
if (!snapshot) return {};
|
|
703
|
+
return { before: snapshot };
|
|
704
|
+
},
|
|
705
|
+
async execute(rawInput, ctx) {
|
|
706
|
+
const parsed = changeTimeProjectCurrencyCommandSchema.parse(rawInput);
|
|
707
|
+
const em = ctx.container.resolve("em").fork();
|
|
708
|
+
const scope = commandActorScope(ctx);
|
|
709
|
+
const project = await findOneWithDecryption(
|
|
710
|
+
em,
|
|
711
|
+
StaffTimeProject,
|
|
712
|
+
applyScopeToWhere({ id: parsed.id, deletedAt: null }, scope),
|
|
713
|
+
void 0,
|
|
714
|
+
scopeForDecryption(scope)
|
|
715
|
+
);
|
|
716
|
+
if (!project) {
|
|
717
|
+
const { translate } = await resolveTranslations();
|
|
718
|
+
throw new CrudHttpError(404, {
|
|
719
|
+
error: translate("staff.timesheets.errors.projectNotFound", "Time project not found or not accessible.")
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
ensureTenantScope(ctx, project.tenantId);
|
|
723
|
+
ensureOrganizationScope(ctx, project.organizationId);
|
|
724
|
+
const previousCurrencyCode = project.currencyCode ?? null;
|
|
725
|
+
await withAtomicFlush(
|
|
726
|
+
em,
|
|
727
|
+
[
|
|
728
|
+
() => assertNoLockedEntries(em, project),
|
|
729
|
+
() => {
|
|
730
|
+
project.currencyCode = parsed.currencyCode;
|
|
731
|
+
project.updatedAt = /* @__PURE__ */ new Date();
|
|
732
|
+
}
|
|
733
|
+
],
|
|
734
|
+
{ transaction: true, label: staffTimeProjectChangeCurrencyCommandId }
|
|
735
|
+
);
|
|
736
|
+
await emitCrudSideEffects({
|
|
737
|
+
dataEngine: ctx.container.resolve("dataEngine"),
|
|
738
|
+
action: "updated",
|
|
739
|
+
entity: project,
|
|
740
|
+
identifiers: {
|
|
741
|
+
id: project.id,
|
|
742
|
+
organizationId: project.organizationId,
|
|
743
|
+
tenantId: project.tenantId
|
|
744
|
+
},
|
|
745
|
+
events: timeProjectCurrencyChangeEvents(previousCurrencyCode, parsed.currencyCode),
|
|
746
|
+
indexer: timeProjectCrudIndexer
|
|
747
|
+
});
|
|
748
|
+
return {
|
|
749
|
+
timeProjectId: project.id,
|
|
750
|
+
currencyCode: parsed.currencyCode,
|
|
751
|
+
previousCurrencyCode
|
|
752
|
+
};
|
|
753
|
+
},
|
|
754
|
+
buildLog: async ({ snapshots, ctx }) => {
|
|
755
|
+
const before = snapshots.before;
|
|
756
|
+
if (!before) return null;
|
|
757
|
+
const em = ctx.container.resolve("em").fork();
|
|
758
|
+
const after = await loadTimeProjectSnapshot(em, before.id, staffSnapshotScopeFromSnapshot(before));
|
|
759
|
+
if (!after) return null;
|
|
760
|
+
const changes = buildChanges(
|
|
761
|
+
before,
|
|
762
|
+
after,
|
|
763
|
+
["currencyCode"]
|
|
764
|
+
);
|
|
765
|
+
const { translate } = await resolveTranslations();
|
|
766
|
+
return {
|
|
767
|
+
actionLabel: translate("staff.audit.timesheets.time_projects.change_currency", "Change time project currency"),
|
|
768
|
+
resourceKind: "staff.timesheets.time_project",
|
|
769
|
+
resourceId: before.id,
|
|
770
|
+
tenantId: before.tenantId,
|
|
771
|
+
organizationId: before.organizationId,
|
|
772
|
+
snapshotBefore: before,
|
|
773
|
+
snapshotAfter: after,
|
|
774
|
+
changes,
|
|
775
|
+
payload: {
|
|
776
|
+
undo: {
|
|
777
|
+
before,
|
|
778
|
+
after
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
},
|
|
783
|
+
undo: async ({ logEntry, ctx }) => {
|
|
784
|
+
const payload = extractUndoPayload(logEntry);
|
|
785
|
+
const before = payload?.before;
|
|
786
|
+
if (!before) return;
|
|
787
|
+
const em = ctx.container.resolve("em").fork();
|
|
788
|
+
const project = await em.findOne(StaffTimeProject, scopedStaffSnapshotWhere(before.id, staffSnapshotScopeFromSnapshot(before)));
|
|
789
|
+
if (!project) return;
|
|
790
|
+
await withAtomicFlush(
|
|
791
|
+
em,
|
|
792
|
+
[
|
|
793
|
+
() => assertNoLockedEntries(em, project),
|
|
794
|
+
() => {
|
|
795
|
+
project.currencyCode = before.currencyCode ?? null;
|
|
796
|
+
project.updatedAt = /* @__PURE__ */ new Date();
|
|
797
|
+
}
|
|
798
|
+
],
|
|
799
|
+
{ transaction: true, label: `${staffTimeProjectChangeCurrencyCommandId}.undo` }
|
|
800
|
+
);
|
|
801
|
+
await emitCrudUndoSideEffects({
|
|
802
|
+
dataEngine: ctx.container.resolve("dataEngine"),
|
|
803
|
+
action: "updated",
|
|
804
|
+
entity: project,
|
|
805
|
+
identifiers: {
|
|
806
|
+
id: project.id,
|
|
807
|
+
organizationId: project.organizationId,
|
|
808
|
+
tenantId: project.tenantId
|
|
809
|
+
},
|
|
810
|
+
events: staffTimeProjectCrudEvents,
|
|
811
|
+
indexer: timeProjectCrudIndexer
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
};
|
|
482
815
|
const assignTimeProjectMemberCommand = {
|
|
483
816
|
id: "staff.timesheets.time_project_members.assign",
|
|
484
817
|
async execute(rawInput, ctx) {
|
|
@@ -595,6 +928,110 @@ const assignTimeProjectMemberCommand = {
|
|
|
595
928
|
indexer: timeProjectMemberCrudIndexer
|
|
596
929
|
})
|
|
597
930
|
};
|
|
931
|
+
const updateTimeProjectMemberCommandSchema = staffTimeProjectMemberUpdateSchema.extend({
|
|
932
|
+
timeProjectId: z.string().uuid().optional()
|
|
933
|
+
});
|
|
934
|
+
const updateTimeProjectMemberCommand = {
|
|
935
|
+
id: "staff.timesheets.time_project_members.update",
|
|
936
|
+
async prepare(rawInput, ctx) {
|
|
937
|
+
const parsed = updateTimeProjectMemberCommandSchema.parse(rawInput);
|
|
938
|
+
const em = ctx.container.resolve("em");
|
|
939
|
+
const snapshot = await loadTimeProjectMemberSnapshot(em, parsed.id, staffSnapshotScopeFromContext(ctx));
|
|
940
|
+
if (!snapshot) return {};
|
|
941
|
+
return { before: snapshot };
|
|
942
|
+
},
|
|
943
|
+
async execute(rawInput, ctx) {
|
|
944
|
+
const parsed = updateTimeProjectMemberCommandSchema.parse(rawInput);
|
|
945
|
+
const em = ctx.container.resolve("em").fork();
|
|
946
|
+
const scope = commandActorScope(ctx);
|
|
947
|
+
const member = await findOneWithDecryption(
|
|
948
|
+
em,
|
|
949
|
+
StaffTimeProjectMember,
|
|
950
|
+
applyScopeToWhere(
|
|
951
|
+
{
|
|
952
|
+
id: parsed.id,
|
|
953
|
+
deletedAt: null,
|
|
954
|
+
...parsed.timeProjectId ? { timeProjectId: parsed.timeProjectId } : {}
|
|
955
|
+
},
|
|
956
|
+
scope
|
|
957
|
+
),
|
|
958
|
+
void 0,
|
|
959
|
+
scopeForDecryption(scope)
|
|
960
|
+
);
|
|
961
|
+
if (!member) {
|
|
962
|
+
const { translate } = await resolveTranslations();
|
|
963
|
+
throw new CrudHttpError(404, {
|
|
964
|
+
error: translate("staff.timesheets.errors.memberNotFound", "Time project member not found or not accessible.")
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
ensureTenantScope(ctx, member.tenantId);
|
|
968
|
+
ensureOrganizationScope(ctx, member.organizationId);
|
|
969
|
+
if (parsed.role !== void 0) member.role = parsed.role ?? null;
|
|
970
|
+
if (parsed.status !== void 0) member.status = parsed.status;
|
|
971
|
+
if (parsed.assignedEndDate !== void 0) member.assignedEndDate = parsed.assignedEndDate ?? null;
|
|
972
|
+
member.updatedAt = /* @__PURE__ */ new Date();
|
|
973
|
+
await em.flush();
|
|
974
|
+
await emitCrudSideEffects({
|
|
975
|
+
dataEngine: ctx.container.resolve("dataEngine"),
|
|
976
|
+
action: "updated",
|
|
977
|
+
entity: member,
|
|
978
|
+
identifiers: { id: member.id, organizationId: member.organizationId, tenantId: member.tenantId },
|
|
979
|
+
events: staffTimeProjectMemberCrudEvents,
|
|
980
|
+
indexer: timeProjectMemberCrudIndexer
|
|
981
|
+
});
|
|
982
|
+
return { timeProjectMemberId: member.id };
|
|
983
|
+
},
|
|
984
|
+
buildLog: async ({ snapshots, ctx }) => {
|
|
985
|
+
const before = snapshots.before;
|
|
986
|
+
if (!before) return null;
|
|
987
|
+
const em = ctx.container.resolve("em").fork();
|
|
988
|
+
const after = await loadTimeProjectMemberSnapshot(em, before.id, staffSnapshotScopeFromSnapshot(before));
|
|
989
|
+
if (!after) return null;
|
|
990
|
+
const changes = buildChanges(before, after, [
|
|
991
|
+
"role",
|
|
992
|
+
"status",
|
|
993
|
+
"assignedEndDate"
|
|
994
|
+
]);
|
|
995
|
+
const { translate } = await resolveTranslations();
|
|
996
|
+
return {
|
|
997
|
+
actionLabel: translate("staff.audit.timesheets.time_project_members.update", "Update time project member"),
|
|
998
|
+
resourceKind: "staff.timesheets.time_project_member",
|
|
999
|
+
resourceId: before.id,
|
|
1000
|
+
tenantId: before.tenantId,
|
|
1001
|
+
organizationId: before.organizationId,
|
|
1002
|
+
snapshotBefore: before,
|
|
1003
|
+
snapshotAfter: after,
|
|
1004
|
+
changes,
|
|
1005
|
+
payload: {
|
|
1006
|
+
undo: {
|
|
1007
|
+
before,
|
|
1008
|
+
after
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
},
|
|
1013
|
+
undo: async ({ logEntry, ctx }) => {
|
|
1014
|
+
const payload = extractUndoPayload(logEntry);
|
|
1015
|
+
const before = payload?.before;
|
|
1016
|
+
if (!before) return;
|
|
1017
|
+
const em = ctx.container.resolve("em").fork();
|
|
1018
|
+
const member = await em.findOne(StaffTimeProjectMember, scopedStaffSnapshotWhere(before.id, staffSnapshotScopeFromSnapshot(before)));
|
|
1019
|
+
if (!member) return;
|
|
1020
|
+
member.role = before.role ?? null;
|
|
1021
|
+
member.status = before.status ?? "active";
|
|
1022
|
+
member.assignedEndDate = before.assignedEndDate ? new Date(before.assignedEndDate) : null;
|
|
1023
|
+
member.updatedAt = /* @__PURE__ */ new Date();
|
|
1024
|
+
await em.flush();
|
|
1025
|
+
await emitCrudUndoSideEffects({
|
|
1026
|
+
dataEngine: ctx.container.resolve("dataEngine"),
|
|
1027
|
+
action: "updated",
|
|
1028
|
+
entity: member,
|
|
1029
|
+
identifiers: { id: member.id, organizationId: member.organizationId, tenantId: member.tenantId },
|
|
1030
|
+
events: staffTimeProjectMemberCrudEvents,
|
|
1031
|
+
indexer: timeProjectMemberCrudIndexer
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
598
1035
|
const unassignTimeProjectMemberCommand = {
|
|
599
1036
|
id: "staff.timesheets.time_project_members.unassign",
|
|
600
1037
|
async prepare(input, ctx) {
|
|
@@ -698,6 +1135,12 @@ const unassignTimeProjectMemberCommand = {
|
|
|
698
1135
|
registerCommand(createTimeProjectCommand);
|
|
699
1136
|
registerCommand(updateTimeProjectCommand);
|
|
700
1137
|
registerCommand(deleteTimeProjectCommand);
|
|
1138
|
+
registerCommand(changeTimeProjectCurrencyCommand);
|
|
701
1139
|
registerCommand(assignTimeProjectMemberCommand);
|
|
1140
|
+
registerCommand(updateTimeProjectMemberCommand);
|
|
702
1141
|
registerCommand(unassignTimeProjectMemberCommand);
|
|
1142
|
+
export {
|
|
1143
|
+
PROJECT_HAS_LOCKED_ENTRIES_CODE,
|
|
1144
|
+
staffTimeProjectChangeCurrencyCommandId
|
|
1145
|
+
};
|
|
703
1146
|
//# sourceMappingURL=timesheets-projects.js.map
|