@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,231 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useQuery } from '@tanstack/react-query'
|
|
5
|
+
import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
6
|
+
import { useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
|
|
7
|
+
import {
|
|
8
|
+
readItems,
|
|
9
|
+
readString,
|
|
10
|
+
readTotal,
|
|
11
|
+
sortByPosition,
|
|
12
|
+
toBoardStatus,
|
|
13
|
+
type BoardApiRow,
|
|
14
|
+
type BoardStatus,
|
|
15
|
+
} from './kanbanBoardData'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The lookups every board surface needs — statuses, the caller's own staff member,
|
|
19
|
+
* assignee names and tag labels — behind one set of query keys.
|
|
20
|
+
*
|
|
21
|
+
* They live here rather than inside `KanbanBoard` so the filter chips, the flat list
|
|
22
|
+
* view and the board all read the *same* react-query entries. Two components asking for
|
|
23
|
+
* the project's statuses must not produce two requests, and a status renamed in one
|
|
24
|
+
* place must not stay stale in another.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export const BOARD_QUERY_ROOT = ['staff', 'time-tracking', 'board'] as const
|
|
28
|
+
|
|
29
|
+
export const BOARD_PAGE_SIZE = 50
|
|
30
|
+
export const BOARD_DIRECTORY_PAGE_SIZE = 100
|
|
31
|
+
|
|
32
|
+
export type BoardSelf = {
|
|
33
|
+
id: string
|
|
34
|
+
displayName: string | null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type BoardTagOption = {
|
|
38
|
+
id: string
|
|
39
|
+
label: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function boardStatusesQueryKey(scopeVersion: number, timeProjectId: string) {
|
|
43
|
+
return [...BOARD_QUERY_ROOT, 'statuses', `scope:${scopeVersion}`, `project:${timeProjectId}`]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function boardColumnQueryKey(
|
|
47
|
+
scopeVersion: number,
|
|
48
|
+
timeProjectId: string,
|
|
49
|
+
statusId: string,
|
|
50
|
+
pages: number,
|
|
51
|
+
filterKey: string,
|
|
52
|
+
) {
|
|
53
|
+
return [
|
|
54
|
+
...BOARD_QUERY_ROOT,
|
|
55
|
+
'column',
|
|
56
|
+
`scope:${scopeVersion}`,
|
|
57
|
+
`project:${timeProjectId}`,
|
|
58
|
+
`status:${statusId}`,
|
|
59
|
+
`pages:${pages}`,
|
|
60
|
+
`filters:${filterKey}`,
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function boardSelfQueryKey(scopeVersion: number) {
|
|
65
|
+
return [...BOARD_QUERY_ROOT, 'self', `scope:${scopeVersion}`]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type TaskPageResult = { items: BoardApiRow[]; total: number }
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Pulls up to `maxPages` pages of the tasks list, stopping as soon as the server has
|
|
72
|
+
* nothing more to give. Shared by the column queries and the flat list so both agree on
|
|
73
|
+
* what "one more page" means.
|
|
74
|
+
*/
|
|
75
|
+
export async function fetchTaskPages(
|
|
76
|
+
params: (page: number) => string,
|
|
77
|
+
maxPages: number,
|
|
78
|
+
): Promise<TaskPageResult> {
|
|
79
|
+
const items: BoardApiRow[] = []
|
|
80
|
+
let total = 0
|
|
81
|
+
for (let page = 1; page <= maxPages; page += 1) {
|
|
82
|
+
const call = await apiCall<Record<string, unknown>>(`/api/staff/timesheets/tasks?${params(page)}`)
|
|
83
|
+
if (!call.ok) throw new Error('[internal] task page request failed')
|
|
84
|
+
const pageItems = readItems(call.result)
|
|
85
|
+
total = readTotal(call.result, items.length + pageItems.length)
|
|
86
|
+
items.push(...pageItems)
|
|
87
|
+
if (pageItems.length < BOARD_PAGE_SIZE || items.length >= total) break
|
|
88
|
+
}
|
|
89
|
+
return { items, total }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function useBoardStatuses(timeProjectId: string) {
|
|
93
|
+
const scopeVersion = useOrganizationScopeVersion()
|
|
94
|
+
return useQuery<BoardStatus[]>({
|
|
95
|
+
queryKey: boardStatusesQueryKey(scopeVersion, timeProjectId),
|
|
96
|
+
staleTime: 30_000,
|
|
97
|
+
queryFn: async () => {
|
|
98
|
+
const call = await apiCall<Record<string, unknown>>(
|
|
99
|
+
`/api/staff/timesheets/task-statuses?timeProjectId=${encodeURIComponent(timeProjectId)}&page=1&pageSize=${BOARD_DIRECTORY_PAGE_SIZE}&sortField=position&sortDir=asc`,
|
|
100
|
+
)
|
|
101
|
+
if (!call.ok) throw new Error('[internal] task-statuses request failed')
|
|
102
|
+
const statuses = readItems(call.result)
|
|
103
|
+
.map(toBoardStatus)
|
|
104
|
+
.filter((status): status is BoardStatus => status !== null)
|
|
105
|
+
return sortByPosition(statuses)
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The caller's own staff member — the identity behind "Przypisane do mnie" and the
|
|
112
|
+
* avatar the chip draws.
|
|
113
|
+
*/
|
|
114
|
+
export function useBoardSelf() {
|
|
115
|
+
const scopeVersion = useOrganizationScopeVersion()
|
|
116
|
+
return useQuery<BoardSelf | null>({
|
|
117
|
+
queryKey: boardSelfQueryKey(scopeVersion),
|
|
118
|
+
staleTime: 300_000,
|
|
119
|
+
queryFn: async () => {
|
|
120
|
+
const call = await apiCall<{ member?: { id?: string | null; displayName?: string | null } | null }>(
|
|
121
|
+
'/api/staff/team-members/self',
|
|
122
|
+
)
|
|
123
|
+
if (!call.ok) return null
|
|
124
|
+
const id = call.result?.member?.id ?? null
|
|
125
|
+
if (!id) return null
|
|
126
|
+
return { id, displayName: call.result?.member?.displayName ?? null }
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Display names for the assignees a surface is about to render. */
|
|
132
|
+
export function useAssigneeNames(assigneeIds: readonly string[]) {
|
|
133
|
+
const scopeVersion = useOrganizationScopeVersion()
|
|
134
|
+
const ids = React.useMemo(() => Array.from(new Set(assigneeIds)).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)), [assigneeIds])
|
|
135
|
+
return useQuery<Map<string, string>>({
|
|
136
|
+
queryKey: [...BOARD_QUERY_ROOT, 'assignees', `scope:${scopeVersion}`, ids.join(',')],
|
|
137
|
+
enabled: ids.length > 0,
|
|
138
|
+
staleTime: 300_000,
|
|
139
|
+
queryFn: async () => {
|
|
140
|
+
const call = await apiCall<Record<string, unknown>>(
|
|
141
|
+
`/api/staff/team-members?ids=${ids.map(encodeURIComponent).join(',')}&pageSize=${BOARD_DIRECTORY_PAGE_SIZE}`,
|
|
142
|
+
)
|
|
143
|
+
const names = new Map<string, string>()
|
|
144
|
+
if (!call.ok) return names
|
|
145
|
+
for (const row of readItems(call.result)) {
|
|
146
|
+
const id = readString(row, 'id')
|
|
147
|
+
if (!id) continue
|
|
148
|
+
names.set(id, readString(row, 'display_name', 'displayName') ?? id)
|
|
149
|
+
}
|
|
150
|
+
return names
|
|
151
|
+
},
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Labels for the tags a surface is about to render.
|
|
157
|
+
*
|
|
158
|
+
* Only tags that actually have a label land in the map. A caller renders a chip
|
|
159
|
+
* for the ids it finds here and skips the rest, so a tag whose label has not
|
|
160
|
+
* arrived yet — or a row that carries none — is never drawn as its raw id.
|
|
161
|
+
*/
|
|
162
|
+
export function useTagLabels(tagIds: readonly string[]) {
|
|
163
|
+
const scopeVersion = useOrganizationScopeVersion()
|
|
164
|
+
const ids = React.useMemo(() => Array.from(new Set(tagIds)).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)), [tagIds])
|
|
165
|
+
return useQuery<Map<string, string>>({
|
|
166
|
+
queryKey: [...BOARD_QUERY_ROOT, 'tags', `scope:${scopeVersion}`, ids.join(',')],
|
|
167
|
+
enabled: ids.length > 0,
|
|
168
|
+
staleTime: 300_000,
|
|
169
|
+
queryFn: async () => {
|
|
170
|
+
const call = await apiCall<Record<string, unknown>>(
|
|
171
|
+
`/api/staff/timesheets/tags?ids=${ids.map(encodeURIComponent).join(',')}&pageSize=${BOARD_DIRECTORY_PAGE_SIZE}`,
|
|
172
|
+
)
|
|
173
|
+
const labels = new Map<string, string>()
|
|
174
|
+
if (!call.ok) return labels
|
|
175
|
+
for (const row of readItems(call.result)) {
|
|
176
|
+
const id = readString(row, 'id')
|
|
177
|
+
if (!id) continue
|
|
178
|
+
const label = readString(row, 'label')
|
|
179
|
+
if (!label) continue
|
|
180
|
+
labels.set(id, label)
|
|
181
|
+
}
|
|
182
|
+
return labels
|
|
183
|
+
},
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Every tag in the organization — the option list behind the "Tag" filter. */
|
|
188
|
+
export function useTagDirectory(enabled: boolean) {
|
|
189
|
+
const scopeVersion = useOrganizationScopeVersion()
|
|
190
|
+
return useQuery<BoardTagOption[]>({
|
|
191
|
+
queryKey: [...BOARD_QUERY_ROOT, 'tag-directory', `scope:${scopeVersion}`],
|
|
192
|
+
enabled,
|
|
193
|
+
staleTime: 300_000,
|
|
194
|
+
queryFn: async () => {
|
|
195
|
+
const call = await apiCall<Record<string, unknown>>(
|
|
196
|
+
`/api/staff/timesheets/tags?page=1&pageSize=${BOARD_DIRECTORY_PAGE_SIZE}&sortField=label&sortDir=asc`,
|
|
197
|
+
)
|
|
198
|
+
if (!call.ok) return []
|
|
199
|
+
return readItems(call.result)
|
|
200
|
+
.map((row) => {
|
|
201
|
+
const id = readString(row, 'id')
|
|
202
|
+
if (!id) return null
|
|
203
|
+
return { id, label: readString(row, 'label') ?? id }
|
|
204
|
+
})
|
|
205
|
+
.filter((tag): tag is BoardTagOption => tag !== null)
|
|
206
|
+
},
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** The people who can be picked as an assignee filter. */
|
|
211
|
+
export function useStaffMemberDirectory(enabled: boolean) {
|
|
212
|
+
const scopeVersion = useOrganizationScopeVersion()
|
|
213
|
+
return useQuery<Array<{ id: string; displayName: string }>>({
|
|
214
|
+
queryKey: [...BOARD_QUERY_ROOT, 'member-directory', `scope:${scopeVersion}`],
|
|
215
|
+
enabled,
|
|
216
|
+
staleTime: 300_000,
|
|
217
|
+
queryFn: async () => {
|
|
218
|
+
const call = await apiCall<Record<string, unknown>>(
|
|
219
|
+
`/api/staff/team-members?page=1&pageSize=${BOARD_DIRECTORY_PAGE_SIZE}&sortField=displayName&sortDir=asc`,
|
|
220
|
+
)
|
|
221
|
+
if (!call.ok) return []
|
|
222
|
+
return readItems(call.result)
|
|
223
|
+
.map((row) => {
|
|
224
|
+
const id = readString(row, 'id')
|
|
225
|
+
if (!id) return null
|
|
226
|
+
return { id, displayName: readString(row, 'display_name', 'displayName') ?? id }
|
|
227
|
+
})
|
|
228
|
+
.filter((member): member is { id: string; displayName: string } => member !== null)
|
|
229
|
+
},
|
|
230
|
+
})
|
|
231
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Board filter state (T3.8) — the `dt-chips` row of screen 6.
|
|
3
|
+
*
|
|
4
|
+
* Three filters, and they are deliberately not all the same kind of filter:
|
|
5
|
+
*
|
|
6
|
+
* - **assignee** narrows on the server. `/api/staff/timesheets/tasks` accepts
|
|
7
|
+
* `assigneeStaffMemberId`, so the filter goes into the request and the column
|
|
8
|
+
* totals stay honest.
|
|
9
|
+
* - **status** does not narrow a request at all — it picks which columns render.
|
|
10
|
+
* The board already asks one request per column keyed by `taskStatusId`, so
|
|
11
|
+
* filtering by status is "render this column only", not "add a parameter".
|
|
12
|
+
* The flat list view has no columns, so there it *is* a request parameter.
|
|
13
|
+
* - **tag** narrows on the server too, since T7.6 gave `/api/staff/timesheets/tasks`
|
|
14
|
+
* a `tagIds` parameter (W9). It used to filter loaded rows in the browser, which
|
|
15
|
+
* made a match on page two invisible and the column badge count depend on how far
|
|
16
|
+
* the board had been paged. The parameter means **every** listed tag, which is
|
|
17
|
+
* what the chips have always meant.
|
|
18
|
+
*
|
|
19
|
+
* The split matters for caching: only the server-narrowed part may appear in a
|
|
20
|
+
* react-query key, otherwise flipping a chip would evict and refetch pages whose
|
|
21
|
+
* bytes did not change. `boardServerFilterKey` is that part.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export type BoardFilters = {
|
|
25
|
+
assigneeStaffMemberId: string | null
|
|
26
|
+
taskStatusId: string | null
|
|
27
|
+
tagIds: string[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const EMPTY_BOARD_FILTERS: BoardFilters = {
|
|
31
|
+
assigneeStaffMemberId: null,
|
|
32
|
+
taskStatusId: null,
|
|
33
|
+
tagIds: [],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function readOptionalId(value: unknown): string | null {
|
|
37
|
+
return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Parses whatever came out of storage, so a hand-edited or stale entry cannot wedge the board. */
|
|
41
|
+
export function normalizeBoardFilters(raw: unknown): BoardFilters {
|
|
42
|
+
if (!raw || typeof raw !== 'object') return { ...EMPTY_BOARD_FILTERS }
|
|
43
|
+
const source = raw as Record<string, unknown>
|
|
44
|
+
const tagIds = Array.isArray(source.tagIds)
|
|
45
|
+
? Array.from(
|
|
46
|
+
new Set(
|
|
47
|
+
source.tagIds
|
|
48
|
+
.map((entry) => readOptionalId(entry))
|
|
49
|
+
.filter((entry): entry is string => entry !== null),
|
|
50
|
+
),
|
|
51
|
+
)
|
|
52
|
+
: []
|
|
53
|
+
return {
|
|
54
|
+
assigneeStaffMemberId: readOptionalId(source.assigneeStaffMemberId),
|
|
55
|
+
taskStatusId: readOptionalId(source.taskStatusId),
|
|
56
|
+
tagIds,
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function countActiveBoardFilters(filters: BoardFilters): number {
|
|
61
|
+
let count = 0
|
|
62
|
+
if (filters.assigneeStaffMemberId) count += 1
|
|
63
|
+
if (filters.taskStatusId) count += 1
|
|
64
|
+
return count + filters.tagIds.length
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function hasActiveBoardFilters(filters: BoardFilters): boolean {
|
|
68
|
+
return countActiveBoardFilters(filters) > 0
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type BoardFilterScope = {
|
|
72
|
+
/** The flat list view sends the status as a request parameter; the board picks columns instead. */
|
|
73
|
+
includeStatus?: boolean
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The part of the filter state a request actually depends on — and therefore the only
|
|
78
|
+
* part allowed into a react-query key. Tags are ordered so that picking the same two
|
|
79
|
+
* chips in either order shares one cache entry.
|
|
80
|
+
*/
|
|
81
|
+
export function boardServerFilterKey(filters: BoardFilters, scope: BoardFilterScope = {}): string {
|
|
82
|
+
const parts = [`assignee:${filters.assigneeStaffMemberId ?? ''}`]
|
|
83
|
+
if (scope.includeStatus) parts.push(`status:${filters.taskStatusId ?? ''}`)
|
|
84
|
+
parts.push(`tags:${[...filters.tagIds].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)).join(',')}`)
|
|
85
|
+
return parts.join('|')
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** URL fragment appended to a tasks list request; always starts with `&` or is empty. */
|
|
89
|
+
export function boardServerFilterParams(filters: BoardFilters, scope: BoardFilterScope = {}): string {
|
|
90
|
+
let params = ''
|
|
91
|
+
if (filters.assigneeStaffMemberId) {
|
|
92
|
+
params += `&assigneeStaffMemberId=${encodeURIComponent(filters.assigneeStaffMemberId)}`
|
|
93
|
+
}
|
|
94
|
+
if (scope.includeStatus && filters.taskStatusId) {
|
|
95
|
+
params += `&taskStatusId=${encodeURIComponent(filters.taskStatusId)}`
|
|
96
|
+
}
|
|
97
|
+
if (filters.tagIds.length > 0) {
|
|
98
|
+
params += `&tagIds=${encodeURIComponent([...filters.tagIds].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)).join(','))}`
|
|
99
|
+
}
|
|
100
|
+
return params
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Which columns the board renders under the current status filter. */
|
|
104
|
+
export function visibleBoardStatusIds<T extends { id: string }>(
|
|
105
|
+
statuses: readonly T[],
|
|
106
|
+
filters: BoardFilters,
|
|
107
|
+
): T[] {
|
|
108
|
+
if (!filters.taskStatusId) return [...statuses]
|
|
109
|
+
return statuses.filter((status) => status.id === filters.taskStatusId)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function withAssigneeFilter(filters: BoardFilters, staffMemberId: string | null): BoardFilters {
|
|
113
|
+
return { ...filters, assigneeStaffMemberId: readOptionalId(staffMemberId) }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function withStatusFilter(filters: BoardFilters, taskStatusId: string | null): BoardFilters {
|
|
117
|
+
return { ...filters, taskStatusId: readOptionalId(taskStatusId) }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function withTagFilter(filters: BoardFilters, tagId: string): BoardFilters {
|
|
121
|
+
if (filters.tagIds.includes(tagId)) return filters
|
|
122
|
+
return { ...filters, tagIds: [...filters.tagIds, tagId] }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function withoutTagFilter(filters: BoardFilters, tagId: string): BoardFilters {
|
|
126
|
+
if (!filters.tagIds.includes(tagId)) return filters
|
|
127
|
+
return { ...filters, tagIds: filters.tagIds.filter((entry) => entry !== tagId) }
|
|
128
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the screen-6 page head says under the title:
|
|
3
|
+
* `Nordvik — migracja B2B · 24 zadania · 78:20 zalogowane`.
|
|
4
|
+
*
|
|
5
|
+
* The active view (board or list) reports it upward rather than the head fetching the
|
|
6
|
+
* same tasks a second time, so the subtitle always describes exactly the rows the user
|
|
7
|
+
* is looking at — filters included.
|
|
8
|
+
*
|
|
9
|
+
* `loggedMinutes` MUST come from `sumTaskLoggedMinutes`. A task's `loggedMinutes` is the
|
|
10
|
+
* inclusive rollup (own + children, D-2), so folding parents and children together in a
|
|
11
|
+
* plain `reduce` counts the children twice — risk R10. That helper drops any row whose
|
|
12
|
+
* parent is present in the same set, which is why it is the only sanctioned way to total
|
|
13
|
+
* a mixed set.
|
|
14
|
+
*/
|
|
15
|
+
export type BoardSummary = {
|
|
16
|
+
taskCount: number
|
|
17
|
+
loggedMinutes: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const EMPTY_BOARD_SUMMARY: BoardSummary = { taskCount: 0, loggedMinutes: 0 }
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row parsing and board arithmetic for the Kanban board of screen 6 (T3.6).
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from `KanbanBoard.tsx` so the parts that decide what a card says —
|
|
5
|
+
* which rows become cards, what a column's hours are, where a dropped card lands —
|
|
6
|
+
* are unit-testable without a DOM, and so the board component stays about drag,
|
|
7
|
+
* optimistic writes and rollback.
|
|
8
|
+
*
|
|
9
|
+
* The column total deliberately delegates to `sumTaskLoggedMinutes` rather than
|
|
10
|
+
* folding `loggedMinutes` inline: that helper drops any row whose parent is present
|
|
11
|
+
* in the same set, which is the only guard against risk R10 (a parent's rollup
|
|
12
|
+
* already contains its children's minutes, so adding both double-counts).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { formatDuration } from '../time-tracking/duration'
|
|
16
|
+
import { sumTaskLoggedMinutes } from '../timesheets-tasks/taskHoursTotals'
|
|
17
|
+
import { STATUS_POSITION_GAP } from '../timesheets-tasks/statusPositions'
|
|
18
|
+
import { resolveProjectColorHex } from '../timesheets-ui/colors'
|
|
19
|
+
|
|
20
|
+
export type BoardApiRow = Record<string, unknown>
|
|
21
|
+
|
|
22
|
+
export type BoardStatus = {
|
|
23
|
+
id: string
|
|
24
|
+
name: string
|
|
25
|
+
slug: string | null
|
|
26
|
+
color: string | null
|
|
27
|
+
position: number
|
|
28
|
+
isDefault: boolean
|
|
29
|
+
isDone: boolean
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type BoardTask = {
|
|
33
|
+
id: string
|
|
34
|
+
title: string
|
|
35
|
+
reference: string | null
|
|
36
|
+
timeProjectId: string | null
|
|
37
|
+
parentTaskId: string | null
|
|
38
|
+
taskStatusId: string | null
|
|
39
|
+
assigneeStaffMemberId: string | null
|
|
40
|
+
position: number
|
|
41
|
+
ownMinutes: number
|
|
42
|
+
loggedMinutes: number
|
|
43
|
+
childCount: number
|
|
44
|
+
closedAt: string | null
|
|
45
|
+
updatedAt: string | null
|
|
46
|
+
tagIds: string[]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type SubtaskProgress = {
|
|
50
|
+
total: number
|
|
51
|
+
done: number
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function readString(row: BoardApiRow, ...keys: string[]): string | null {
|
|
55
|
+
for (const key of keys) {
|
|
56
|
+
const value = row[key]
|
|
57
|
+
if (typeof value === 'string' && value.length > 0) return value
|
|
58
|
+
}
|
|
59
|
+
return null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function readNumber(row: BoardApiRow, ...keys: string[]): number | null {
|
|
63
|
+
for (const key of keys) {
|
|
64
|
+
const value = row[key]
|
|
65
|
+
if (typeof value === 'number' && Number.isFinite(value)) return value
|
|
66
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
67
|
+
const parsed = Number(value)
|
|
68
|
+
if (Number.isFinite(parsed)) return parsed
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function readBoolean(row: BoardApiRow, ...keys: string[]): boolean {
|
|
75
|
+
for (const key of keys) {
|
|
76
|
+
const value = row[key]
|
|
77
|
+
if (typeof value === 'boolean') return value
|
|
78
|
+
if (value === 'true') return true
|
|
79
|
+
if (value === 'false') return false
|
|
80
|
+
}
|
|
81
|
+
return false
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function readStringArray(row: BoardApiRow, ...keys: string[]): string[] {
|
|
85
|
+
for (const key of keys) {
|
|
86
|
+
const value = row[key]
|
|
87
|
+
if (!Array.isArray(value)) continue
|
|
88
|
+
const ids = value.filter((entry): entry is string => typeof entry === 'string' && entry.length > 0)
|
|
89
|
+
if (ids.length > 0) return ids
|
|
90
|
+
}
|
|
91
|
+
return []
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function toBoardStatus(row: BoardApiRow): BoardStatus | null {
|
|
95
|
+
const id = readString(row, 'id')
|
|
96
|
+
if (!id) return null
|
|
97
|
+
return {
|
|
98
|
+
id,
|
|
99
|
+
name: readString(row, 'name') ?? id,
|
|
100
|
+
slug: readString(row, 'slug'),
|
|
101
|
+
color: readString(row, 'color'),
|
|
102
|
+
position: readNumber(row, 'position') ?? 0,
|
|
103
|
+
isDefault: readBoolean(row, 'is_default', 'isDefault'),
|
|
104
|
+
isDone: readBoolean(row, 'is_done', 'isDone'),
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function toBoardTask(row: BoardApiRow): BoardTask | null {
|
|
109
|
+
const id = readString(row, 'id')
|
|
110
|
+
if (!id) return null
|
|
111
|
+
return {
|
|
112
|
+
id,
|
|
113
|
+
title: readString(row, 'title') ?? id,
|
|
114
|
+
reference: readString(row, 'reference'),
|
|
115
|
+
timeProjectId: readString(row, 'time_project_id', 'timeProjectId'),
|
|
116
|
+
parentTaskId: readString(row, 'parent_task_id', 'parentTaskId'),
|
|
117
|
+
taskStatusId: readString(row, 'task_status_id', 'taskStatusId'),
|
|
118
|
+
assigneeStaffMemberId: readString(row, 'assignee_staff_member_id', 'assigneeStaffMemberId'),
|
|
119
|
+
position: readNumber(row, 'position') ?? 0,
|
|
120
|
+
ownMinutes: readNumber(row, 'ownMinutes', 'own_minutes') ?? 0,
|
|
121
|
+
loggedMinutes: readNumber(row, 'loggedMinutes', 'logged_minutes') ?? 0,
|
|
122
|
+
childCount: readNumber(row, 'childCount', 'child_count') ?? 0,
|
|
123
|
+
closedAt: readString(row, 'closed_at', 'closedAt'),
|
|
124
|
+
updatedAt: readString(row, 'updated_at', 'updatedAt'),
|
|
125
|
+
tagIds: readStringArray(row, 'tagIds', 'tag_ids'),
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function readItems(payload: unknown): BoardApiRow[] {
|
|
130
|
+
if (!payload || typeof payload !== 'object') return []
|
|
131
|
+
const items = (payload as { items?: unknown }).items
|
|
132
|
+
if (!Array.isArray(items)) return []
|
|
133
|
+
return items.filter((item): item is BoardApiRow => !!item && typeof item === 'object')
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function readTotal(payload: unknown, fallback: number): number {
|
|
137
|
+
if (!payload || typeof payload !== 'object') return fallback
|
|
138
|
+
const total = (payload as { total?: unknown }).total
|
|
139
|
+
return typeof total === 'number' && Number.isFinite(total) ? total : fallback
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** `22:45` — the card and column-header hours format of the mockup. */
|
|
143
|
+
export function formatBoardMinutes(minutes: number): string {
|
|
144
|
+
return formatDuration(Number.isFinite(minutes) ? minutes : 0, 'clock')
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* A column's summed hours (mockup note 4). Never fold `loggedMinutes` by hand —
|
|
149
|
+
* see the module docblock and `taskHoursTotals.ts` on risk R10.
|
|
150
|
+
*/
|
|
151
|
+
export function columnLoggedMinutes(tasks: readonly BoardTask[]): number {
|
|
152
|
+
return sumTaskLoggedMinutes(
|
|
153
|
+
tasks.map((task) => ({
|
|
154
|
+
id: task.id,
|
|
155
|
+
parentTaskId: task.parentTaskId,
|
|
156
|
+
loggedMinutes: task.loggedMinutes,
|
|
157
|
+
})),
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Subtask progress per parent (`3/5 podzadań`).
|
|
163
|
+
*
|
|
164
|
+
* The board only ever renders top-level cards, so children arrive from a separate
|
|
165
|
+
* sweep. A child counts as done when it sits in a column flagged `is_done`, with
|
|
166
|
+
* `closed_at` as the fallback for a child whose status is no longer on the board.
|
|
167
|
+
*/
|
|
168
|
+
export function computeSubtaskProgress(
|
|
169
|
+
children: readonly BoardTask[],
|
|
170
|
+
doneStatusIds: ReadonlySet<string>,
|
|
171
|
+
): Map<string, SubtaskProgress> {
|
|
172
|
+
const progress = new Map<string, SubtaskProgress>()
|
|
173
|
+
for (const child of children) {
|
|
174
|
+
if (!child.parentTaskId) continue
|
|
175
|
+
const entry = progress.get(child.parentTaskId) ?? { total: 0, done: 0 }
|
|
176
|
+
entry.total += 1
|
|
177
|
+
const isDone = (child.taskStatusId && doneStatusIds.has(child.taskStatusId)) || !!child.closedAt
|
|
178
|
+
if (isDone) entry.done += 1
|
|
179
|
+
progress.set(child.parentTaskId, entry)
|
|
180
|
+
}
|
|
181
|
+
return progress
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The slot a card dropped on a column takes.
|
|
186
|
+
*
|
|
187
|
+
* Cards land at the top of the target column, matching where the optimistic update
|
|
188
|
+
* puts them, so the server order and the rendered order agree without a refetch.
|
|
189
|
+
* Positions stay on the gap grid the server seeds, so a drop writes one row.
|
|
190
|
+
*/
|
|
191
|
+
export function nextPositionAtColumnTop(tasks: readonly BoardTask[]): number {
|
|
192
|
+
let lowest: number | null = null
|
|
193
|
+
for (const task of tasks) {
|
|
194
|
+
if (!Number.isFinite(task.position)) continue
|
|
195
|
+
if (lowest === null || task.position < lowest) lowest = task.position
|
|
196
|
+
}
|
|
197
|
+
if (lowest === null) return STATUS_POSITION_GAP
|
|
198
|
+
const candidate = Math.floor(lowest / 2)
|
|
199
|
+
return candidate > 0 ? candidate : 1
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Two-letter avatar initials, matching the mockup's `AN` / `PZ` chips. */
|
|
203
|
+
export function initialsFromName(name: string | null | undefined): string {
|
|
204
|
+
const safe = (name ?? '').trim()
|
|
205
|
+
if (!safe) return '?'
|
|
206
|
+
const parts = safe.split(/\s+/).filter((part) => part.length > 0)
|
|
207
|
+
if (parts.length === 0) return '?'
|
|
208
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase()
|
|
209
|
+
return `${parts[0][0]}${parts[parts.length - 1][0]}`.toUpperCase()
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The column accent bar colour.
|
|
214
|
+
*
|
|
215
|
+
* Statuses store a `PROJECT_COLOR_KEYS` token, never raw CSS, so the board resolves
|
|
216
|
+
* the key through the shared palette and paints the 6px bar with an inline
|
|
217
|
+
* background. No status-colour Tailwind class is involved.
|
|
218
|
+
*/
|
|
219
|
+
export function statusAccentColor(status: BoardStatus): string {
|
|
220
|
+
return resolveProjectColorHex(status.color, status.name)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export function sortByPosition<T extends { position: number; id: string }>(rows: readonly T[]): T[] {
|
|
224
|
+
return [...rows].sort((left, right) => {
|
|
225
|
+
if (left.position !== right.position) return left.position - right.position
|
|
226
|
+
return left.id < right.id ? -1 : left.id > right.id ? 1 : 0
|
|
227
|
+
})
|
|
228
|
+
}
|