@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
|
@@ -2,16 +2,46 @@ import { expect, type APIRequestContext } from '@playwright/test'
|
|
|
2
2
|
import { apiRequest } from './api'
|
|
3
3
|
import { deleteStaffEntityIfExists } from './staffFixtures'
|
|
4
4
|
|
|
5
|
+
export type CreateTimeProjectFixtureInput = {
|
|
6
|
+
/**
|
|
7
|
+
* Required in practice: US-B1 makes a customer mandatory on project create, so a
|
|
8
|
+
* call without it cannot succeed. Pass an id from `customers.customer_entities`;
|
|
9
|
+
* `createCompanyFixture` returns one.
|
|
10
|
+
*
|
|
11
|
+
* It is typed optional only because this module is published as
|
|
12
|
+
* `@open-mercato/core/helpers/integration/timesheetFixtures`, and tightening the
|
|
13
|
+
* parameter would break every third-party spec at compile time with no
|
|
14
|
+
* deprecation window. The check below turns the omission into a named error
|
|
15
|
+
* instead of the 422 that six in-repo specs hit (T2.10).
|
|
16
|
+
*/
|
|
17
|
+
customerId?: string
|
|
18
|
+
name?: string
|
|
19
|
+
code?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Creates a time project. `input.customerId` must be supplied — see the type above
|
|
24
|
+
* for why it is not enforced by the compiler.
|
|
25
|
+
*/
|
|
5
26
|
export async function createTimeProjectFixture(
|
|
6
27
|
request: APIRequestContext,
|
|
7
28
|
token: string,
|
|
8
|
-
input?:
|
|
29
|
+
input?: CreateTimeProjectFixtureInput,
|
|
9
30
|
): Promise<string> {
|
|
31
|
+
const customerId = input?.customerId
|
|
32
|
+
if (!customerId) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
'[internal] createTimeProjectFixture requires input.customerId: a customer is mandatory on ' +
|
|
35
|
+
'POST /api/staff/timesheets/time-projects, and there is no safe default to fall back to. ' +
|
|
36
|
+
'Create one first (e.g. createCompanyFixture from crmFixtures) and pass its id.',
|
|
37
|
+
)
|
|
38
|
+
}
|
|
10
39
|
const response = await apiRequest(request, 'POST', '/api/staff/timesheets/time-projects', {
|
|
11
40
|
token,
|
|
12
41
|
data: {
|
|
13
42
|
name: input?.name ?? `QA Project ${Date.now()}`,
|
|
14
43
|
code: input?.code ?? `QA-${Date.now()}`,
|
|
44
|
+
customerId,
|
|
15
45
|
projectType: 'internal',
|
|
16
46
|
status: 'active',
|
|
17
47
|
},
|
|
@@ -9,7 +9,7 @@ Features:
|
|
|
9
9
|
- `mercato auth seed-roles`
|
|
10
10
|
- `mercato auth add-org --name <org>`
|
|
11
11
|
- `mercato auth setup --orgName <org> --email <e> --password <p> [--roles superadmin,admin] [--skip-password-policy]`
|
|
12
|
-
- `mercato auth sync-role-acls [--tenant <tenantId>] [--no-superadmin]` — re-applies each enabled module's `defaultRoleFeatures` to existing tenants. Idempotent and additive (existing custom features are preserved). Run after deploying new module features to ensure existing tenants pick them up; without `--tenant` it iterates every tenant.
|
|
12
|
+
- `mercato auth sync-role-acls [--tenant <tenantId>] [--no-superadmin]` — re-applies each enabled module's `defaultRoleFeatures` (staff roles) **and** `defaultCustomerRoleFeatures` (customer/portal roles) to existing tenants. Idempotent and additive (existing custom features are preserved; no role or ACL row is created). Run after deploying new module features to ensure existing tenants pick them up; without `--tenant` it iterates every tenant. The portal half is skipped in deployments without the `customer_accounts` module.
|
|
13
13
|
|
|
14
14
|
DB entities used (defined in root schema):
|
|
15
15
|
- `users` with: `email`, `password_hash`, `is_confirmed`, `last_login_at`, `organization_id`, timestamps.
|
package/src/modules/auth/cli.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type { KmsService, TenantDek } from '@open-mercato/shared/lib/encryption/
|
|
|
21
21
|
import crypto from 'node:crypto'
|
|
22
22
|
import { formatPasswordRequirements, getPasswordPolicy, validatePassword } from '@open-mercato/shared/lib/auth/passwordPolicy'
|
|
23
23
|
import { parseBooleanToken } from '@open-mercato/shared/lib/boolean'
|
|
24
|
-
import { getCliModules } from '@open-mercato/shared/modules/registry'
|
|
24
|
+
import { getCliModules, type Module } from '@open-mercato/shared/modules/registry'
|
|
25
25
|
|
|
26
26
|
async function resolveTenantScopedRole(em: any, name: string, normalizedTenantId: string | null) {
|
|
27
27
|
const existing = await em.findOne(Role, { name, tenantId: normalizedTenantId })
|
|
@@ -784,6 +784,34 @@ const setPassword: ModuleCli = {
|
|
|
784
784
|
},
|
|
785
785
|
}
|
|
786
786
|
|
|
787
|
+
/**
|
|
788
|
+
* The portal half of the same sync.
|
|
789
|
+
*
|
|
790
|
+
* Staff roles pick up a module's newly declared features here; customer roles used
|
|
791
|
+
* to pick theirs up only at tenant bootstrap, so a portal feature that shipped
|
|
792
|
+
* after a tenant existed never reached that tenant's `Buyer`/`Viewer` roles and the
|
|
793
|
+
* page stayed invisible to every real customer. `customer_accounts` owns those
|
|
794
|
+
* entities and is optional, so it is reached through a guarded dynamic import: a
|
|
795
|
+
* deployment without the module syncs its staff roles exactly as before.
|
|
796
|
+
*/
|
|
797
|
+
async function syncCustomerRoleAcls(
|
|
798
|
+
em: EntityManager,
|
|
799
|
+
tenantId: string,
|
|
800
|
+
modules: Module[],
|
|
801
|
+
): Promise<{ updatedRoleSlugs: string[]; addedFeatures: string[] } | null> {
|
|
802
|
+
let ensure: typeof import('@open-mercato/core/modules/customer_accounts/lib/customerRoleAcls').ensureDefaultCustomerRoleAcls
|
|
803
|
+
try {
|
|
804
|
+
;({ ensureDefaultCustomerRoleAcls: ensure } = await import(
|
|
805
|
+
'@open-mercato/core/modules/customer_accounts/lib/customerRoleAcls'
|
|
806
|
+
))
|
|
807
|
+
} catch {
|
|
808
|
+
// The portal module is not part of this deployment; staff roles are still synced.
|
|
809
|
+
return null
|
|
810
|
+
}
|
|
811
|
+
// Deliberately outside the guard: a failure of the sync itself is a real error.
|
|
812
|
+
return ensure(em, tenantId, modules)
|
|
813
|
+
}
|
|
814
|
+
|
|
787
815
|
const syncRoleAcls: ModuleCli = {
|
|
788
816
|
command: 'sync-role-acls',
|
|
789
817
|
async run(rest) {
|
|
@@ -841,7 +869,13 @@ const syncRoleAcls: ModuleCli = {
|
|
|
841
869
|
for (const tenantId of targetTenantIds) {
|
|
842
870
|
await ensureDefaultRoleAcls(em, tenantId, modules, { includeSuperadminRole })
|
|
843
871
|
await ensureCustomRoleAcls(em, tenantId, modules)
|
|
872
|
+
const portal = await syncCustomerRoleAcls(em, tenantId, modules)
|
|
844
873
|
console.log(`✅ Synced role ACLs for tenant ${tenantId}`)
|
|
874
|
+
if (portal && portal.addedFeatures.length) {
|
|
875
|
+
console.log(
|
|
876
|
+
` ↳ portal roles ${portal.updatedRoleSlugs.join(', ')} gained ${portal.addedFeatures.join(', ')}`,
|
|
877
|
+
)
|
|
878
|
+
}
|
|
845
879
|
}
|
|
846
880
|
},
|
|
847
881
|
}
|
|
@@ -277,6 +277,13 @@
|
|
|
277
277
|
"auth.acl.features.staff.timesheets.manage_own": "Create/edit/delete own entries",
|
|
278
278
|
"auth.acl.features.staff.timesheets.projects.manage": "Manage time projects",
|
|
279
279
|
"auth.acl.features.staff.timesheets.projects.view": "View time projects",
|
|
280
|
+
"auth.acl.features.staff.timesheets.rates.view": "Sätze und Kosten ansehen",
|
|
281
|
+
"auth.acl.features.staff.timesheets.reports.manage": "Kundenberichte erstellen/bearbeiten",
|
|
282
|
+
"auth.acl.features.staff.timesheets.reports.unlock": "Berichtete Einträge entsperren",
|
|
283
|
+
"auth.acl.features.staff.timesheets.reports.view": "Kundenberichte ansehen",
|
|
284
|
+
"auth.acl.features.staff.timesheets.settings.manage": "Zeiterfassungseinstellungen verwalten",
|
|
285
|
+
"auth.acl.features.staff.timesheets.tasks.manage": "Aufgaben erstellen/bearbeiten",
|
|
286
|
+
"auth.acl.features.staff.timesheets.tasks.view": "Aufgaben ansehen",
|
|
280
287
|
"auth.acl.features.staff.timesheets.view": "View own time entries",
|
|
281
288
|
"auth.acl.features.staff.view": "View employees",
|
|
282
289
|
"auth.acl.features.storage_providers.manage": "Manage storage providers",
|
|
@@ -277,6 +277,13 @@
|
|
|
277
277
|
"auth.acl.features.staff.timesheets.manage_own": "Create/edit/delete own entries",
|
|
278
278
|
"auth.acl.features.staff.timesheets.projects.manage": "Manage time projects",
|
|
279
279
|
"auth.acl.features.staff.timesheets.projects.view": "View time projects",
|
|
280
|
+
"auth.acl.features.staff.timesheets.rates.view": "View rates and cost",
|
|
281
|
+
"auth.acl.features.staff.timesheets.reports.manage": "Create/edit customer reports",
|
|
282
|
+
"auth.acl.features.staff.timesheets.reports.unlock": "Unlock reported entries",
|
|
283
|
+
"auth.acl.features.staff.timesheets.reports.view": "View customer reports",
|
|
284
|
+
"auth.acl.features.staff.timesheets.settings.manage": "Manage time tracking settings",
|
|
285
|
+
"auth.acl.features.staff.timesheets.tasks.manage": "Create/edit tasks",
|
|
286
|
+
"auth.acl.features.staff.timesheets.tasks.view": "View tasks",
|
|
280
287
|
"auth.acl.features.staff.timesheets.view": "View own time entries",
|
|
281
288
|
"auth.acl.features.staff.view": "View employees",
|
|
282
289
|
"auth.acl.features.storage_providers.manage": "Manage storage providers",
|
|
@@ -277,6 +277,13 @@
|
|
|
277
277
|
"auth.acl.features.staff.timesheets.manage_own": "Create/edit/delete own entries",
|
|
278
278
|
"auth.acl.features.staff.timesheets.projects.manage": "Manage time projects",
|
|
279
279
|
"auth.acl.features.staff.timesheets.projects.view": "View time projects",
|
|
280
|
+
"auth.acl.features.staff.timesheets.rates.view": "Ver tarifas y costes",
|
|
281
|
+
"auth.acl.features.staff.timesheets.reports.manage": "Crear/editar informes de cliente",
|
|
282
|
+
"auth.acl.features.staff.timesheets.reports.unlock": "Desbloquear entradas reportadas",
|
|
283
|
+
"auth.acl.features.staff.timesheets.reports.view": "Ver informes de cliente",
|
|
284
|
+
"auth.acl.features.staff.timesheets.settings.manage": "Gestionar ajustes de control horario",
|
|
285
|
+
"auth.acl.features.staff.timesheets.tasks.manage": "Crear/editar tareas",
|
|
286
|
+
"auth.acl.features.staff.timesheets.tasks.view": "Ver tareas",
|
|
280
287
|
"auth.acl.features.staff.timesheets.view": "View own time entries",
|
|
281
288
|
"auth.acl.features.staff.view": "View employees",
|
|
282
289
|
"auth.acl.features.storage_providers.manage": "Manage storage providers",
|
|
@@ -277,6 +277,13 @@
|
|
|
277
277
|
"auth.acl.features.staff.timesheets.manage_own": "Create/edit/delete own entries",
|
|
278
278
|
"auth.acl.features.staff.timesheets.projects.manage": "Manage time projects",
|
|
279
279
|
"auth.acl.features.staff.timesheets.projects.view": "View time projects",
|
|
280
|
+
"auth.acl.features.staff.timesheets.rates.view": "요율 및 비용 보기",
|
|
281
|
+
"auth.acl.features.staff.timesheets.reports.manage": "고객 리포트 생성/편집",
|
|
282
|
+
"auth.acl.features.staff.timesheets.reports.unlock": "보고된 항목 잠금 해제",
|
|
283
|
+
"auth.acl.features.staff.timesheets.reports.view": "고객 리포트 보기",
|
|
284
|
+
"auth.acl.features.staff.timesheets.settings.manage": "시간 추적 설정 관리",
|
|
285
|
+
"auth.acl.features.staff.timesheets.tasks.manage": "작업 생성/편집",
|
|
286
|
+
"auth.acl.features.staff.timesheets.tasks.view": "작업 보기",
|
|
280
287
|
"auth.acl.features.staff.timesheets.view": "View own time entries",
|
|
281
288
|
"auth.acl.features.staff.view": "View employees",
|
|
282
289
|
"auth.acl.features.storage_providers.manage": "Manage storage providers",
|
|
@@ -277,6 +277,13 @@
|
|
|
277
277
|
"auth.acl.features.staff.timesheets.manage_own": "Twórz, edytuj i usuwaj własne wpisy",
|
|
278
278
|
"auth.acl.features.staff.timesheets.projects.manage": "Zarządzaj projektami czasu pracy",
|
|
279
279
|
"auth.acl.features.staff.timesheets.projects.view": "Wyświetl projekty czasu pracy",
|
|
280
|
+
"auth.acl.features.staff.timesheets.rates.view": "Podgląd stawek i kosztów",
|
|
281
|
+
"auth.acl.features.staff.timesheets.reports.manage": "Tworzenie/edycja raportów klienta",
|
|
282
|
+
"auth.acl.features.staff.timesheets.reports.unlock": "Odblokowanie zaraportowanych wpisów",
|
|
283
|
+
"auth.acl.features.staff.timesheets.reports.view": "Podgląd raportów klienta",
|
|
284
|
+
"auth.acl.features.staff.timesheets.settings.manage": "Zarządzanie ustawieniami śledzenia czasu",
|
|
285
|
+
"auth.acl.features.staff.timesheets.tasks.manage": "Tworzenie/edycja zadań",
|
|
286
|
+
"auth.acl.features.staff.timesheets.tasks.view": "Podgląd zadań",
|
|
280
287
|
"auth.acl.features.staff.timesheets.view": "Wyświetl własne wpisy czasu pracy",
|
|
281
288
|
"auth.acl.features.staff.view": "Wyświetl pracowników",
|
|
282
289
|
"auth.acl.features.storage_providers.manage": "Zarządzaj dostawcami pamięci masowej",
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merging every enabled module's `setup.defaultCustomerRoleFeatures` into the
|
|
3
|
+
* `CustomerRoleAcl` rows a tenant already has.
|
|
4
|
+
*
|
|
5
|
+
* The staff side of this has always had two entry points: tenant bootstrap, and
|
|
6
|
+
* `mercato auth sync-role-acls` for tenants that already existed when a module
|
|
7
|
+
* declared a new feature. The customer side only ever ran at bootstrap, so a
|
|
8
|
+
* portal feature shipped after a tenant was created never reached the `Buyer` and
|
|
9
|
+
* `Viewer` roles that tenant is actually using — the page was simply invisible to
|
|
10
|
+
* every real customer until somebody granted it by hand. It lives here rather than
|
|
11
|
+
* in `setup.ts` so both entry points can call the same merge.
|
|
12
|
+
*
|
|
13
|
+
* Additive and idempotent: a feature is only ever added, never removed, and a role
|
|
14
|
+
* or ACL row that does not exist is skipped rather than created — seeding roles is
|
|
15
|
+
* `seedDefaultRoles`' job.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
19
|
+
import type { Module } from '@open-mercato/shared/modules/registry'
|
|
20
|
+
import {
|
|
21
|
+
CustomerRole,
|
|
22
|
+
CustomerRoleAcl,
|
|
23
|
+
} from '@open-mercato/core/modules/customer_accounts/data/entities'
|
|
24
|
+
|
|
25
|
+
export type CustomerRoleAclSyncResult = {
|
|
26
|
+
/** Role slugs whose ACL row gained at least one feature. */
|
|
27
|
+
updatedRoleSlugs: string[]
|
|
28
|
+
/** Features added, across every role, deduplicated — what to report to an operator. */
|
|
29
|
+
addedFeatures: string[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function ensureDefaultCustomerRoleAcls(
|
|
33
|
+
em: EntityManager,
|
|
34
|
+
tenantId: string,
|
|
35
|
+
modules: Module[],
|
|
36
|
+
): Promise<CustomerRoleAclSyncResult> {
|
|
37
|
+
const featuresByRole: Record<string, string[]> = {}
|
|
38
|
+
|
|
39
|
+
for (const mod of modules) {
|
|
40
|
+
const customerRoleFeatures = mod.setup?.defaultCustomerRoleFeatures
|
|
41
|
+
if (!customerRoleFeatures) continue
|
|
42
|
+
for (const [roleSlug, features] of Object.entries(customerRoleFeatures)) {
|
|
43
|
+
if (!features || !features.length) continue
|
|
44
|
+
if (!featuresByRole[roleSlug]) featuresByRole[roleSlug] = []
|
|
45
|
+
featuresByRole[roleSlug].push(...features)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const result: CustomerRoleAclSyncResult = { updatedRoleSlugs: [], addedFeatures: [] }
|
|
50
|
+
const roleSlugs = Object.keys(featuresByRole)
|
|
51
|
+
if (!roleSlugs.length) return result
|
|
52
|
+
|
|
53
|
+
const added = new Set<string>()
|
|
54
|
+
for (const roleSlug of roleSlugs) {
|
|
55
|
+
const role = await em.findOne(CustomerRole, { tenantId, slug: roleSlug, deletedAt: null })
|
|
56
|
+
if (!role) continue
|
|
57
|
+
|
|
58
|
+
const acl = await em.findOne(CustomerRoleAcl, { role: role.id as any, tenantId })
|
|
59
|
+
if (!acl) continue
|
|
60
|
+
|
|
61
|
+
const currentFeatures = Array.isArray(acl.featuresJson) ? acl.featuresJson : []
|
|
62
|
+
const merged = Array.from(new Set([...currentFeatures, ...featuresByRole[roleSlug]]))
|
|
63
|
+
const changed =
|
|
64
|
+
merged.length !== currentFeatures.length ||
|
|
65
|
+
merged.some((value, index) => value !== currentFeatures[index])
|
|
66
|
+
if (!changed) continue
|
|
67
|
+
|
|
68
|
+
const known = new Set(currentFeatures)
|
|
69
|
+
acl.featuresJson = merged
|
|
70
|
+
em.persist(acl)
|
|
71
|
+
result.updatedRoleSlugs.push(roleSlug)
|
|
72
|
+
for (const feature of merged) {
|
|
73
|
+
if (!known.has(feature)) added.add(feature)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
result.addedFeatures = Array.from(added)
|
|
77
|
+
await em.flush()
|
|
78
|
+
return result
|
|
79
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModuleSetupConfig, DefaultCustomerRoleFeatures } from '@open-mercato/shared/modules/setup'
|
|
2
2
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
3
|
-
import type { Module } from '@open-mercato/shared/modules/registry'
|
|
4
3
|
import { hash } from 'bcryptjs'
|
|
4
|
+
import { ensureDefaultCustomerRoleAcls } from '@open-mercato/core/modules/customer_accounts/lib/customerRoleAcls'
|
|
5
5
|
import { hashForLookup } from '@open-mercato/shared/lib/encryption/aes'
|
|
6
6
|
import { EXAMPLE_PORTAL_ACCOUNTS } from '@open-mercato/core/modules/customer_accounts/lib/exampleAccounts'
|
|
7
7
|
import {
|
|
@@ -142,50 +142,6 @@ const DEFAULT_CUSTOMER_ROLE_FEATURES = Object.fromEntries(
|
|
|
142
142
|
DEFAULT_ROLES.map((role) => [role.slug, [...role.acl.features]]),
|
|
143
143
|
)
|
|
144
144
|
|
|
145
|
-
/**
|
|
146
|
-
* Collect defaultCustomerRoleFeatures from all enabled modules and merge
|
|
147
|
-
* them into the corresponding CustomerRoleAcl records.
|
|
148
|
-
*/
|
|
149
|
-
async function ensureDefaultCustomerRoleAcls(
|
|
150
|
-
em: EntityManager,
|
|
151
|
-
tenantId: string,
|
|
152
|
-
modules: Module[],
|
|
153
|
-
): Promise<void> {
|
|
154
|
-
const featuresByRole: Record<string, string[]> = {}
|
|
155
|
-
|
|
156
|
-
for (const mod of modules) {
|
|
157
|
-
const customerRoleFeatures = mod.setup?.defaultCustomerRoleFeatures
|
|
158
|
-
if (!customerRoleFeatures) continue
|
|
159
|
-
for (const [roleSlug, features] of Object.entries(customerRoleFeatures)) {
|
|
160
|
-
if (!features || !features.length) continue
|
|
161
|
-
if (!featuresByRole[roleSlug]) featuresByRole[roleSlug] = []
|
|
162
|
-
featuresByRole[roleSlug].push(...features)
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const roleSlugs = Object.keys(featuresByRole)
|
|
167
|
-
if (!roleSlugs.length) return
|
|
168
|
-
|
|
169
|
-
for (const roleSlug of roleSlugs) {
|
|
170
|
-
const role = await em.findOne(CustomerRole, { tenantId, slug: roleSlug, deletedAt: null })
|
|
171
|
-
if (!role) continue
|
|
172
|
-
|
|
173
|
-
const acl = await em.findOne(CustomerRoleAcl, { role: role.id as any, tenantId })
|
|
174
|
-
if (!acl) continue
|
|
175
|
-
|
|
176
|
-
const currentFeatures = Array.isArray(acl.featuresJson) ? acl.featuresJson : []
|
|
177
|
-
const merged = Array.from(new Set([...currentFeatures, ...featuresByRole[roleSlug]]))
|
|
178
|
-
const changed =
|
|
179
|
-
merged.length !== currentFeatures.length ||
|
|
180
|
-
merged.some((value, index) => value !== currentFeatures[index])
|
|
181
|
-
if (changed) {
|
|
182
|
-
acl.featuresJson = merged
|
|
183
|
-
em.persist(acl)
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
await em.flush()
|
|
187
|
-
}
|
|
188
|
-
|
|
189
145
|
async function seedDefaultRoles(em: EntityManager, scope: SeedScope): Promise<void> {
|
|
190
146
|
for (const roleDef of DEFAULT_ROLES) {
|
|
191
147
|
const existing = await em.findOne(CustomerRole, {
|
|
@@ -111,6 +111,7 @@ interface DataSyncAdapter {
|
|
|
111
111
|
getInitialCursor?(input: { entityType: string; scope: TenantScope }): Promise<string | null>
|
|
112
112
|
getMapping(input: { entityType: string; scope: TenantScope }): Promise<DataMapping>
|
|
113
113
|
persistsSharedCursor?(entityType: string): boolean
|
|
114
|
+
supportsStartControl?(control: 'fullSync' | 'batchSize', entityType: string): boolean
|
|
114
115
|
validateConnection?(input: {
|
|
115
116
|
entityType: string
|
|
116
117
|
credentials: Record<string, unknown>
|
|
@@ -190,6 +191,39 @@ against the defaults, not against `undefined`. A default that violates its own
|
|
|
190
191
|
declaration skips the scheduled run with a logged error instead of starting it
|
|
191
192
|
with a half-applied set.
|
|
192
193
|
|
|
194
|
+
### Start controls
|
|
195
|
+
|
|
196
|
+
The dashboard's "Run once now" card also renders two controls the framework owns
|
|
197
|
+
— **Run as full sync** and **Batch size**. Whether either is meaningful for an
|
|
198
|
+
entity type is adapter knowledge, so an adapter may declare it per entity type:
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
supportsStartControl: (control, entityType) =>
|
|
202
|
+
!(control === 'fullSync' && entityType.endsWith('.backfill')),
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Only an explicit `false` removes a control; an adapter that declares nothing —
|
|
206
|
+
or returns nothing — keeps today's form exactly. Return `false` where the
|
|
207
|
+
operator's choice reaches the adapter and changes nothing observable: an entity
|
|
208
|
+
type whose cursor carries identity, so an inherited cursor is discarded and the
|
|
209
|
+
run starts from the top whichever way `fullSync` is set; or one whose paging the
|
|
210
|
+
source fixes, so `batchSize` is read and ignored.
|
|
211
|
+
|
|
212
|
+
`api/options.ts` evaluates the predicate across `supportedEntities` and ships the
|
|
213
|
+
result as `startControls` — a **sparse** map, so an entity type with no
|
|
214
|
+
restriction is omitted and an adapter that declares nothing serializes to `{}`.
|
|
215
|
+
`lib/start-controls.ts` owns both halves (`resolveStartControlMap` server-side,
|
|
216
|
+
`applicableStartControls` in the dashboard); a predicate that throws is treated
|
|
217
|
+
as *applies*, because the options route resolves every registered adapter in one
|
|
218
|
+
response.
|
|
219
|
+
|
|
220
|
+
**This governs what the dashboard offers, never what the API accepts.**
|
|
221
|
+
`POST /api/data_sync/run` keeps honouring both fields, so a client posting
|
|
222
|
+
`fullSync: true` still gets a `null` start cursor whatever the adapter declares.
|
|
223
|
+
Do not derive applicability from `persistsSharedCursor` — where a cursor is
|
|
224
|
+
stored and whether restarting from scratch is meaningful are independent facts,
|
|
225
|
+
and both belong to the adapter to state.
|
|
226
|
+
|
|
193
227
|
If the sync provider needs bootstrap credentials, mappings, locales, channels, or other default sync settings after a fresh install, implement a provider-owned env preset flow:
|
|
194
228
|
|
|
195
229
|
- read env vars in the provider package
|
|
@@ -6,6 +6,7 @@ import { getAllIntegrations } from '@open-mercato/shared/modules/integrations/ty
|
|
|
6
6
|
import type { CredentialsService } from '../../integrations/lib/credentials-service'
|
|
7
7
|
import type { IntegrationStateService } from '../../integrations/lib/state-service'
|
|
8
8
|
import { getDataSyncAdapter } from '../lib/adapter-registry'
|
|
9
|
+
import { resolveStartControlMap } from '../lib/start-controls'
|
|
9
10
|
|
|
10
11
|
export const metadata = {
|
|
11
12
|
GET: { requireAuth: true, requireFeatures: ['data_sync.view'] },
|
|
@@ -56,6 +57,7 @@ export async function GET(req: Request) {
|
|
|
56
57
|
canStartRun: adapter.runMode !== 'provider',
|
|
57
58
|
supportedEntities: adapter.supportedEntities,
|
|
58
59
|
runParameters: adapter.runParameters ?? [],
|
|
60
|
+
startControls: resolveStartControlMap(adapter),
|
|
59
61
|
hasCredentials: Boolean(credentials),
|
|
60
62
|
isEnabled,
|
|
61
63
|
settingsPath: `/backend/integrations/${encodeURIComponent(integration.id)}`,
|
|
@@ -31,6 +31,7 @@ import { surfaceRecordConflict } from '@open-mercato/ui/backend/conflicts'
|
|
|
31
31
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
32
32
|
import { useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
|
|
33
33
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
34
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
34
35
|
import {
|
|
35
36
|
ArrowRightLeft,
|
|
36
37
|
Boxes,
|
|
@@ -46,6 +47,11 @@ import {
|
|
|
46
47
|
import { getSyncRunStatusVariant, getSyncSummaryVariant } from '../../lib/syncRunStatus'
|
|
47
48
|
import type { RunParameter } from '../../lib/adapter'
|
|
48
49
|
import { getApplicableRunParameters } from '../../lib/run-parameters'
|
|
50
|
+
import {
|
|
51
|
+
applicableStartControls,
|
|
52
|
+
type StartControlApplicability,
|
|
53
|
+
type StartControlMap,
|
|
54
|
+
} from '../../lib/start-controls'
|
|
49
55
|
import {
|
|
50
56
|
RunParameterFields,
|
|
51
57
|
buildDefaultRunParameterValues,
|
|
@@ -87,6 +93,7 @@ type SyncOption = {
|
|
|
87
93
|
canStartRun?: boolean
|
|
88
94
|
supportedEntities: string[]
|
|
89
95
|
runParameters?: RunParameter[]
|
|
96
|
+
startControls?: StartControlMap
|
|
90
97
|
hasCredentials: boolean
|
|
91
98
|
isEnabled: boolean
|
|
92
99
|
settingsPath: string
|
|
@@ -127,6 +134,20 @@ type SyncScheduleEditorState = {
|
|
|
127
134
|
|
|
128
135
|
const DEFAULT_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
|
|
129
136
|
|
|
137
|
+
/** Matches `runSyncSchema`'s own default, so omitting the field submits this value. */
|
|
138
|
+
const DEFAULT_BATCH_SIZE = '100'
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Keeps the batch size input at its own narrow width without leaving a phantom
|
|
142
|
+
* track: the second column exists only when the full sync card fills it. With
|
|
143
|
+
* only that card the row falls back to one full-width column.
|
|
144
|
+
*/
|
|
145
|
+
function startControlsGridClass(controls: StartControlApplicability): string | undefined {
|
|
146
|
+
if (controls.batchSize && controls.fullSync) return 'sm:grid-cols-[minmax(0,180px)_1fr]'
|
|
147
|
+
if (controls.batchSize) return 'sm:grid-cols-[minmax(0,180px)]'
|
|
148
|
+
return undefined
|
|
149
|
+
}
|
|
150
|
+
|
|
130
151
|
function formatEntityTypeLabel(entityType: string): string {
|
|
131
152
|
return entityType
|
|
132
153
|
.replace(/[_-]+/g, ' ')
|
|
@@ -162,7 +183,7 @@ export default function SyncRunsDashboardPage() {
|
|
|
162
183
|
const [selectedIntegrationId, setSelectedIntegrationId] = React.useState('')
|
|
163
184
|
const [selectedEntityType, setSelectedEntityType] = React.useState('')
|
|
164
185
|
const [selectedDirection, setSelectedDirection] = React.useState<'import' | 'export'>('import')
|
|
165
|
-
const [batchSize, setBatchSize] = React.useState(
|
|
186
|
+
const [batchSize, setBatchSize] = React.useState(DEFAULT_BATCH_SIZE)
|
|
166
187
|
const [fullSync, setFullSync] = React.useState(false)
|
|
167
188
|
const [paramValues, setParamValues] = React.useState<Record<string, RunParameterFormValue>>({})
|
|
168
189
|
const [scheduleEditor, setScheduleEditor] = React.useState<SyncScheduleEditorState>(() => buildDefaultScheduleState(''))
|
|
@@ -261,10 +282,27 @@ export default function SyncRunsDashboardPage() {
|
|
|
261
282
|
[selectedIntegration, selectedDirection, selectedEntityType],
|
|
262
283
|
)
|
|
263
284
|
|
|
285
|
+
// Before an entity is chosen the state is '', which matches no declaration and
|
|
286
|
+
// so renders both controls — the unselected form as it is today.
|
|
287
|
+
const startControls = React.useMemo(
|
|
288
|
+
() => applicableStartControls(selectedIntegration?.startControls, selectedEntityType),
|
|
289
|
+
[selectedIntegration, selectedEntityType],
|
|
290
|
+
)
|
|
291
|
+
|
|
264
292
|
React.useEffect(() => {
|
|
265
293
|
setParamValues(buildDefaultRunParameterValues(runParameters))
|
|
266
294
|
}, [runParameters])
|
|
267
295
|
|
|
296
|
+
// A control the form stopped showing must not keep submitting the value the
|
|
297
|
+
// operator last set for another entity type.
|
|
298
|
+
React.useEffect(() => {
|
|
299
|
+
if (!startControls.fullSync) setFullSync(false)
|
|
300
|
+
}, [startControls.fullSync])
|
|
301
|
+
|
|
302
|
+
React.useEffect(() => {
|
|
303
|
+
if (!startControls.batchSize) setBatchSize(DEFAULT_BATCH_SIZE)
|
|
304
|
+
}, [startControls.batchSize])
|
|
305
|
+
|
|
268
306
|
const updateParamValue = React.useCallback((key: string, value: RunParameterFormValue) => {
|
|
269
307
|
setParamValues((current) => ({ ...current, [key]: value }))
|
|
270
308
|
}, [])
|
|
@@ -384,20 +422,23 @@ export default function SyncRunsDashboardPage() {
|
|
|
384
422
|
const handleStartSync = React.useCallback(async () => {
|
|
385
423
|
if (!selectedIntegration || !selectedEntityType) return
|
|
386
424
|
|
|
387
|
-
const parsedBatchSize = Number.parseInt(batchSize, 10)
|
|
388
|
-
if (!Number.isFinite(parsedBatchSize) || parsedBatchSize < 1 || parsedBatchSize > 1000) {
|
|
389
|
-
flash(t('data_sync.dashboard.start.invalidBatchSize', 'Batch size must be between 1 and 1000.'), 'error')
|
|
390
|
-
return
|
|
391
|
-
}
|
|
392
|
-
|
|
393
425
|
const parameters = buildRunParametersPayload(runParameters, paramValues)
|
|
426
|
+
// A control the adapter declared inapplicable is left out entirely, so
|
|
427
|
+
// `runSyncSchema`'s defaults supply exactly what the rendered form sends.
|
|
394
428
|
const requestBody: Record<string, unknown> = {
|
|
395
429
|
integrationId: selectedIntegration.integrationId,
|
|
396
430
|
entityType: selectedEntityType,
|
|
397
431
|
direction: selectedDirection,
|
|
398
|
-
batchSize: parsedBatchSize,
|
|
399
|
-
fullSync,
|
|
400
432
|
}
|
|
433
|
+
if (startControls.batchSize) {
|
|
434
|
+
const parsedBatchSize = Number.parseInt(batchSize, 10)
|
|
435
|
+
if (!Number.isFinite(parsedBatchSize) || parsedBatchSize < 1 || parsedBatchSize > 1000) {
|
|
436
|
+
flash(t('data_sync.dashboard.start.invalidBatchSize', 'Batch size must be between 1 and 1000.'), 'error')
|
|
437
|
+
return
|
|
438
|
+
}
|
|
439
|
+
requestBody.batchSize = parsedBatchSize
|
|
440
|
+
}
|
|
441
|
+
if (startControls.fullSync) requestBody.fullSync = fullSync
|
|
401
442
|
if (runParameters.length > 0) requestBody.parameters = parameters
|
|
402
443
|
|
|
403
444
|
try {
|
|
@@ -432,7 +473,7 @@ export default function SyncRunsDashboardPage() {
|
|
|
432
473
|
const message = error instanceof Error ? error.message : t('data_sync.dashboard.start.error', 'Failed to start sync run')
|
|
433
474
|
flash(message, 'error')
|
|
434
475
|
}
|
|
435
|
-
}, [batchSize, fullSync, paramValues, router, runMutation, runParameters, selectedDirection, selectedEntityType, selectedIntegration, t])
|
|
476
|
+
}, [batchSize, fullSync, paramValues, router, runMutation, runParameters, selectedDirection, selectedEntityType, selectedIntegration, startControls, t])
|
|
436
477
|
|
|
437
478
|
const handleSaveSchedule = React.useCallback(async () => {
|
|
438
479
|
if (!selectedIntegration || !selectedEntityType) return
|
|
@@ -791,7 +832,9 @@ export default function SyncRunsDashboardPage() {
|
|
|
791
832
|
<h3 className="text-sm font-semibold">{t('data_sync.dashboard.start.runNowTitle', 'Run once now')}</h3>
|
|
792
833
|
</div>
|
|
793
834
|
<p className="text-sm text-muted-foreground">
|
|
794
|
-
{
|
|
835
|
+
{startControls.batchSize && startControls.fullSync
|
|
836
|
+
? t('data_sync.dashboard.start.runNowDescription', 'Use this for the next immediate sync. Batch size and full-sync mode apply only to this manual run.')
|
|
837
|
+
: t('data_sync.dashboard.start.runNowDescriptionScoped', 'Use this for the next immediate sync. Anything set here applies only to this manual run.')}
|
|
795
838
|
</p>
|
|
796
839
|
</div>
|
|
797
840
|
<Badge variant="outline">{selectedEntityLabel}</Badge>
|
|
@@ -799,30 +842,36 @@ export default function SyncRunsDashboardPage() {
|
|
|
799
842
|
|
|
800
843
|
<Separator className="my-4" />
|
|
801
844
|
|
|
802
|
-
|
|
803
|
-
<div className=
|
|
804
|
-
|
|
805
|
-
<
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
<div className="flex items-center justify-between gap-3">
|
|
816
|
-
<div className="space-y-1">
|
|
817
|
-
<Label className="text-sm font-medium">{t('data_sync.dashboard.start.fullSync', 'Run as full sync')}</Label>
|
|
818
|
-
<p className="text-xs text-muted-foreground">
|
|
819
|
-
{t('data_sync.dashboard.start.fullSyncHelp', 'Ignore the saved cursor and process the entire source again for this run.')}
|
|
820
|
-
</p>
|
|
845
|
+
{startControls.batchSize || startControls.fullSync ? (
|
|
846
|
+
<div className={cn('grid gap-4', startControlsGridClass(startControls))}>
|
|
847
|
+
{startControls.batchSize ? (
|
|
848
|
+
<div className="space-y-2">
|
|
849
|
+
<Label className="flex items-center gap-2 text-sm font-medium">
|
|
850
|
+
<Gauge className="size-4 text-muted-foreground" />
|
|
851
|
+
<span>{t('data_sync.dashboard.start.batchSize', 'Batch size')}</span>
|
|
852
|
+
</Label>
|
|
853
|
+
<Input
|
|
854
|
+
value={batchSize}
|
|
855
|
+
onChange={(event) => setBatchSize(event.target.value)}
|
|
856
|
+
inputMode="numeric"
|
|
857
|
+
/>
|
|
821
858
|
</div>
|
|
822
|
-
|
|
823
|
-
|
|
859
|
+
) : null}
|
|
860
|
+
{startControls.fullSync ? (
|
|
861
|
+
<div className="rounded-lg border bg-background p-3">
|
|
862
|
+
<div className="flex items-center justify-between gap-3">
|
|
863
|
+
<div className="space-y-1">
|
|
864
|
+
<Label className="text-sm font-medium">{t('data_sync.dashboard.start.fullSync', 'Run as full sync')}</Label>
|
|
865
|
+
<p className="text-xs text-muted-foreground">
|
|
866
|
+
{t('data_sync.dashboard.start.fullSyncHelp', 'Ignore the saved cursor and process the entire source again for this run.')}
|
|
867
|
+
</p>
|
|
868
|
+
</div>
|
|
869
|
+
<Switch checked={fullSync} onCheckedChange={setFullSync} />
|
|
870
|
+
</div>
|
|
871
|
+
</div>
|
|
872
|
+
) : null}
|
|
824
873
|
</div>
|
|
825
|
-
|
|
874
|
+
) : null}
|
|
826
875
|
|
|
827
876
|
{runParameters.length > 0 ? (
|
|
828
877
|
<div className="mt-4 space-y-3">
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"data_sync.dashboard.start.parametersHelp": "Optionale Werte, die diese Integration für den manuellen Lauf akzeptiert.",
|
|
60
60
|
"data_sync.dashboard.start.providerManaged": "Diese Integration startet Synchronisierungsläufe über ihren eigenen Einrichtungsablauf. Öffne die Integrationseinstellungen, um fortzufahren.",
|
|
61
61
|
"data_sync.dashboard.start.runNowDescription": "Use this for the next immediate sync. Batch size and full-sync mode apply only to this manual run.",
|
|
62
|
+
"data_sync.dashboard.start.runNowDescriptionScoped": "Use this for the next immediate sync. Anything set here applies only to this manual run.",
|
|
62
63
|
"data_sync.dashboard.start.runNowFootnote": "Manual runs show progress immediately and land on the run detail page after launch.",
|
|
63
64
|
"data_sync.dashboard.start.runNowTitle": "Run once now",
|
|
64
65
|
"data_sync.dashboard.start.status.credentialsMissing": "Credentials missing",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"data_sync.dashboard.start.parametersHelp": "Optional values this integration accepts for the manual run.",
|
|
60
60
|
"data_sync.dashboard.start.providerManaged": "This integration starts sync runs from its own setup flow. Open the integration settings page to continue.",
|
|
61
61
|
"data_sync.dashboard.start.runNowDescription": "Use this for the next immediate sync. Batch size and full-sync mode apply only to this manual run.",
|
|
62
|
+
"data_sync.dashboard.start.runNowDescriptionScoped": "Use this for the next immediate sync. Anything set here applies only to this manual run.",
|
|
62
63
|
"data_sync.dashboard.start.runNowFootnote": "Manual runs show progress immediately and land on the run detail page after launch.",
|
|
63
64
|
"data_sync.dashboard.start.runNowTitle": "Run once now",
|
|
64
65
|
"data_sync.dashboard.start.status.credentialsMissing": "Credentials missing",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"data_sync.dashboard.start.parametersHelp": "Valores opcionales que esta integración acepta para la ejecución manual.",
|
|
60
60
|
"data_sync.dashboard.start.providerManaged": "Esta integración inicia las sincronizaciones desde su propio flujo de configuración. Abre la página de ajustes de la integración para continuar.",
|
|
61
61
|
"data_sync.dashboard.start.runNowDescription": "Use this for the next immediate sync. Batch size and full-sync mode apply only to this manual run.",
|
|
62
|
+
"data_sync.dashboard.start.runNowDescriptionScoped": "Use this for the next immediate sync. Anything set here applies only to this manual run.",
|
|
62
63
|
"data_sync.dashboard.start.runNowFootnote": "Manual runs show progress immediately and land on the run detail page after launch.",
|
|
63
64
|
"data_sync.dashboard.start.runNowTitle": "Run once now",
|
|
64
65
|
"data_sync.dashboard.start.status.credentialsMissing": "Credentials missing",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"data_sync.dashboard.start.parametersHelp": "이 통합이 수동 실행에 대해 허용하는 선택적 값입니다.",
|
|
60
60
|
"data_sync.dashboard.start.providerManaged": "이 통합은 자체 설정 흐름에서 동기화 실행을 시작합니다. 계속하려면 통합 설정 페이지를 여세요.",
|
|
61
61
|
"data_sync.dashboard.start.runNowDescription": "다음 즉시 동기화에 사용하세요. 배치 크기와 전체 동기화 모드는 이 수동 실행에만 적용됩니다.",
|
|
62
|
+
"data_sync.dashboard.start.runNowDescriptionScoped": "다음 즉시 동기화에 사용하세요. 여기에서 설정한 값은 이 수동 실행에만 적용됩니다.",
|
|
62
63
|
"data_sync.dashboard.start.runNowFootnote": "수동 실행은 즉시 진행 상황을 표시하며 시작 후 실행 상세 페이지로 이동합니다.",
|
|
63
64
|
"data_sync.dashboard.start.runNowTitle": "지금 한 번 실행",
|
|
64
65
|
"data_sync.dashboard.start.status.credentialsMissing": "자격 증명 누락",
|