@open-mercato/core 0.6.4-develop.4210.1.d412061cfe → 0.6.4-develop.4236.1.9fa6806b34
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 +37 -0
- package/dist/generated/entities/staff_time_entry/index.js.map +7 -0
- package/dist/generated/entities/staff_time_entry_segment/index.js +23 -0
- package/dist/generated/entities/staff_time_entry_segment/index.js.map +7 -0
- package/dist/generated/entities/staff_time_project/index.js +35 -0
- package/dist/generated/entities/staff_time_project/index.js.map +7 -0
- package/dist/generated/entities/staff_time_project_member/index.js +29 -0
- package/dist/generated/entities/staff_time_project_member/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +5 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +64 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/timesheetFixtures.js +50 -0
- package/dist/helpers/integration/timesheetFixtures.js.map +7 -0
- package/dist/modules/attachments/api/library/[id]/route.js +20 -16
- package/dist/modules/attachments/api/library/[id]/route.js.map +2 -2
- package/dist/modules/attachments/api/route.js +18 -14
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/auth/api/roles/acl/route.js +10 -4
- package/dist/modules/auth/api/roles/acl/route.js.map +2 -2
- package/dist/modules/auth/api/sidebar/preferences/route.js +27 -20
- package/dist/modules/auth/api/sidebar/preferences/route.js.map +2 -2
- package/dist/modules/auth/api/users/acl/route.js +16 -11
- package/dist/modules/auth/api/users/acl/route.js.map +2 -2
- package/dist/modules/auth/commands/users.js +87 -71
- package/dist/modules/auth/commands/users.js.map +2 -2
- package/dist/modules/auth/services/sidebarPreferencesService.js +39 -30
- package/dist/modules/auth/services/sidebarPreferencesService.js.map +2 -2
- package/dist/modules/catalog/commands/categories.js +61 -12
- package/dist/modules/catalog/commands/categories.js.map +2 -2
- package/dist/modules/catalog/commands/products.js +79 -54
- package/dist/modules/catalog/commands/products.js.map +2 -2
- package/dist/modules/catalog/commands/variants.js +29 -16
- package/dist/modules/catalog/commands/variants.js.map +2 -2
- package/dist/modules/currencies/commands/currencies.js +15 -8
- package/dist/modules/currencies/commands/currencies.js.map +2 -2
- package/dist/modules/customer_accounts/api/admin/users.js +27 -26
- package/dist/modules/customer_accounts/api/admin/users.js.map +2 -2
- package/dist/modules/customer_accounts/api/password/reset-confirm.js +5 -5
- package/dist/modules/customer_accounts/api/password/reset-confirm.js.map +2 -2
- package/dist/modules/customer_accounts/api/portal/users/[id]/roles.js +11 -10
- package/dist/modules/customer_accounts/api/portal/users/[id]/roles.js.map +2 -2
- package/dist/modules/customers/commands/addresses.js +35 -21
- package/dist/modules/customers/commands/addresses.js.map +2 -2
- package/dist/modules/customers/commands/companies.js +163 -162
- package/dist/modules/customers/commands/companies.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +3 -4
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js +19 -22
- package/dist/modules/customers/commands/interactions.js.map +2 -2
- package/dist/modules/customers/commands/people.js +18 -15
- package/dist/modules/customers/commands/people.js.map +2 -2
- package/dist/modules/customers/commands/personCompanyLinks.js +105 -94
- package/dist/modules/customers/commands/personCompanyLinks.js.map +2 -2
- package/dist/modules/customers/commands/pipeline-stages.js +30 -23
- package/dist/modules/customers/commands/pipeline-stages.js.map +2 -2
- package/dist/modules/customers/commands/pipelines.js +27 -20
- package/dist/modules/customers/commands/pipelines.js.map +2 -2
- package/dist/modules/customers/commands/tags.js +13 -5
- package/dist/modules/customers/commands/tags.js.map +2 -2
- package/dist/modules/dashboards/api/users/widgets/route.js +0 -1
- package/dist/modules/dashboards/api/users/widgets/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/route.js +29 -1
- package/dist/modules/dashboards/api/widgets/data/route.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-engine.js +4 -4
- package/dist/modules/data_sync/lib/sync-engine.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-run-service.js +51 -27
- package/dist/modules/data_sync/lib/sync-run-service.js.map +2 -2
- package/dist/modules/directory/commands/organizations.js +192 -158
- package/dist/modules/directory/commands/organizations.js.map +3 -3
- package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js +22 -16
- package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js.map +2 -2
- package/dist/modules/messages/commands/messages.js +77 -75
- package/dist/modules/messages/commands/messages.js.map +2 -2
- package/dist/modules/messages/commands/shared.js +132 -132
- package/dist/modules/messages/commands/shared.js.map +2 -2
- package/dist/modules/perspectives/api/[tableId]/route.js +37 -26
- package/dist/modules/perspectives/api/[tableId]/route.js.map +2 -2
- package/dist/modules/resources/commands/resources.js +125 -117
- package/dist/modules/resources/commands/resources.js.map +2 -2
- package/dist/modules/resources/commands/tags.js +7 -3
- package/dist/modules/resources/commands/tags.js.map +2 -2
- package/dist/modules/sales/api/quotes/send/route.js +12 -11
- package/dist/modules/sales/api/quotes/send/route.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +629 -478
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +146 -146
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/commands/returns.js +68 -60
- package/dist/modules/sales/commands/returns.js.map +2 -2
- package/dist/modules/staff/acl.js +10 -1
- package/dist/modules/staff/acl.js.map +2 -2
- package/dist/modules/staff/analytics.js +33 -0
- package/dist/modules/staff/analytics.js.map +7 -0
- package/dist/modules/staff/api/guards.js +31 -0
- package/dist/modules/staff/api/guards.js.map +7 -0
- package/dist/modules/staff/api/interceptors.js +96 -0
- package/dist/modules/staff/api/interceptors.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +170 -0
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-projects/route.js +103 -0
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +147 -0
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js +171 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +180 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +155 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +173 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +260 -0
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/route.js +188 -0
- package/dist/modules/staff/api/timesheets/time-entries/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js +159 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-projects/route.js +230 -0
- package/dist/modules/staff/api/timesheets/time-projects/route.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/page.js +710 -0
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js +22 -0
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js +125 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js +418 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js +79 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +602 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js +25 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js +123 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js.map +7 -0
- package/dist/modules/staff/cli.js +38 -1
- package/dist/modules/staff/cli.js.map +2 -2
- package/dist/modules/staff/commands/index.js +2 -0
- package/dist/modules/staff/commands/index.js.map +2 -2
- package/dist/modules/staff/commands/leave-requests.js +30 -28
- package/dist/modules/staff/commands/leave-requests.js.map +3 -3
- package/dist/modules/staff/commands/team-members.js +21 -20
- package/dist/modules/staff/commands/team-members.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js +409 -0
- package/dist/modules/staff/commands/timesheets-entries.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-projects.js +618 -0
- package/dist/modules/staff/commands/timesheets-projects.js.map +7 -0
- package/dist/modules/staff/data/enrichers.js +104 -0
- package/dist/modules/staff/data/enrichers.js.map +7 -0
- package/dist/modules/staff/data/entities.js +226 -1
- package/dist/modules/staff/data/entities.js.map +2 -2
- package/dist/modules/staff/data/validators.js +113 -1
- package/dist/modules/staff/data/validators.js.map +2 -2
- package/dist/modules/staff/events.js +13 -1
- package/dist/modules/staff/events.js.map +2 -2
- package/dist/modules/staff/lib/crud.js +7 -1
- package/dist/modules/staff/lib/crud.js.map +2 -2
- package/dist/modules/staff/lib/staffMemberResolver.js +15 -0
- package/dist/modules/staff/lib/staffMemberResolver.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectHoursTrend.js +60 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectHoursTrend.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectsKpis.js +260 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectsKpis.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/dateBuckets.js +41 -0
- package/dist/modules/staff/lib/timesheets-projects/dateBuckets.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/initials.js +10 -0
- package/dist/modules/staff/lib/timesheets-projects/initials.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/kpiMath.js +12 -0
- package/dist/modules/staff/lib/timesheets-projects/kpiMath.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/listProjectMembersPreview.js +55 -0
- package/dist/modules/staff/lib/timesheets-projects/listProjectMembersPreview.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/HoursSparkline.js +66 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/HoursSparkline.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js +81 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectMembersAvatarStack.js +58 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectMembersAvatarStack.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsKpiStrip.js +152 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsKpiStrip.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/SavedViewTabs.js +37 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/SavedViewTabs.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ViewModeToggle.js +57 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ViewModeToggle.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/useProjectsViewMode.js +50 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/useProjectsViewMode.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/AddRowDropdown.js +163 -0
- package/dist/modules/staff/lib/timesheets-ui/AddRowDropdown.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CalendarPicker.js +209 -0
- package/dist/modules/staff/lib/timesheets-ui/CalendarPicker.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/ColorPicker.js +52 -0
- package/dist/modules/staff/lib/timesheets-ui/ColorPicker.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js +77 -0
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/ListView.js +173 -0
- package/dist/modules/staff/lib/timesheets-ui/ListView.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/ProjectColorDot.js +32 -0
- package/dist/modules/staff/lib/timesheets-ui/ProjectColorDot.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js +270 -0
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/ViewSwitcher.js +57 -0
- package/dist/modules/staff/lib/timesheets-ui/ViewSwitcher.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/colors.js +43 -0
- package/dist/modules/staff/lib/timesheets-ui/colors.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260326135612.js +24 -0
- package/dist/modules/staff/migrations/Migration20260326135612.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260413102715.js +23 -0
- package/dist/modules/staff/migrations/Migration20260413102715.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260413111602.js +13 -0
- package/dist/modules/staff/migrations/Migration20260413111602.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260511112759.js +19 -0
- package/dist/modules/staff/migrations/Migration20260511112759.js.map +7 -0
- package/dist/modules/staff/search.js +35 -0
- package/dist/modules/staff/search.js.map +2 -2
- package/dist/modules/staff/setup.js +15 -1
- package/dist/modules/staff/setup.js.map +2 -2
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/config.js +16 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/config.js.map +7 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.js +126 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.js.map +7 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.js +26 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.js.map +7 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/config.js +15 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/config.js.map +7 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.js +238 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.js.map +7 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.js +26 -0
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.js.map +7 -0
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js +145 -0
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js.map +7 -0
- package/dist/modules/staff/widgets/injection-table.js +12 -0
- package/dist/modules/staff/widgets/injection-table.js.map +7 -0
- package/dist/modules/sync_excel/api/import/route.js +19 -17
- package/dist/modules/sync_excel/api/import/route.js.map +2 -2
- package/dist/modules/translations/commands/translations.js +22 -19
- package/dist/modules/translations/commands/translations.js.map +2 -2
- package/generated/entities/staff_time_entry/index.ts +17 -0
- package/generated/entities/staff_time_entry_segment/index.ts +10 -0
- package/generated/entities/staff_time_project/index.ts +16 -0
- package/generated/entities/staff_time_project_member/index.ts +13 -0
- package/generated/entities.ids.generated.ts +5 -1
- package/generated/entity-fields-registry.ts +64 -0
- package/package.json +7 -7
- package/src/helpers/integration/timesheetFixtures.ts +61 -0
- package/src/modules/attachments/api/library/[id]/route.ts +24 -17
- package/src/modules/attachments/api/route.ts +20 -14
- package/src/modules/auth/api/roles/acl/route.ts +11 -5
- package/src/modules/auth/api/sidebar/preferences/route.ts +33 -24
- package/src/modules/auth/api/users/acl/route.ts +17 -12
- package/src/modules/auth/commands/users.ts +96 -80
- package/src/modules/auth/services/sidebarPreferencesService.ts +40 -32
- package/src/modules/catalog/commands/categories.ts +61 -12
- package/src/modules/catalog/commands/products.ts +93 -60
- package/src/modules/catalog/commands/variants.ts +29 -16
- package/src/modules/currencies/commands/currencies.ts +27 -14
- package/src/modules/customer_accounts/api/admin/users.ts +31 -26
- package/src/modules/customer_accounts/api/password/reset-confirm.ts +5 -6
- package/src/modules/customer_accounts/api/portal/users/[id]/roles.ts +14 -13
- package/src/modules/customers/commands/addresses.ts +35 -23
- package/src/modules/customers/commands/companies.ts +166 -165
- package/src/modules/customers/commands/deals.ts +2 -4
- package/src/modules/customers/commands/interactions.ts +20 -26
- package/src/modules/customers/commands/people.ts +18 -15
- package/src/modules/customers/commands/personCompanyLinks.ts +109 -100
- package/src/modules/customers/commands/pipeline-stages.ts +31 -27
- package/src/modules/customers/commands/pipelines.ts +29 -23
- package/src/modules/customers/commands/tags.ts +13 -5
- package/src/modules/dashboards/api/users/widgets/route.ts +0 -1
- package/src/modules/dashboards/api/widgets/data/route.ts +36 -1
- package/src/modules/data_sync/lib/sync-engine.ts +4 -5
- package/src/modules/data_sync/lib/sync-run-service.ts +57 -28
- package/src/modules/directory/commands/organizations.ts +203 -166
- package/src/modules/inbox_ops/api/emails/[id]/reprocess/route.ts +26 -18
- package/src/modules/messages/commands/messages.ts +82 -80
- package/src/modules/messages/commands/shared.ts +138 -133
- package/src/modules/perspectives/api/[tableId]/route.ts +38 -27
- package/src/modules/resources/commands/resources.ts +127 -117
- package/src/modules/resources/commands/tags.ts +7 -3
- package/src/modules/sales/api/quotes/send/route.ts +17 -12
- package/src/modules/sales/commands/documents.ts +673 -481
- package/src/modules/sales/commands/payments.ts +158 -152
- package/src/modules/sales/commands/returns.ts +74 -63
- package/src/modules/staff/acl.ts +11 -0
- package/src/modules/staff/analytics.ts +30 -0
- package/src/modules/staff/api/guards.ts +59 -0
- package/src/modules/staff/api/interceptors.ts +122 -0
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +191 -0
- package/src/modules/staff/api/timesheets/my-projects/route.ts +115 -0
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +159 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.ts +187 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +191 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +168 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +191 -0
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +292 -0
- package/src/modules/staff/api/timesheets/time-entries/route.ts +193 -0
- package/src/modules/staff/api/timesheets/time-projects/[id]/employees/route.ts +167 -0
- package/src/modules/staff/api/timesheets/time-projects/route.ts +244 -0
- package/src/modules/staff/backend/staff/timesheets/page.meta.ts +20 -0
- package/src/modules/staff/backend/staff/timesheets/page.tsx +899 -0
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.tsx +141 -0
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.tsx +579 -0
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.tsx +90 -0
- package/src/modules/staff/backend/staff/timesheets/projects/page.meta.ts +23 -0
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +765 -0
- package/src/modules/staff/backend/staff/timesheets/projects/projectFormConfig.ts +138 -0
- package/src/modules/staff/cli.ts +40 -1
- package/src/modules/staff/commands/index.ts +2 -0
- package/src/modules/staff/commands/leave-requests.ts +37 -29
- package/src/modules/staff/commands/team-members.ts +25 -20
- package/src/modules/staff/commands/timesheets-entries.ts +504 -0
- package/src/modules/staff/commands/timesheets-projects.ts +699 -0
- package/src/modules/staff/data/enrichers.ts +134 -0
- package/src/modules/staff/data/entities.ts +198 -0
- package/src/modules/staff/data/validators.ts +129 -0
- package/src/modules/staff/events.ts +13 -0
- package/src/modules/staff/i18n/de.json +209 -1
- package/src/modules/staff/i18n/en.json +209 -1
- package/src/modules/staff/i18n/es.json +209 -1
- package/src/modules/staff/i18n/pl.json +209 -1
- package/src/modules/staff/lib/crud.ts +8 -0
- package/src/modules/staff/lib/staffMemberResolver.ts +22 -0
- package/src/modules/staff/lib/timesheets-projects/computeProjectHoursTrend.ts +89 -0
- package/src/modules/staff/lib/timesheets-projects/computeProjectsKpis.ts +311 -0
- package/src/modules/staff/lib/timesheets-projects/dateBuckets.ts +37 -0
- package/src/modules/staff/lib/timesheets-projects/initials.ts +6 -0
- package/src/modules/staff/lib/timesheets-projects/kpiMath.ts +8 -0
- package/src/modules/staff/lib/timesheets-projects/listProjectMembersPreview.ts +83 -0
- package/src/modules/staff/lib/timesheets-projects-ui/HoursSparkline.tsx +75 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectCard.tsx +110 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectMembersAvatarStack.tsx +73 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectsKpiStrip.tsx +185 -0
- package/src/modules/staff/lib/timesheets-projects-ui/SavedViewTabs.tsx +53 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ViewModeToggle.tsx +63 -0
- package/src/modules/staff/lib/timesheets-projects-ui/useProjectsViewMode.ts +63 -0
- package/src/modules/staff/lib/timesheets-ui/AddRowDropdown.tsx +188 -0
- package/src/modules/staff/lib/timesheets-ui/CalendarPicker.tsx +229 -0
- package/src/modules/staff/lib/timesheets-ui/ColorPicker.tsx +65 -0
- package/src/modules/staff/lib/timesheets-ui/CreateProjectDialog.tsx +99 -0
- package/src/modules/staff/lib/timesheets-ui/ListView.tsx +230 -0
- package/src/modules/staff/lib/timesheets-ui/ProjectColorDot.tsx +40 -0
- package/src/modules/staff/lib/timesheets-ui/TimerBar.tsx +327 -0
- package/src/modules/staff/lib/timesheets-ui/ViewSwitcher.tsx +60 -0
- package/src/modules/staff/lib/timesheets-ui/colors.ts +58 -0
- package/src/modules/staff/migrations/.snapshot-open-mercato.json +1148 -0
- package/src/modules/staff/migrations/Migration20260326135612.ts +26 -0
- package/src/modules/staff/migrations/Migration20260413102715.ts +25 -0
- package/src/modules/staff/migrations/Migration20260413111602.ts +13 -0
- package/src/modules/staff/migrations/Migration20260511112759.ts +21 -0
- package/src/modules/staff/search.ts +35 -0
- package/src/modules/staff/setup.ts +15 -0
- package/src/modules/staff/widgets/dashboard/timesheets-hours-by-project/config.ts +17 -0
- package/src/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.tsx +158 -0
- package/src/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.ts +25 -0
- package/src/modules/staff/widgets/dashboard/timesheets-time-reporting/config.ts +15 -0
- package/src/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.tsx +297 -0
- package/src/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.ts +25 -0
- package/src/modules/staff/widgets/injection/timer-sidebar-indicator/widget.tsx +161 -0
- package/src/modules/staff/widgets/injection-table.ts +10 -0
- package/src/modules/sync_excel/api/import/route.ts +23 -18
- package/src/modules/translations/commands/translations.ts +49 -41
|
@@ -4,6 +4,7 @@ import type { EntityManager } from '@mikro-orm/postgresql'
|
|
|
4
4
|
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
5
5
|
import { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'
|
|
6
6
|
import { buildChanges, emitCrudSideEffects, emitCrudUndoSideEffects, parseWithCustomFields, setCustomFieldsIfAny } from '@open-mercato/shared/lib/commands/helpers'
|
|
7
|
+
import { withAtomicFlush } from '@open-mercato/shared/lib/commands/flush'
|
|
7
8
|
import { buildCustomFieldResetMap, diffCustomFieldChanges, loadCustomFieldSnapshot, type CustomFieldSnapshot } from '@open-mercato/shared/lib/commands/customFieldSnapshots'
|
|
8
9
|
import type { DataEngine } from '@open-mercato/shared/lib/data/engine'
|
|
9
10
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
@@ -236,8 +237,18 @@ const createResourceCommand: CommandHandler<ResourcesResourceCreateInput, { reso
|
|
|
236
237
|
createdAt: now,
|
|
237
238
|
updatedAt: now,
|
|
238
239
|
})
|
|
239
|
-
em
|
|
240
|
-
|
|
240
|
+
await withAtomicFlush(em, [
|
|
241
|
+
async () => {
|
|
242
|
+
em.persist(record)
|
|
243
|
+
await em.flush()
|
|
244
|
+
},
|
|
245
|
+
() => syncResourcesResourceTags(em, {
|
|
246
|
+
resourceId: record.id,
|
|
247
|
+
organizationId: record.organizationId,
|
|
248
|
+
tenantId: record.tenantId,
|
|
249
|
+
tagIds: parsed.tags,
|
|
250
|
+
}),
|
|
251
|
+
], { transaction: true })
|
|
241
252
|
const dataEngine = (ctx.container.resolve('dataEngine') as DataEngine)
|
|
242
253
|
await setCustomFieldsIfAny({
|
|
243
254
|
dataEngine,
|
|
@@ -247,13 +258,6 @@ const createResourceCommand: CommandHandler<ResourcesResourceCreateInput, { reso
|
|
|
247
258
|
organizationId: record.organizationId,
|
|
248
259
|
values: custom,
|
|
249
260
|
})
|
|
250
|
-
await syncResourcesResourceTags(em, {
|
|
251
|
-
resourceId: record.id,
|
|
252
|
-
organizationId: record.organizationId,
|
|
253
|
-
tenantId: record.tenantId,
|
|
254
|
-
tagIds: parsed.tags,
|
|
255
|
-
})
|
|
256
|
-
await em.flush()
|
|
257
261
|
await emitCrudSideEffects({
|
|
258
262
|
dataEngine,
|
|
259
263
|
action: 'created',
|
|
@@ -351,43 +355,43 @@ const updateResourceCommand: CommandHandler<ResourcesResourceUpdateInput, { reso
|
|
|
351
355
|
ensureTenantScope(ctx, record.tenantId)
|
|
352
356
|
ensureOrganizationScope(ctx, record.organizationId)
|
|
353
357
|
|
|
358
|
+
let capacityUnit: CapacityUnitSnapshot | null | undefined
|
|
354
359
|
if (parsed.capacityUnitValue !== undefined) {
|
|
355
360
|
const unitValue =
|
|
356
361
|
typeof parsed.capacityUnitValue === 'string' ? parsed.capacityUnitValue.trim() : ''
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
em,
|
|
365
|
-
{ tenantId: record.tenantId, organizationId: record.organizationId },
|
|
366
|
-
unitValue,
|
|
367
|
-
)
|
|
368
|
-
record.capacityUnitValue = unitSnapshot.value
|
|
369
|
-
record.capacityUnitName = unitSnapshot.name
|
|
370
|
-
record.capacityUnitColor = unitSnapshot.color
|
|
371
|
-
record.capacityUnitIcon = unitSnapshot.icon
|
|
372
|
-
}
|
|
362
|
+
capacityUnit = unitValue
|
|
363
|
+
? await resolveCapacityUnit(
|
|
364
|
+
em,
|
|
365
|
+
{ tenantId: record.tenantId, organizationId: record.organizationId },
|
|
366
|
+
unitValue,
|
|
367
|
+
)
|
|
368
|
+
: null
|
|
373
369
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
370
|
+
await withAtomicFlush(em, [
|
|
371
|
+
() => {
|
|
372
|
+
if (parsed.capacityUnitValue !== undefined) {
|
|
373
|
+
record.capacityUnitValue = capacityUnit?.value ?? null
|
|
374
|
+
record.capacityUnitName = capacityUnit?.name ?? null
|
|
375
|
+
record.capacityUnitColor = capacityUnit?.color ?? null
|
|
376
|
+
record.capacityUnitIcon = capacityUnit?.icon ?? null
|
|
377
|
+
}
|
|
378
|
+
if (parsed.name !== undefined) record.name = parsed.name
|
|
379
|
+
if (parsed.description !== undefined) record.description = parsed.description ?? null
|
|
380
|
+
if (parsed.resourceTypeId !== undefined) record.resourceTypeId = parsed.resourceTypeId ?? null
|
|
381
|
+
if (parsed.capacity !== undefined) record.capacity = parsed.capacity ?? null
|
|
382
|
+
if (parsed.appearanceIcon !== undefined) record.appearanceIcon = parsed.appearanceIcon ?? null
|
|
383
|
+
if (parsed.appearanceColor !== undefined) record.appearanceColor = parsed.appearanceColor ?? null
|
|
384
|
+
if (parsed.availabilityRuleSetId !== undefined) record.availabilityRuleSetId = parsed.availabilityRuleSetId ?? null
|
|
385
|
+
record.updatedAt = new Date()
|
|
386
|
+
if (parsed.isActive !== undefined) record.isActive = parsed.isActive
|
|
387
|
+
},
|
|
388
|
+
() => syncResourcesResourceTags(em, {
|
|
389
|
+
resourceId: record.id,
|
|
390
|
+
organizationId: record.organizationId,
|
|
391
|
+
tenantId: record.tenantId,
|
|
392
|
+
tagIds: parsed.tags,
|
|
393
|
+
}),
|
|
394
|
+
], { transaction: true })
|
|
391
395
|
const dataEngine = (ctx.container.resolve('dataEngine') as DataEngine)
|
|
392
396
|
await setCustomFieldsIfAny({
|
|
393
397
|
dataEngine,
|
|
@@ -476,28 +480,30 @@ const updateResourceCommand: CommandHandler<ResourcesResourceUpdateInput, { reso
|
|
|
476
480
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
477
481
|
const record = await em.findOne(ResourcesResource, { id: before.id })
|
|
478
482
|
if (!record) return
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
483
|
+
await withAtomicFlush(em, [
|
|
484
|
+
() => {
|
|
485
|
+
record.name = before.name
|
|
486
|
+
record.description = before.description ?? null
|
|
487
|
+
record.resourceTypeId = before.resourceTypeId ?? null
|
|
488
|
+
record.capacity = before.capacity ?? null
|
|
489
|
+
record.capacityUnitValue = before.capacityUnitValue ?? null
|
|
490
|
+
record.capacityUnitName = before.capacityUnitName ?? null
|
|
491
|
+
record.capacityUnitColor = before.capacityUnitColor ?? null
|
|
492
|
+
record.capacityUnitIcon = before.capacityUnitIcon ?? null
|
|
493
|
+
record.appearanceIcon = before.appearanceIcon ?? null
|
|
494
|
+
record.appearanceColor = before.appearanceColor ?? null
|
|
495
|
+
record.isActive = before.isActive
|
|
496
|
+
record.availabilityRuleSetId = before.availabilityRuleSetId ?? null
|
|
497
|
+
record.deletedAt = before.deletedAt ? new Date(before.deletedAt) : null
|
|
498
|
+
record.updatedAt = new Date()
|
|
499
|
+
},
|
|
500
|
+
() => syncResourcesResourceTags(em, {
|
|
501
|
+
resourceId: record.id,
|
|
502
|
+
organizationId: record.organizationId,
|
|
503
|
+
tenantId: record.tenantId,
|
|
504
|
+
tagIds: before.tags,
|
|
505
|
+
}),
|
|
506
|
+
], { transaction: true })
|
|
501
507
|
|
|
502
508
|
const dataEngine = (ctx.container.resolve('dataEngine') as DataEngine)
|
|
503
509
|
const customBefore = payload.customBefore ?? fallbackCustomBefore ?? undefined
|
|
@@ -602,52 +608,56 @@ const deleteResourceCommand: CommandHandler<{ id?: string }, { resourceId: strin
|
|
|
602
608
|
const fallbackCustomBefore = (before as ResourceSnapshot).customFields ?? null
|
|
603
609
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
604
610
|
let record = await em.findOne(ResourcesResource, { id: before.id })
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
611
|
+
await withAtomicFlush(em, [
|
|
612
|
+
async () => {
|
|
613
|
+
if (!record) {
|
|
614
|
+
record = em.create(ResourcesResource, {
|
|
615
|
+
id: before.id,
|
|
616
|
+
tenantId: before.tenantId,
|
|
617
|
+
organizationId: before.organizationId,
|
|
618
|
+
name: before.name,
|
|
619
|
+
description: before.description ?? null,
|
|
620
|
+
resourceTypeId: before.resourceTypeId ?? null,
|
|
621
|
+
capacity: before.capacity ?? null,
|
|
622
|
+
capacityUnitValue: before.capacityUnitValue ?? null,
|
|
623
|
+
capacityUnitName: before.capacityUnitName ?? null,
|
|
624
|
+
capacityUnitColor: before.capacityUnitColor ?? null,
|
|
625
|
+
capacityUnitIcon: before.capacityUnitIcon ?? null,
|
|
626
|
+
appearanceIcon: before.appearanceIcon ?? null,
|
|
627
|
+
appearanceColor: before.appearanceColor ?? null,
|
|
628
|
+
isActive: before.isActive,
|
|
629
|
+
availabilityRuleSetId: before.availabilityRuleSetId ?? null,
|
|
630
|
+
deletedAt: null,
|
|
631
|
+
createdAt: new Date(),
|
|
632
|
+
updatedAt: new Date(),
|
|
633
|
+
})
|
|
634
|
+
em.persist(record)
|
|
635
|
+
} else {
|
|
636
|
+
record.name = before.name
|
|
637
|
+
record.description = before.description ?? null
|
|
638
|
+
record.resourceTypeId = before.resourceTypeId ?? null
|
|
639
|
+
record.capacity = before.capacity ?? null
|
|
640
|
+
record.capacityUnitValue = before.capacityUnitValue ?? null
|
|
641
|
+
record.capacityUnitName = before.capacityUnitName ?? null
|
|
642
|
+
record.capacityUnitColor = before.capacityUnitColor ?? null
|
|
643
|
+
record.capacityUnitIcon = before.capacityUnitIcon ?? null
|
|
644
|
+
record.appearanceIcon = before.appearanceIcon ?? null
|
|
645
|
+
record.appearanceColor = before.appearanceColor ?? null
|
|
646
|
+
record.isActive = before.isActive
|
|
647
|
+
record.availabilityRuleSetId = before.availabilityRuleSetId ?? null
|
|
648
|
+
record.deletedAt = null
|
|
649
|
+
record.updatedAt = new Date()
|
|
650
|
+
}
|
|
651
|
+
await em.flush()
|
|
652
|
+
},
|
|
653
|
+
() => syncResourcesResourceTags(em, {
|
|
654
|
+
resourceId: (record as ResourcesResource).id,
|
|
655
|
+
organizationId: (record as ResourcesResource).organizationId,
|
|
656
|
+
tenantId: (record as ResourcesResource).tenantId,
|
|
657
|
+
tagIds: before.tags,
|
|
658
|
+
}),
|
|
659
|
+
], { transaction: true })
|
|
660
|
+
const resolvedRecord = record as ResourcesResource
|
|
651
661
|
|
|
652
662
|
const dataEngine = (ctx.container.resolve('dataEngine') as DataEngine)
|
|
653
663
|
const customBefore = payload.customBefore ?? fallbackCustomBefore ?? undefined
|
|
@@ -656,9 +666,9 @@ const deleteResourceCommand: CommandHandler<{ id?: string }, { resourceId: strin
|
|
|
656
666
|
await setCustomFieldsIfAny({
|
|
657
667
|
dataEngine,
|
|
658
668
|
entityId: E.resources.resources_resource,
|
|
659
|
-
recordId:
|
|
660
|
-
tenantId:
|
|
661
|
-
organizationId:
|
|
669
|
+
recordId: resolvedRecord.id,
|
|
670
|
+
tenantId: resolvedRecord.tenantId,
|
|
671
|
+
organizationId: resolvedRecord.organizationId,
|
|
662
672
|
values: reset,
|
|
663
673
|
})
|
|
664
674
|
}
|
|
@@ -666,11 +676,11 @@ const deleteResourceCommand: CommandHandler<{ id?: string }, { resourceId: strin
|
|
|
666
676
|
await emitCrudUndoSideEffects({
|
|
667
677
|
dataEngine,
|
|
668
678
|
action: 'created',
|
|
669
|
-
entity:
|
|
679
|
+
entity: resolvedRecord,
|
|
670
680
|
identifiers: {
|
|
671
|
-
id:
|
|
672
|
-
organizationId:
|
|
673
|
-
tenantId:
|
|
681
|
+
id: resolvedRecord.id,
|
|
682
|
+
organizationId: resolvedRecord.organizationId,
|
|
683
|
+
tenantId: resolvedRecord.tenantId,
|
|
674
684
|
},
|
|
675
685
|
events: resourcesResourceCrudEvents,
|
|
676
686
|
indexer: resourceCrudIndexer,
|
|
@@ -2,6 +2,7 @@ import type { CommandHandler } from '@open-mercato/shared/lib/commands'
|
|
|
2
2
|
import { registerCommand } from '@open-mercato/shared/lib/commands'
|
|
3
3
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
4
4
|
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
5
|
+
import { withAtomicFlush } from '@open-mercato/shared/lib/commands/flush'
|
|
5
6
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
6
7
|
import { slugifyTagLabel } from '@open-mercato/shared/lib/utils'
|
|
7
8
|
import { ResourcesResourceTag, ResourcesResourceTagAssignment } from '../data/entities'
|
|
@@ -105,9 +106,12 @@ const deleteTagCommand: CommandHandler<{ id?: string }, { tagId: string }> = {
|
|
|
105
106
|
if (!tag) throw new CrudHttpError(404, { error: 'Tag not found' })
|
|
106
107
|
ensureTenantScope(ctx, tag.tenantId)
|
|
107
108
|
ensureOrganizationScope(ctx, tag.organizationId)
|
|
108
|
-
await em
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
await withAtomicFlush(em, [
|
|
110
|
+
async () => {
|
|
111
|
+
await em.nativeDelete(ResourcesResourceTagAssignment, { tag: tag.id })
|
|
112
|
+
em.remove(tag)
|
|
113
|
+
},
|
|
114
|
+
], { transaction: true })
|
|
111
115
|
return { tagId: id }
|
|
112
116
|
},
|
|
113
117
|
buildLog: async ({ input, result, ctx }) => {
|
|
@@ -168,17 +168,23 @@ export async function POST(req: Request) {
|
|
|
168
168
|
validUntil.setUTCDate(validUntil.getUTCDate() + input.validForDays)
|
|
169
169
|
|
|
170
170
|
const rawAcceptanceToken = crypto.randomUUID()
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
|
|
172
|
+
// Persist the send state (status/token/sentAt) atomically and commit it
|
|
173
|
+
// BEFORE the email goes out, so a customer never receives a link whose
|
|
174
|
+
// acceptance token was not durably stored.
|
|
175
|
+
await em.transactional(async (tx) => {
|
|
176
|
+
quote.validUntil = validUntil
|
|
177
|
+
quote.acceptanceToken = hashAuthToken(rawAcceptanceToken)
|
|
178
|
+
quote.sentAt = now
|
|
179
|
+
quote.status = 'sent'
|
|
180
|
+
quote.statusEntryId = await resolveStatusEntryIdByValue(tx, {
|
|
181
|
+
tenantId: quote.tenantId,
|
|
182
|
+
organizationId: quote.organizationId,
|
|
183
|
+
value: 'sent',
|
|
184
|
+
})
|
|
185
|
+
quote.updatedAt = now
|
|
186
|
+
tx.persist(quote)
|
|
179
187
|
})
|
|
180
|
-
quote.updatedAt = now
|
|
181
|
-
em.persist(quote)
|
|
182
188
|
|
|
183
189
|
const appUrl = process.env.APP_URL || ''
|
|
184
190
|
const url = appUrl ? `${appUrl.replace(/\/$/, '')}/quote/${rawAcceptanceToken}` : `/quote/${rawAcceptanceToken}`
|
|
@@ -202,14 +208,13 @@ export async function POST(req: Request) {
|
|
|
202
208
|
footer: translate('sales.quotes.email.footer', 'Open Mercato'),
|
|
203
209
|
}
|
|
204
210
|
|
|
211
|
+
// Side effect after commit: an email failure must not roll back the send state.
|
|
205
212
|
await sendEmail({
|
|
206
213
|
to: email,
|
|
207
214
|
subject: translate('sales.quotes.email.subject', 'Quote {quoteNumber}', { quoteNumber: quote.quoteNumber }),
|
|
208
215
|
react: QuoteSentEmail({ url, copy }),
|
|
209
216
|
})
|
|
210
217
|
|
|
211
|
-
await em.flush()
|
|
212
|
-
|
|
213
218
|
if (guardResult.afterSuccessCallbacks.length) {
|
|
214
219
|
await runGuardAfterSuccessCallbacks(guardResult.afterSuccessCallbacks, {
|
|
215
220
|
tenantId: ctx.auth?.tenantId ?? '',
|