@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,809 @@
|
|
|
1
|
+
import { findWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
2
|
+
import { User } from "@open-mercato/core/modules/auth/data/entities";
|
|
3
|
+
import { CustomerEntity } from "@open-mercato/core/modules/customers/data/entities";
|
|
4
|
+
import {
|
|
5
|
+
StaffTeamMember,
|
|
6
|
+
StaffTimeEntry,
|
|
7
|
+
StaffTimeEntryTag,
|
|
8
|
+
StaffTimeProject,
|
|
9
|
+
StaffTimeProjectMember,
|
|
10
|
+
StaffTimeReport,
|
|
11
|
+
StaffTimeReportEntry,
|
|
12
|
+
StaffTimeReportEvent,
|
|
13
|
+
StaffTimeReportProject,
|
|
14
|
+
StaffTimeTag,
|
|
15
|
+
StaffTimeTask,
|
|
16
|
+
StaffTimeTaskComment,
|
|
17
|
+
StaffTimeTaskTag
|
|
18
|
+
} from "../data/entities.js";
|
|
19
|
+
import { seedProjectTaskStatuses } from "./timesheets-tasks/seedProjectStatuses.js";
|
|
20
|
+
import { formatTaskReference } from "./timesheets-tasks/taskReference.js";
|
|
21
|
+
import { allocateReportReference, highestReportSequenceNumber } from "./timesheets-reports/reportReference.js";
|
|
22
|
+
import { entryAmount, round2, sumAmounts } from "./time-tracking/cost.js";
|
|
23
|
+
import { DEFAULT_ROUNDING_SETTINGS, roundMinutes } from "./time-tracking/rounding.js";
|
|
24
|
+
const DEMO_TAGS = [
|
|
25
|
+
{ slug: "client-call", label: "Client call", color: "blue" },
|
|
26
|
+
{ slug: "development", label: "Development", color: "indigo" },
|
|
27
|
+
{ slug: "bugfix", label: "Bugfix", color: "red" },
|
|
28
|
+
{ slug: "research", label: "Research", color: "purple" },
|
|
29
|
+
{ slug: "internal", label: "Internal", color: "slate" }
|
|
30
|
+
];
|
|
31
|
+
const DEMO_PROJECTS = [
|
|
32
|
+
{
|
|
33
|
+
code: "APOLLO",
|
|
34
|
+
name: "Apollo \u2014 Website Redesign",
|
|
35
|
+
description: "Full redesign of the public site and booking flow, delivered in three milestones with a fixed launch date.",
|
|
36
|
+
projectType: "Fixed scope",
|
|
37
|
+
color: "blue",
|
|
38
|
+
status: "active",
|
|
39
|
+
hourlyRate: 150,
|
|
40
|
+
currencyCode: "USD",
|
|
41
|
+
billableByDefault: true,
|
|
42
|
+
budgetKind: "hours",
|
|
43
|
+
budgetValue: 720,
|
|
44
|
+
costCenter: "CC-100",
|
|
45
|
+
customerIndex: 0,
|
|
46
|
+
startedDaysAgo: 84,
|
|
47
|
+
memberIndexes: [0, 1, 3],
|
|
48
|
+
memberRoles: ["Project manager", "Frontend engineer", "UX designer"]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
code: "ATLAS",
|
|
52
|
+
name: "Atlas \u2014 Data Platform Integration",
|
|
53
|
+
description: "Ingest pipeline, warehouse modelling and a reporting API against the customer analytics platform.",
|
|
54
|
+
projectType: "Time & materials",
|
|
55
|
+
color: "emerald",
|
|
56
|
+
status: "active",
|
|
57
|
+
hourlyRate: 175,
|
|
58
|
+
currencyCode: "USD",
|
|
59
|
+
billableByDefault: true,
|
|
60
|
+
budgetKind: "amount",
|
|
61
|
+
budgetValue: 1e5,
|
|
62
|
+
costCenter: "CC-200",
|
|
63
|
+
customerIndex: 1,
|
|
64
|
+
startedDaysAgo: 63,
|
|
65
|
+
memberIndexes: [0, 4, 2],
|
|
66
|
+
memberRoles: ["Tech lead", "DevOps engineer", "Product manager"]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
code: "ORBIT",
|
|
70
|
+
name: "Orbit \u2014 Support Retainer",
|
|
71
|
+
description: "Monthly retainer covering incident response, small enhancements and a standing weekly check-in call.",
|
|
72
|
+
projectType: "Retainer",
|
|
73
|
+
color: "orange",
|
|
74
|
+
status: "active",
|
|
75
|
+
hourlyRate: 120,
|
|
76
|
+
currencyCode: "USD",
|
|
77
|
+
billableByDefault: true,
|
|
78
|
+
budgetKind: "hours",
|
|
79
|
+
budgetValue: 360,
|
|
80
|
+
costCenter: "CC-300",
|
|
81
|
+
customerIndex: 2,
|
|
82
|
+
startedDaysAgo: 70,
|
|
83
|
+
memberIndexes: [4, 1],
|
|
84
|
+
memberRoles: ["Support lead", "Frontend engineer"]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
code: "NOVA",
|
|
88
|
+
name: "Nova \u2014 ERP Migration Discovery",
|
|
89
|
+
description: "Discovery phase for the ERP migration. Paused while the customer finalises the vendor short-list.",
|
|
90
|
+
projectType: "Discovery",
|
|
91
|
+
color: "purple",
|
|
92
|
+
status: "on_hold",
|
|
93
|
+
hourlyRate: 165,
|
|
94
|
+
currencyCode: "USD",
|
|
95
|
+
billableByDefault: true,
|
|
96
|
+
budgetKind: "hours",
|
|
97
|
+
budgetValue: 240,
|
|
98
|
+
costCenter: "CC-400",
|
|
99
|
+
customerIndex: 0,
|
|
100
|
+
startedDaysAgo: 49,
|
|
101
|
+
memberIndexes: [2, 0],
|
|
102
|
+
memberRoles: ["Product manager", "Solution architect"]
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
const DEMO_TASKS = {
|
|
106
|
+
APOLLO: [
|
|
107
|
+
{
|
|
108
|
+
statusSlug: "done",
|
|
109
|
+
title: "Discovery workshop with the client",
|
|
110
|
+
description: "Two half-day sessions covering the current booking funnel and the drop-off points.",
|
|
111
|
+
assigneeIndex: 0,
|
|
112
|
+
tagSlugs: ["client-call", "research"],
|
|
113
|
+
comments: ["Recording and notes shared with the client the same afternoon."]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
statusSlug: "done",
|
|
117
|
+
title: "Information architecture and sitemap",
|
|
118
|
+
description: "Consolidate 40 pages into 18 and agree the new navigation.",
|
|
119
|
+
assigneeIndex: 3,
|
|
120
|
+
tagSlugs: ["research"]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
statusSlug: "in-review",
|
|
124
|
+
title: "Design system and component library",
|
|
125
|
+
description: "Tokens, typography scale and the twelve components the new pages are built from.",
|
|
126
|
+
assigneeIndex: 3,
|
|
127
|
+
tagSlugs: ["development"],
|
|
128
|
+
comments: ["Waiting on brand sign-off for the secondary palette."],
|
|
129
|
+
subtasks: [
|
|
130
|
+
{ statusSlug: "done", title: "Colour and typography tokens", assigneeIndex: 3 },
|
|
131
|
+
{ statusSlug: "in-review", title: "Form and input components", assigneeIndex: 1 }
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
statusSlug: "in-progress",
|
|
136
|
+
title: "Booking flow rebuild",
|
|
137
|
+
description: "Rebuild the four-step booking flow on the new component library.",
|
|
138
|
+
assigneeIndex: 1,
|
|
139
|
+
tagSlugs: ["development"],
|
|
140
|
+
subtasks: [
|
|
141
|
+
{ statusSlug: "done", title: "Step 1 \u2014 date and party size", assigneeIndex: 1 },
|
|
142
|
+
{ statusSlug: "in-progress", title: "Step 2 \u2014 table selection", assigneeIndex: 1 },
|
|
143
|
+
{ statusSlug: "backlog", title: "Step 3 \u2014 guest details", assigneeIndex: null }
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
statusSlug: "in-progress",
|
|
148
|
+
title: "Fix layout shift on the gallery page",
|
|
149
|
+
description: "Images without intrinsic dimensions push the footer around on first paint.",
|
|
150
|
+
assigneeIndex: 1,
|
|
151
|
+
tagSlugs: ["bugfix"]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
statusSlug: "backlog",
|
|
155
|
+
title: "Analytics and conversion tracking",
|
|
156
|
+
description: "Event map for the new funnel plus the dashboard the client reviews weekly.",
|
|
157
|
+
assigneeIndex: 0,
|
|
158
|
+
tagSlugs: ["development"]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
statusSlug: "backlog",
|
|
162
|
+
title: "Content migration",
|
|
163
|
+
description: "Move and re-edit the existing copy into the new page templates.",
|
|
164
|
+
assigneeIndex: null,
|
|
165
|
+
tagSlugs: []
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
ATLAS: [
|
|
169
|
+
{
|
|
170
|
+
statusSlug: "done",
|
|
171
|
+
title: "Source system audit",
|
|
172
|
+
description: "Catalogue the six source systems, their volumes and their refresh windows.",
|
|
173
|
+
assigneeIndex: 0,
|
|
174
|
+
tagSlugs: ["research"]
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
statusSlug: "in-progress",
|
|
178
|
+
title: "Ingest pipeline",
|
|
179
|
+
description: "Incremental loads with replay, running on the customer scheduler.",
|
|
180
|
+
assigneeIndex: 4,
|
|
181
|
+
tagSlugs: ["development"],
|
|
182
|
+
comments: [
|
|
183
|
+
"Replay from an arbitrary watermark works; still tuning the batch size for the largest table."
|
|
184
|
+
],
|
|
185
|
+
subtasks: [
|
|
186
|
+
{ statusSlug: "done", title: "Connector framework", assigneeIndex: 4 },
|
|
187
|
+
{ statusSlug: "in-progress", title: "Incremental watermarks", assigneeIndex: 4 }
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
statusSlug: "in-progress",
|
|
192
|
+
title: "Warehouse dimensional model",
|
|
193
|
+
description: "Star schema for orders, customers and merchandising decisions.",
|
|
194
|
+
assigneeIndex: 0,
|
|
195
|
+
tagSlugs: ["development"]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
statusSlug: "in-review",
|
|
199
|
+
title: "Reporting API contract",
|
|
200
|
+
description: "The endpoints the customer BI layer reads, versioned and documented.",
|
|
201
|
+
assigneeIndex: 2,
|
|
202
|
+
tagSlugs: ["client-call"]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
statusSlug: "backlog",
|
|
206
|
+
title: "Data quality monitors",
|
|
207
|
+
description: "Freshness, row-count and null-rate checks with alerting into the customer channel.",
|
|
208
|
+
assigneeIndex: 4,
|
|
209
|
+
tagSlugs: ["development"]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
statusSlug: "backlog",
|
|
213
|
+
title: "Handover documentation",
|
|
214
|
+
description: "Runbook, architecture note and the on-call escalation path.",
|
|
215
|
+
assigneeIndex: null,
|
|
216
|
+
tagSlugs: ["internal"]
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
ORBIT: [
|
|
220
|
+
{
|
|
221
|
+
statusSlug: "done",
|
|
222
|
+
title: "March incident \u2014 checkout timeouts",
|
|
223
|
+
description: "Connection pool exhaustion under the promotion traffic spike.",
|
|
224
|
+
assigneeIndex: 4,
|
|
225
|
+
tagSlugs: ["bugfix"],
|
|
226
|
+
comments: ["Root cause and the pool sizing change written up for the customer."]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
statusSlug: "in-progress",
|
|
230
|
+
title: "Monthly dependency and security updates",
|
|
231
|
+
description: "Patch level, CVE review and a staged rollout.",
|
|
232
|
+
assigneeIndex: 4,
|
|
233
|
+
tagSlugs: ["internal"]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
statusSlug: "in-progress",
|
|
237
|
+
title: "Weekly check-in call",
|
|
238
|
+
description: "Standing Thursday call \u2014 backlog triage and the week ahead.",
|
|
239
|
+
assigneeIndex: 1,
|
|
240
|
+
tagSlugs: ["client-call"]
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
statusSlug: "backlog",
|
|
244
|
+
title: "Search relevance tuning",
|
|
245
|
+
description: "Synonyms and boosting for the ten highest-volume queries.",
|
|
246
|
+
assigneeIndex: 1,
|
|
247
|
+
tagSlugs: ["development"]
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
NOVA: [
|
|
251
|
+
{
|
|
252
|
+
statusSlug: "done",
|
|
253
|
+
title: "Stakeholder interviews",
|
|
254
|
+
description: "Nine interviews across finance, warehouse and customer service.",
|
|
255
|
+
assigneeIndex: 2,
|
|
256
|
+
tagSlugs: ["client-call", "research"]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
statusSlug: "in-review",
|
|
260
|
+
title: "Process gap analysis",
|
|
261
|
+
description: "Where the current ERP is worked around, and what that costs per month.",
|
|
262
|
+
assigneeIndex: 2,
|
|
263
|
+
tagSlugs: ["research"],
|
|
264
|
+
comments: ["Draft with the client; feedback expected once the vendor short-list closes."]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
statusSlug: "backlog",
|
|
268
|
+
title: "Migration options and estimates",
|
|
269
|
+
description: "Three options with cost, risk and a rough delivery window each.",
|
|
270
|
+
assigneeIndex: 0,
|
|
271
|
+
tagSlugs: []
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
};
|
|
275
|
+
const ENTRY_NOTES = [
|
|
276
|
+
"Pairing session on the open items",
|
|
277
|
+
"Implementation and self-review",
|
|
278
|
+
"Client call and follow-up notes",
|
|
279
|
+
"Code review and feedback round",
|
|
280
|
+
"Debugging the reported regression",
|
|
281
|
+
"Refinement and estimates for the next sprint",
|
|
282
|
+
"Documentation and handover notes",
|
|
283
|
+
"Environment and deployment work",
|
|
284
|
+
"Design review with the team",
|
|
285
|
+
"Investigating the reported edge case"
|
|
286
|
+
];
|
|
287
|
+
const NONBILLABLE_NOTES = [
|
|
288
|
+
"Internal team sync",
|
|
289
|
+
"Knowledge sharing session",
|
|
290
|
+
"Onboarding a new team member"
|
|
291
|
+
];
|
|
292
|
+
const PREFERRED_MEMBER_NAMES = [
|
|
293
|
+
"Alex Chen",
|
|
294
|
+
"Priya Nair",
|
|
295
|
+
"Marta Lopez",
|
|
296
|
+
"Samir Haddad",
|
|
297
|
+
"Jordan Kim"
|
|
298
|
+
];
|
|
299
|
+
const WEEKS_OF_HISTORY = 10;
|
|
300
|
+
function createRandom(seed) {
|
|
301
|
+
let state = seed >>> 0;
|
|
302
|
+
return () => {
|
|
303
|
+
state = Math.imul(state, 1664525) + 1013904223 >>> 0;
|
|
304
|
+
return state / 4294967296;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function pick(random, values) {
|
|
308
|
+
return values[Math.floor(random() * values.length) % values.length];
|
|
309
|
+
}
|
|
310
|
+
function startOfUtcDay(date) {
|
|
311
|
+
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()));
|
|
312
|
+
}
|
|
313
|
+
function addDays(date, days) {
|
|
314
|
+
const next = new Date(date.getTime());
|
|
315
|
+
next.setUTCDate(next.getUTCDate() + days);
|
|
316
|
+
return next;
|
|
317
|
+
}
|
|
318
|
+
function isWeekend(date) {
|
|
319
|
+
const day = date.getUTCDay();
|
|
320
|
+
return day === 0 || day === 6;
|
|
321
|
+
}
|
|
322
|
+
function atMinutes(date, minutesFromMidnight) {
|
|
323
|
+
return new Date(date.getTime() + minutesFromMidnight * 6e4);
|
|
324
|
+
}
|
|
325
|
+
async function resolveCustomers(em, scope) {
|
|
326
|
+
const fallback = [
|
|
327
|
+
{ id: null, name: "Copperleaf Design Co." },
|
|
328
|
+
{ id: null, name: "Harborview Analytics" },
|
|
329
|
+
{ id: null, name: "Northwind Retail Group" }
|
|
330
|
+
];
|
|
331
|
+
try {
|
|
332
|
+
const entities = await findWithDecryption(
|
|
333
|
+
em,
|
|
334
|
+
CustomerEntity,
|
|
335
|
+
{ tenantId: scope.tenantId, organizationId: scope.organizationId, kind: "company", deletedAt: null },
|
|
336
|
+
{ limit: 25 },
|
|
337
|
+
scope
|
|
338
|
+
);
|
|
339
|
+
const named = entities.map((entity) => ({ id: entity.id, name: (entity.displayName ?? "").trim() })).filter((entity) => entity.name.length > 0).sort((left, right) => left.name.localeCompare(right.name));
|
|
340
|
+
if (named.length === 0) return fallback;
|
|
341
|
+
return fallback.map((entry, index) => named[index % named.length] ?? entry);
|
|
342
|
+
} catch {
|
|
343
|
+
return fallback;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
async function resolveMembers(em, scope) {
|
|
347
|
+
const members = await findWithDecryption(
|
|
348
|
+
em,
|
|
349
|
+
StaffTeamMember,
|
|
350
|
+
{ tenantId: scope.tenantId, organizationId: scope.organizationId, isActive: true, deletedAt: null },
|
|
351
|
+
{ limit: 50 },
|
|
352
|
+
scope
|
|
353
|
+
);
|
|
354
|
+
if (members.length === 0) return [];
|
|
355
|
+
const byName = new Map(members.map((member) => [(member.displayName ?? "").trim(), member]));
|
|
356
|
+
const preferred = PREFERRED_MEMBER_NAMES.map((name) => byName.get(name)).filter(
|
|
357
|
+
(member) => Boolean(member)
|
|
358
|
+
);
|
|
359
|
+
const remaining = members.filter((member) => !preferred.includes(member));
|
|
360
|
+
const ordered = [...preferred, ...remaining];
|
|
361
|
+
return ordered;
|
|
362
|
+
}
|
|
363
|
+
function memberAt(members, index) {
|
|
364
|
+
return members[index % members.length];
|
|
365
|
+
}
|
|
366
|
+
async function seedStaffTimeTrackingExamples(em, scope) {
|
|
367
|
+
const codes = DEMO_PROJECTS.map((project) => project.code);
|
|
368
|
+
const existing = await em.find(StaffTimeProject, {
|
|
369
|
+
tenantId: scope.tenantId,
|
|
370
|
+
organizationId: scope.organizationId,
|
|
371
|
+
code: { $in: codes },
|
|
372
|
+
deletedAt: null
|
|
373
|
+
});
|
|
374
|
+
if (existing.length > 0) return false;
|
|
375
|
+
const members = await resolveMembers(em, scope);
|
|
376
|
+
if (members.length === 0) return false;
|
|
377
|
+
const customers = await resolveCustomers(em, scope);
|
|
378
|
+
const users = await findWithDecryption(
|
|
379
|
+
em,
|
|
380
|
+
User,
|
|
381
|
+
{ tenantId: scope.tenantId, organizationId: scope.organizationId, deletedAt: null },
|
|
382
|
+
{ limit: 10 },
|
|
383
|
+
scope
|
|
384
|
+
);
|
|
385
|
+
const actorUserId = [...users].sort((left, right) => (left.email ?? "").localeCompare(right.email ?? ""))[0]?.id ?? null;
|
|
386
|
+
const random = createRandom(20260812);
|
|
387
|
+
const now = /* @__PURE__ */ new Date();
|
|
388
|
+
const today = startOfUtcDay(now);
|
|
389
|
+
const tagBySlug = /* @__PURE__ */ new Map();
|
|
390
|
+
for (const seed of DEMO_TAGS) {
|
|
391
|
+
const tag = em.create(StaffTimeTag, {
|
|
392
|
+
tenantId: scope.tenantId,
|
|
393
|
+
organizationId: scope.organizationId,
|
|
394
|
+
slug: seed.slug,
|
|
395
|
+
label: seed.label,
|
|
396
|
+
color: seed.color,
|
|
397
|
+
createdAt: now,
|
|
398
|
+
updatedAt: now,
|
|
399
|
+
deletedAt: null
|
|
400
|
+
});
|
|
401
|
+
em.persist(tag);
|
|
402
|
+
tagBySlug.set(seed.slug, tag);
|
|
403
|
+
}
|
|
404
|
+
await em.flush();
|
|
405
|
+
const contexts = [];
|
|
406
|
+
for (const seed of DEMO_PROJECTS) {
|
|
407
|
+
const customer = customers[seed.customerIndex] ?? customers[0];
|
|
408
|
+
const startDate = addDays(today, -seed.startedDaysAgo);
|
|
409
|
+
const project = em.create(StaffTimeProject, {
|
|
410
|
+
tenantId: scope.tenantId,
|
|
411
|
+
organizationId: scope.organizationId,
|
|
412
|
+
name: seed.name,
|
|
413
|
+
code: seed.code,
|
|
414
|
+
description: seed.description,
|
|
415
|
+
projectType: seed.projectType,
|
|
416
|
+
color: seed.color,
|
|
417
|
+
status: seed.status,
|
|
418
|
+
customerId: customer.id,
|
|
419
|
+
customerSnapshot: { name: customer.name, kind: "company" },
|
|
420
|
+
ownerUserId: actorUserId,
|
|
421
|
+
costCenter: seed.costCenter,
|
|
422
|
+
startDate,
|
|
423
|
+
hourlyRate: seed.hourlyRate.toFixed(4),
|
|
424
|
+
currencyCode: seed.currencyCode,
|
|
425
|
+
billableByDefault: seed.billableByDefault,
|
|
426
|
+
budgetKind: seed.budgetKind,
|
|
427
|
+
budgetValue: seed.budgetValue === null ? null : seed.budgetValue.toFixed(4),
|
|
428
|
+
budgetWarnAtPercent: 80,
|
|
429
|
+
budgetAlertedAtPercent: null,
|
|
430
|
+
createdAt: startDate,
|
|
431
|
+
updatedAt: now,
|
|
432
|
+
deletedAt: null
|
|
433
|
+
});
|
|
434
|
+
em.persist(project);
|
|
435
|
+
await em.flush();
|
|
436
|
+
const statuses = seedProjectTaskStatuses(
|
|
437
|
+
em,
|
|
438
|
+
{ tenantId: scope.tenantId, organizationId: scope.organizationId, timeProjectId: project.id },
|
|
439
|
+
(_key, fallback) => fallback
|
|
440
|
+
);
|
|
441
|
+
await em.flush();
|
|
442
|
+
const statusBySlug = new Map(statuses.map((status) => [status.slug, status]));
|
|
443
|
+
const memberIds = [];
|
|
444
|
+
seed.memberIndexes.forEach((memberIndex, position) => {
|
|
445
|
+
const member = memberAt(members, memberIndex);
|
|
446
|
+
if (memberIds.includes(member.id)) return;
|
|
447
|
+
memberIds.push(member.id);
|
|
448
|
+
em.persist(
|
|
449
|
+
em.create(StaffTimeProjectMember, {
|
|
450
|
+
tenantId: scope.tenantId,
|
|
451
|
+
organizationId: scope.organizationId,
|
|
452
|
+
timeProjectId: project.id,
|
|
453
|
+
staffMemberId: member.id,
|
|
454
|
+
role: seed.memberRoles[position] ?? "Consultant",
|
|
455
|
+
status: "active",
|
|
456
|
+
// The lead and the first collaborator are pinned into the weekly grid so
|
|
457
|
+
// the grid has rows the moment it opens.
|
|
458
|
+
showInGrid: position < 2,
|
|
459
|
+
assignedStartDate: startDate,
|
|
460
|
+
assignedEndDate: null,
|
|
461
|
+
createdAt: startDate,
|
|
462
|
+
updatedAt: now,
|
|
463
|
+
deletedAt: null
|
|
464
|
+
})
|
|
465
|
+
);
|
|
466
|
+
});
|
|
467
|
+
await em.flush();
|
|
468
|
+
const taskSeeds = DEMO_TASKS[seed.code] ?? [];
|
|
469
|
+
const tasks = [];
|
|
470
|
+
const tasksByMemberId = /* @__PURE__ */ new Map();
|
|
471
|
+
let sequenceNumber = 0;
|
|
472
|
+
const registerTask = (task, assigneeId) => {
|
|
473
|
+
tasks.push(task);
|
|
474
|
+
if (!assigneeId) return;
|
|
475
|
+
const bucket = tasksByMemberId.get(assigneeId) ?? [];
|
|
476
|
+
bucket.push(task);
|
|
477
|
+
tasksByMemberId.set(assigneeId, bucket);
|
|
478
|
+
};
|
|
479
|
+
for (const taskSeed of taskSeeds) {
|
|
480
|
+
const status = statusBySlug.get(taskSeed.statusSlug) ?? statuses[0];
|
|
481
|
+
const assignee = taskSeed.assigneeIndex === null ? null : memberAt(members, seed.memberIndexes[taskSeed.assigneeIndex] ?? taskSeed.assigneeIndex);
|
|
482
|
+
sequenceNumber += 1;
|
|
483
|
+
const createdAt = addDays(startDate, Math.floor(random() * 10));
|
|
484
|
+
const parent = em.create(StaffTimeTask, {
|
|
485
|
+
tenantId: scope.tenantId,
|
|
486
|
+
organizationId: scope.organizationId,
|
|
487
|
+
timeProjectId: project.id,
|
|
488
|
+
parentTaskId: null,
|
|
489
|
+
taskStatusId: status.id,
|
|
490
|
+
sequenceNumber,
|
|
491
|
+
reference: formatTaskReference(seed.code, sequenceNumber),
|
|
492
|
+
title: taskSeed.title,
|
|
493
|
+
description: taskSeed.description,
|
|
494
|
+
assigneeStaffMemberId: assignee?.id ?? null,
|
|
495
|
+
position: sequenceNumber * 1e3,
|
|
496
|
+
createdByUserId: actorUserId,
|
|
497
|
+
closedAt: status.isDone ? addDays(today, -Math.floor(random() * 20) - 1) : null,
|
|
498
|
+
createdAt,
|
|
499
|
+
updatedAt: now,
|
|
500
|
+
deletedAt: null
|
|
501
|
+
});
|
|
502
|
+
em.persist(parent);
|
|
503
|
+
await em.flush();
|
|
504
|
+
registerTask(parent, assignee?.id ?? null);
|
|
505
|
+
for (const slug of taskSeed.tagSlugs) {
|
|
506
|
+
const tag = tagBySlug.get(slug);
|
|
507
|
+
if (!tag) continue;
|
|
508
|
+
em.persist(
|
|
509
|
+
em.create(StaffTimeTaskTag, {
|
|
510
|
+
tenantId: scope.tenantId,
|
|
511
|
+
organizationId: scope.organizationId,
|
|
512
|
+
tagId: tag.id,
|
|
513
|
+
taskId: parent.id,
|
|
514
|
+
createdAt: now
|
|
515
|
+
})
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
for (const body of taskSeed.comments ?? []) {
|
|
519
|
+
em.persist(
|
|
520
|
+
em.create(StaffTimeTaskComment, {
|
|
521
|
+
tenantId: scope.tenantId,
|
|
522
|
+
organizationId: scope.organizationId,
|
|
523
|
+
taskId: parent.id,
|
|
524
|
+
body,
|
|
525
|
+
authorUserId: actorUserId,
|
|
526
|
+
createdAt: addDays(createdAt, 2),
|
|
527
|
+
updatedAt: addDays(createdAt, 2),
|
|
528
|
+
deletedAt: null
|
|
529
|
+
})
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
for (const subtaskSeed of taskSeed.subtasks ?? []) {
|
|
533
|
+
const subtaskStatus = statusBySlug.get(subtaskSeed.statusSlug) ?? statuses[0];
|
|
534
|
+
const subtaskAssignee = subtaskSeed.assigneeIndex === null ? null : memberAt(members, seed.memberIndexes[subtaskSeed.assigneeIndex] ?? subtaskSeed.assigneeIndex);
|
|
535
|
+
sequenceNumber += 1;
|
|
536
|
+
const subtask = em.create(StaffTimeTask, {
|
|
537
|
+
tenantId: scope.tenantId,
|
|
538
|
+
organizationId: scope.organizationId,
|
|
539
|
+
timeProjectId: project.id,
|
|
540
|
+
parentTaskId: parent.id,
|
|
541
|
+
taskStatusId: subtaskStatus.id,
|
|
542
|
+
sequenceNumber,
|
|
543
|
+
reference: formatTaskReference(seed.code, sequenceNumber),
|
|
544
|
+
title: subtaskSeed.title,
|
|
545
|
+
description: null,
|
|
546
|
+
assigneeStaffMemberId: subtaskAssignee?.id ?? null,
|
|
547
|
+
position: sequenceNumber * 1e3,
|
|
548
|
+
createdByUserId: actorUserId,
|
|
549
|
+
closedAt: subtaskStatus.isDone ? addDays(today, -Math.floor(random() * 15) - 1) : null,
|
|
550
|
+
createdAt: addDays(createdAt, 1),
|
|
551
|
+
updatedAt: now,
|
|
552
|
+
deletedAt: null
|
|
553
|
+
});
|
|
554
|
+
em.persist(subtask);
|
|
555
|
+
await em.flush();
|
|
556
|
+
registerTask(subtask, subtaskAssignee?.id ?? null);
|
|
557
|
+
}
|
|
558
|
+
await em.flush();
|
|
559
|
+
}
|
|
560
|
+
contexts.push({ seed, project, statusBySlug, tasks, tasksByMemberId, memberIds });
|
|
561
|
+
}
|
|
562
|
+
const pausedAfter = addDays(today, -21);
|
|
563
|
+
const projectsByMemberId = /* @__PURE__ */ new Map();
|
|
564
|
+
for (const context of contexts) {
|
|
565
|
+
for (const memberId of context.memberIds) {
|
|
566
|
+
const bucket = projectsByMemberId.get(memberId) ?? [];
|
|
567
|
+
bucket.push(context);
|
|
568
|
+
projectsByMemberId.set(memberId, bucket);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const entriesByProjectId = /* @__PURE__ */ new Map();
|
|
572
|
+
const firstDay = addDays(today, -(WEEKS_OF_HISTORY * 7) + 1);
|
|
573
|
+
for (let offset = 0; offset < WEEKS_OF_HISTORY * 7; offset += 1) {
|
|
574
|
+
const day = addDays(firstDay, offset);
|
|
575
|
+
if (isWeekend(day)) continue;
|
|
576
|
+
for (const [memberId, memberProjects] of projectsByMemberId) {
|
|
577
|
+
if (random() < 0.12) continue;
|
|
578
|
+
const eligible = memberProjects.filter((context) => {
|
|
579
|
+
if (day < startOfUtcDay(context.project.startDate ?? day)) return false;
|
|
580
|
+
return !(context.seed.status === "on_hold" && day > pausedAfter);
|
|
581
|
+
});
|
|
582
|
+
if (eligible.length === 0) continue;
|
|
583
|
+
let remainingMinutes = (13 + Math.floor(random() * 6)) * 30;
|
|
584
|
+
const entryCount = random() < 0.5 ? 2 : 3;
|
|
585
|
+
let cursorMinutes = 9 * 60 + Math.floor(random() * 4) * 15;
|
|
586
|
+
for (let index = 0; index < entryCount; index += 1) {
|
|
587
|
+
const context = eligible[Math.floor(random() * eligible.length) % eligible.length];
|
|
588
|
+
const candidates = context.tasksByMemberId.get(memberId) ?? context.tasks;
|
|
589
|
+
const task = candidates.length > 0 ? pick(random, candidates) : null;
|
|
590
|
+
const isLast = index === entryCount - 1;
|
|
591
|
+
const share = Math.round(remainingMinutes / (entryCount - index) / 30) * 30;
|
|
592
|
+
const durationMinutes = Math.max(30, isLast ? remainingMinutes : share);
|
|
593
|
+
remainingMinutes -= durationMinutes;
|
|
594
|
+
const isBillable = random() > 0.14;
|
|
595
|
+
const startedAt = atMinutes(day, cursorMinutes);
|
|
596
|
+
const endedAt = atMinutes(day, cursorMinutes + durationMinutes);
|
|
597
|
+
cursorMinutes += durationMinutes + 15 + Math.floor(random() * 3) * 15;
|
|
598
|
+
const entry = em.create(StaffTimeEntry, {
|
|
599
|
+
tenantId: scope.tenantId,
|
|
600
|
+
organizationId: scope.organizationId,
|
|
601
|
+
staffMemberId: memberId,
|
|
602
|
+
date: day,
|
|
603
|
+
durationMinutes,
|
|
604
|
+
startedAt,
|
|
605
|
+
endedAt,
|
|
606
|
+
notes: isBillable ? pick(random, ENTRY_NOTES) : pick(random, NONBILLABLE_NOTES),
|
|
607
|
+
timeProjectId: context.project.id,
|
|
608
|
+
taskId: task?.id ?? null,
|
|
609
|
+
customerId: context.project.customerId ?? null,
|
|
610
|
+
dealId: null,
|
|
611
|
+
orderId: null,
|
|
612
|
+
isBillable,
|
|
613
|
+
roundedMinutes: roundMinutes(durationMinutes, DEFAULT_ROUNDING_SETTINGS),
|
|
614
|
+
rateOverrideAmount: null,
|
|
615
|
+
rateCurrencyCode: context.project.currencyCode ?? null,
|
|
616
|
+
lockedReportId: null,
|
|
617
|
+
lockedAt: null,
|
|
618
|
+
source: random() < 0.25 ? "timer" : "manual",
|
|
619
|
+
createdAt: endedAt,
|
|
620
|
+
updatedAt: endedAt,
|
|
621
|
+
deletedAt: null
|
|
622
|
+
});
|
|
623
|
+
em.persist(entry);
|
|
624
|
+
const bucket = entriesByProjectId.get(context.project.id) ?? [];
|
|
625
|
+
bucket.push(entry);
|
|
626
|
+
entriesByProjectId.set(context.project.id, bucket);
|
|
627
|
+
if (random() < 0.35) {
|
|
628
|
+
const tag = pick(random, DEMO_TAGS);
|
|
629
|
+
const tagRow = tagBySlug.get(tag.slug);
|
|
630
|
+
if (tagRow) {
|
|
631
|
+
await em.flush();
|
|
632
|
+
em.persist(
|
|
633
|
+
em.create(StaffTimeEntryTag, {
|
|
634
|
+
tenantId: scope.tenantId,
|
|
635
|
+
organizationId: scope.organizationId,
|
|
636
|
+
tagId: tagRow.id,
|
|
637
|
+
timeEntryId: entry.id,
|
|
638
|
+
createdAt: endedAt
|
|
639
|
+
})
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
await em.flush();
|
|
646
|
+
}
|
|
647
|
+
await em.flush();
|
|
648
|
+
await seedDemoReports({ em, scope, contexts, entriesByProjectId, actorUserId, today, now });
|
|
649
|
+
return true;
|
|
650
|
+
}
|
|
651
|
+
async function seedDemoReports(args) {
|
|
652
|
+
const { em, scope, contexts, entriesByProjectId, actorUserId, today, now } = args;
|
|
653
|
+
const monthStart = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), 1));
|
|
654
|
+
const previousMonthStart = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth() - 1, 1));
|
|
655
|
+
const previousMonthEnd = addDays(monthStart, -1);
|
|
656
|
+
const existingReferences = await em.find(
|
|
657
|
+
StaffTimeReport,
|
|
658
|
+
{ tenantId: scope.tenantId, organizationId: scope.organizationId },
|
|
659
|
+
{ fields: ["reference"] }
|
|
660
|
+
);
|
|
661
|
+
const year = today.getUTCFullYear();
|
|
662
|
+
let sequence = highestReportSequenceNumber(
|
|
663
|
+
existingReferences.map((report) => report.reference),
|
|
664
|
+
year
|
|
665
|
+
);
|
|
666
|
+
const byCustomer = /* @__PURE__ */ new Map();
|
|
667
|
+
for (const context of contexts) {
|
|
668
|
+
const customerId = context.project.customerId;
|
|
669
|
+
if (!customerId) continue;
|
|
670
|
+
const bucket = byCustomer.get(customerId) ?? [];
|
|
671
|
+
bucket.push(context);
|
|
672
|
+
byCustomer.set(customerId, bucket);
|
|
673
|
+
}
|
|
674
|
+
if (byCustomer.size === 0) return;
|
|
675
|
+
const customerGroups = [...byCustomer.entries()];
|
|
676
|
+
const createReport = async (group, options) => {
|
|
677
|
+
const [customerId, groupContexts] = group;
|
|
678
|
+
const first = groupContexts[0];
|
|
679
|
+
sequence += 1;
|
|
680
|
+
const { reference } = allocateReportReference(year, sequence - 1);
|
|
681
|
+
const currencyCode = first.project.currencyCode ?? "USD";
|
|
682
|
+
const report = em.create(StaffTimeReport, {
|
|
683
|
+
tenantId: scope.tenantId,
|
|
684
|
+
organizationId: scope.organizationId,
|
|
685
|
+
customerId,
|
|
686
|
+
customerSnapshot: first.project.customerSnapshot ?? null,
|
|
687
|
+
reference,
|
|
688
|
+
title: options.title,
|
|
689
|
+
periodKind: "month",
|
|
690
|
+
periodFrom: options.periodFrom,
|
|
691
|
+
periodTo: options.periodTo,
|
|
692
|
+
currencyCode,
|
|
693
|
+
grouping: "project_task",
|
|
694
|
+
nonbillableMode: "separate",
|
|
695
|
+
includeAlreadyReported: false,
|
|
696
|
+
showRates: true,
|
|
697
|
+
roundingUnitMinutes: DEFAULT_ROUNDING_SETTINGS.unitMinutes,
|
|
698
|
+
roundingDirection: DEFAULT_ROUNDING_SETTINGS.direction,
|
|
699
|
+
status: "draft",
|
|
700
|
+
totalBillableMinutes: null,
|
|
701
|
+
totalNonbillableMinutes: null,
|
|
702
|
+
totalAmount: null,
|
|
703
|
+
closedAt: null,
|
|
704
|
+
closedByUserId: null,
|
|
705
|
+
createdByUserId: actorUserId,
|
|
706
|
+
createdAt: options.periodTo,
|
|
707
|
+
updatedAt: now,
|
|
708
|
+
deletedAt: null
|
|
709
|
+
});
|
|
710
|
+
em.persist(report);
|
|
711
|
+
await em.flush();
|
|
712
|
+
for (const context of groupContexts) {
|
|
713
|
+
em.persist(
|
|
714
|
+
em.create(StaffTimeReportProject, {
|
|
715
|
+
tenantId: scope.tenantId,
|
|
716
|
+
organizationId: scope.organizationId,
|
|
717
|
+
reportId: report.id,
|
|
718
|
+
timeProjectId: context.project.id,
|
|
719
|
+
createdAt: now
|
|
720
|
+
})
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
await em.flush();
|
|
724
|
+
if (!options.close) return;
|
|
725
|
+
const included = groupContexts.flatMap((context) => {
|
|
726
|
+
const rate = Number(context.project.hourlyRate ?? 0);
|
|
727
|
+
return (entriesByProjectId.get(context.project.id) ?? []).filter((entry) => entry.date >= options.periodFrom && entry.date <= options.periodTo).map((entry) => ({ entry, rate }));
|
|
728
|
+
});
|
|
729
|
+
if (included.length === 0) return;
|
|
730
|
+
const closedAt = addDays(options.periodTo, 2);
|
|
731
|
+
const amounts = [];
|
|
732
|
+
let billableMinutes = 0;
|
|
733
|
+
let nonbillableMinutes = 0;
|
|
734
|
+
for (const { entry, rate } of included) {
|
|
735
|
+
const minutes = entry.roundedMinutes ?? entry.durationMinutes;
|
|
736
|
+
const amount = entryAmount(
|
|
737
|
+
{ isBillable: entry.isBillable, roundedMinutes: minutes, rateOverrideAmount: null },
|
|
738
|
+
{ hourlyRate: rate }
|
|
739
|
+
);
|
|
740
|
+
amounts.push(amount);
|
|
741
|
+
if (entry.isBillable) billableMinutes += minutes;
|
|
742
|
+
else nonbillableMinutes += minutes;
|
|
743
|
+
em.persist(
|
|
744
|
+
em.create(StaffTimeReportEntry, {
|
|
745
|
+
tenantId: scope.tenantId,
|
|
746
|
+
organizationId: scope.organizationId,
|
|
747
|
+
reportId: report.id,
|
|
748
|
+
timeEntryId: entry.id,
|
|
749
|
+
frozenRawMinutes: entry.durationMinutes,
|
|
750
|
+
frozenRoundedMinutes: minutes,
|
|
751
|
+
frozenRateAmount: entry.isBillable ? String(round2(rate)) : null,
|
|
752
|
+
frozenCurrencyCode: currencyCode,
|
|
753
|
+
frozenAmount: amount === null ? null : amount.toFixed(2),
|
|
754
|
+
frozenIsBillable: entry.isBillable,
|
|
755
|
+
createdAt: closedAt
|
|
756
|
+
})
|
|
757
|
+
);
|
|
758
|
+
entry.lockedReportId = report.id;
|
|
759
|
+
entry.lockedAt = closedAt;
|
|
760
|
+
entry.updatedAt = closedAt;
|
|
761
|
+
}
|
|
762
|
+
const totalAmount = sumAmounts(amounts);
|
|
763
|
+
report.status = "closed";
|
|
764
|
+
report.closedAt = closedAt;
|
|
765
|
+
report.closedByUserId = actorUserId;
|
|
766
|
+
report.totalBillableMinutes = billableMinutes;
|
|
767
|
+
report.totalNonbillableMinutes = nonbillableMinutes;
|
|
768
|
+
report.totalAmount = totalAmount.toFixed(2);
|
|
769
|
+
report.updatedAt = closedAt;
|
|
770
|
+
em.persist(
|
|
771
|
+
em.create(StaffTimeReportEvent, {
|
|
772
|
+
tenantId: scope.tenantId,
|
|
773
|
+
organizationId: scope.organizationId,
|
|
774
|
+
reportId: report.id,
|
|
775
|
+
eventType: "closed",
|
|
776
|
+
reason: null,
|
|
777
|
+
actorUserId,
|
|
778
|
+
metadata: {
|
|
779
|
+
frozenEntryCount: included.length,
|
|
780
|
+
lockedEntryCount: included.length,
|
|
781
|
+
totalAmount,
|
|
782
|
+
currencyCode,
|
|
783
|
+
roundingUnitMinutes: DEFAULT_ROUNDING_SETTINGS.unitMinutes,
|
|
784
|
+
roundingDirection: DEFAULT_ROUNDING_SETTINGS.direction
|
|
785
|
+
},
|
|
786
|
+
createdAt: closedAt
|
|
787
|
+
})
|
|
788
|
+
);
|
|
789
|
+
await em.flush();
|
|
790
|
+
};
|
|
791
|
+
const monthLabel = (date) => `${date.toLocaleString("en-US", { month: "long", timeZone: "UTC" })} ${date.getUTCFullYear()}`;
|
|
792
|
+
await createReport(customerGroups[0], {
|
|
793
|
+
title: `${monthLabel(previousMonthStart)} \u2014 time and materials`,
|
|
794
|
+
periodFrom: previousMonthStart,
|
|
795
|
+
periodTo: previousMonthEnd,
|
|
796
|
+
close: true
|
|
797
|
+
});
|
|
798
|
+
const draftGroup = customerGroups[1] ?? customerGroups[0];
|
|
799
|
+
await createReport(draftGroup, {
|
|
800
|
+
title: `${monthLabel(monthStart)} \u2014 work in progress`,
|
|
801
|
+
periodFrom: monthStart,
|
|
802
|
+
periodTo: today,
|
|
803
|
+
close: false
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
export {
|
|
807
|
+
seedStaffTimeTrackingExamples
|
|
808
|
+
};
|
|
809
|
+
//# sourceMappingURL=timeTrackingSeeds.js.map
|