@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
|
@@ -45,6 +45,7 @@ import { E } from "../../../generated/entities.ids.generated.js";
|
|
|
45
45
|
import { findOneWithDecryption, findWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
46
46
|
import { CUSTOMER_ENTITY_ID, resolveCompanyCustomFieldRouting } from "../lib/customFieldRouting.js";
|
|
47
47
|
import { CustomFieldValue } from "@open-mercato/core/modules/entities/data/entities";
|
|
48
|
+
import { withAtomicFlush } from "@open-mercato/shared/lib/commands/flush";
|
|
48
49
|
const COMPANY_ENTITY_ID = "customers:customer_company_profile";
|
|
49
50
|
const INTERACTION_ENTITY_ID = "customers:customer_interaction";
|
|
50
51
|
const companyCrudIndexer = {
|
|
@@ -340,11 +341,13 @@ const createCompanyCommand = {
|
|
|
340
341
|
sizeBucket: parsed.sizeBucket ?? null,
|
|
341
342
|
annualRevenue: parsed.annualRevenue !== void 0 ? String(parsed.annualRevenue) : null
|
|
342
343
|
});
|
|
343
|
-
em
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
344
|
+
await withAtomicFlush(em, [
|
|
345
|
+
() => {
|
|
346
|
+
em.persist(entity);
|
|
347
|
+
em.persist(profile);
|
|
348
|
+
},
|
|
349
|
+
() => syncEntityTags(em, entity, parsed.tags)
|
|
350
|
+
], { transaction: true });
|
|
348
351
|
await setCompanyCustomFields(ctx, entity.id, profile.id, entity.organizationId, entity.tenantId, custom);
|
|
349
352
|
const de = ctx.container.resolve("dataEngine");
|
|
350
353
|
await emitCrudSideEffects({
|
|
@@ -396,10 +399,13 @@ const createCompanyCommand = {
|
|
|
396
399
|
organizationId: entity.organizationId,
|
|
397
400
|
tenantId: entity.tenantId
|
|
398
401
|
};
|
|
399
|
-
await em
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
402
|
+
await withAtomicFlush(em, [
|
|
403
|
+
async () => {
|
|
404
|
+
await em.nativeDelete(CustomerCompanyProfile, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
405
|
+
await em.nativeDelete(CustomerTagAssignment, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
406
|
+
em.remove(entity);
|
|
407
|
+
}
|
|
408
|
+
], { transaction: true });
|
|
403
409
|
const de = ctx.container.resolve("dataEngine");
|
|
404
410
|
await emitCrudUndoSideEffects({
|
|
405
411
|
dataEngine: de,
|
|
@@ -460,9 +466,9 @@ const updateCompanyCommand = {
|
|
|
460
466
|
if (parsed.annualRevenue !== void 0) {
|
|
461
467
|
profile.annualRevenue = parsed.annualRevenue !== null && parsed.annualRevenue !== void 0 ? String(parsed.annualRevenue) : null;
|
|
462
468
|
}
|
|
463
|
-
await em
|
|
464
|
-
|
|
465
|
-
|
|
469
|
+
await withAtomicFlush(em, [
|
|
470
|
+
() => syncEntityTags(em, record, parsed.tags)
|
|
471
|
+
], { transaction: true });
|
|
466
472
|
await setCompanyCustomFields(ctx, record.id, profile.id, record.organizationId, record.tenantId, custom);
|
|
467
473
|
const de = ctx.container.resolve("dataEngine");
|
|
468
474
|
await emitCrudSideEffects({
|
|
@@ -889,9 +895,6 @@ const deleteCompanyCommand = {
|
|
|
889
895
|
profile.sizeBucket = before.profile.sizeBucket;
|
|
890
896
|
profile.annualRevenue = before.profile.annualRevenue;
|
|
891
897
|
}
|
|
892
|
-
await em.flush();
|
|
893
|
-
await syncEntityTags(em, entity, before.tagIds);
|
|
894
|
-
await em.flush();
|
|
895
898
|
const beforeDeals = before.deals ?? [];
|
|
896
899
|
const beforeMembers = before.members ?? [];
|
|
897
900
|
const beforeActivities = before.activities ?? [];
|
|
@@ -899,156 +902,154 @@ const deleteCompanyCommand = {
|
|
|
899
902
|
const beforeAddresses = before.addresses ?? [];
|
|
900
903
|
const beforeTodos = before.todos ?? [];
|
|
901
904
|
const beforeInteractions = before.interactions ?? [];
|
|
902
|
-
const relatedDealIds = /* @__PURE__ */ new Set();
|
|
903
|
-
for (const link of beforeDeals) relatedDealIds.add(link.dealId);
|
|
904
|
-
for (const activity of beforeActivities) {
|
|
905
|
-
if (activity.dealId) relatedDealIds.add(activity.dealId);
|
|
906
|
-
}
|
|
907
|
-
for (const comment of beforeComments) {
|
|
908
|
-
if (comment.dealId) relatedDealIds.add(comment.dealId);
|
|
909
|
-
}
|
|
910
905
|
let dealMap = /* @__PURE__ */ new Map();
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
if (
|
|
943
|
-
|
|
906
|
+
await withAtomicFlush(em, [
|
|
907
|
+
() => syncEntityTags(em, entity, before.tagIds),
|
|
908
|
+
async () => {
|
|
909
|
+
const relatedDealIds = /* @__PURE__ */ new Set();
|
|
910
|
+
for (const link of beforeDeals) relatedDealIds.add(link.dealId);
|
|
911
|
+
for (const activity of beforeActivities) {
|
|
912
|
+
if (activity.dealId) relatedDealIds.add(activity.dealId);
|
|
913
|
+
}
|
|
914
|
+
for (const comment of beforeComments) {
|
|
915
|
+
if (comment.dealId) relatedDealIds.add(comment.dealId);
|
|
916
|
+
}
|
|
917
|
+
if (relatedDealIds.size) {
|
|
918
|
+
const deals = await em.find(CustomerDeal, {
|
|
919
|
+
id: { $in: Array.from(relatedDealIds) },
|
|
920
|
+
organizationId: entity.organizationId,
|
|
921
|
+
tenantId: entity.tenantId
|
|
922
|
+
});
|
|
923
|
+
dealMap = new Map(deals.map((deal) => [deal.id, deal]));
|
|
924
|
+
}
|
|
925
|
+
await em.nativeDelete(CustomerDealCompanyLink, { company: entity });
|
|
926
|
+
for (const link of beforeDeals) {
|
|
927
|
+
const deal = dealMap.get(link.dealId);
|
|
928
|
+
if (!deal) continue;
|
|
929
|
+
const restoredLink = em.create(CustomerDealCompanyLink, {
|
|
930
|
+
id: link.id,
|
|
931
|
+
deal,
|
|
932
|
+
company: entity,
|
|
933
|
+
createdAt: link.createdAt
|
|
934
|
+
});
|
|
935
|
+
em.persist(restoredLink);
|
|
936
|
+
}
|
|
937
|
+
if (beforeMembers.length) {
|
|
938
|
+
const memberIds = beforeMembers.map((member) => member.profileId);
|
|
939
|
+
const profiles = await em.find(CustomerPersonProfile, {
|
|
940
|
+
id: { $in: memberIds },
|
|
941
|
+
organizationId: entity.organizationId,
|
|
942
|
+
tenantId: entity.tenantId
|
|
943
|
+
});
|
|
944
|
+
const profileMap = new Map(profiles.map((profile2) => [profile2.id, profile2]));
|
|
945
|
+
for (const member of beforeMembers) {
|
|
946
|
+
const memberProfile = profileMap.get(member.profileId);
|
|
947
|
+
if (!memberProfile) continue;
|
|
948
|
+
memberProfile.company = entity;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
await em.nativeDelete(CustomerActivity, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
952
|
+
for (const activity of beforeActivities) {
|
|
953
|
+
const restoredActivity = em.create(CustomerActivity, {
|
|
954
|
+
id: activity.id,
|
|
955
|
+
organizationId: entity.organizationId,
|
|
956
|
+
tenantId: entity.tenantId,
|
|
957
|
+
entity,
|
|
958
|
+
activityType: activity.activityType,
|
|
959
|
+
subject: activity.subject,
|
|
960
|
+
body: activity.body,
|
|
961
|
+
occurredAt: activity.occurredAt,
|
|
962
|
+
authorUserId: activity.authorUserId,
|
|
963
|
+
appearanceIcon: activity.appearanceIcon,
|
|
964
|
+
appearanceColor: activity.appearanceColor,
|
|
965
|
+
deal: activity.dealId ? dealMap.get(activity.dealId) ?? null : null,
|
|
966
|
+
createdAt: activity.createdAt,
|
|
967
|
+
updatedAt: activity.updatedAt
|
|
968
|
+
});
|
|
969
|
+
em.persist(restoredActivity);
|
|
970
|
+
}
|
|
971
|
+
await em.nativeDelete(CustomerComment, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
972
|
+
for (const comment of beforeComments) {
|
|
973
|
+
const restoredComment = em.create(CustomerComment, {
|
|
974
|
+
id: comment.id,
|
|
975
|
+
organizationId: entity.organizationId,
|
|
976
|
+
tenantId: entity.tenantId,
|
|
977
|
+
entity,
|
|
978
|
+
body: comment.body,
|
|
979
|
+
authorUserId: comment.authorUserId,
|
|
980
|
+
appearanceIcon: comment.appearanceIcon,
|
|
981
|
+
appearanceColor: comment.appearanceColor,
|
|
982
|
+
deal: comment.dealId ? dealMap.get(comment.dealId) ?? null : null,
|
|
983
|
+
createdAt: comment.createdAt,
|
|
984
|
+
updatedAt: comment.updatedAt,
|
|
985
|
+
deletedAt: comment.deletedAt
|
|
986
|
+
});
|
|
987
|
+
em.persist(restoredComment);
|
|
988
|
+
}
|
|
989
|
+
await em.nativeDelete(CustomerAddress, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
990
|
+
for (const address of beforeAddresses) {
|
|
991
|
+
const restoredAddress = em.create(CustomerAddress, {
|
|
992
|
+
id: address.id,
|
|
993
|
+
organizationId: entity.organizationId,
|
|
994
|
+
tenantId: entity.tenantId,
|
|
995
|
+
entity,
|
|
996
|
+
name: address.name,
|
|
997
|
+
purpose: address.purpose,
|
|
998
|
+
addressLine1: address.addressLine1,
|
|
999
|
+
addressLine2: address.addressLine2,
|
|
1000
|
+
city: address.city,
|
|
1001
|
+
region: address.region,
|
|
1002
|
+
postalCode: address.postalCode,
|
|
1003
|
+
country: address.country,
|
|
1004
|
+
latitude: address.latitude,
|
|
1005
|
+
longitude: address.longitude,
|
|
1006
|
+
isPrimary: address.isPrimary
|
|
1007
|
+
});
|
|
1008
|
+
em.persist(restoredAddress);
|
|
1009
|
+
}
|
|
1010
|
+
await em.nativeDelete(CustomerTodoLink, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
1011
|
+
for (const todo of beforeTodos) {
|
|
1012
|
+
const restoredTodo = em.create(CustomerTodoLink, {
|
|
1013
|
+
id: todo.id,
|
|
1014
|
+
organizationId: entity.organizationId,
|
|
1015
|
+
tenantId: entity.tenantId,
|
|
1016
|
+
entity,
|
|
1017
|
+
todoId: todo.todoId,
|
|
1018
|
+
todoSource: todo.todoSource,
|
|
1019
|
+
createdAt: todo.createdAt,
|
|
1020
|
+
createdByUserId: todo.createdByUserId
|
|
1021
|
+
});
|
|
1022
|
+
em.persist(restoredTodo);
|
|
1023
|
+
}
|
|
1024
|
+
await em.nativeDelete(CustomerInteraction, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
1025
|
+
for (const interaction of beforeInteractions) {
|
|
1026
|
+
const restoredInteraction = em.create(CustomerInteraction, {
|
|
1027
|
+
id: interaction.id,
|
|
1028
|
+
organizationId: entity.organizationId,
|
|
1029
|
+
tenantId: entity.tenantId,
|
|
1030
|
+
entity,
|
|
1031
|
+
interactionType: interaction.interactionType,
|
|
1032
|
+
title: interaction.title,
|
|
1033
|
+
body: interaction.body,
|
|
1034
|
+
status: interaction.status,
|
|
1035
|
+
scheduledAt: interaction.scheduledAt,
|
|
1036
|
+
occurredAt: interaction.occurredAt,
|
|
1037
|
+
priority: interaction.priority,
|
|
1038
|
+
authorUserId: interaction.authorUserId,
|
|
1039
|
+
ownerUserId: interaction.ownerUserId,
|
|
1040
|
+
dealId: interaction.dealId,
|
|
1041
|
+
source: interaction.source,
|
|
1042
|
+
appearanceIcon: interaction.appearanceIcon,
|
|
1043
|
+
appearanceColor: interaction.appearanceColor,
|
|
1044
|
+
createdAt: interaction.createdAt,
|
|
1045
|
+
updatedAt: interaction.updatedAt,
|
|
1046
|
+
deletedAt: interaction.deletedAt
|
|
1047
|
+
});
|
|
1048
|
+
em.persist(restoredInteraction);
|
|
1049
|
+
}
|
|
944
1050
|
}
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
await em.nativeDelete(CustomerActivity, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
948
|
-
for (const activity of beforeActivities) {
|
|
949
|
-
const restoredActivity = em.create(CustomerActivity, {
|
|
950
|
-
id: activity.id,
|
|
951
|
-
organizationId: entity.organizationId,
|
|
952
|
-
tenantId: entity.tenantId,
|
|
953
|
-
entity,
|
|
954
|
-
activityType: activity.activityType,
|
|
955
|
-
subject: activity.subject,
|
|
956
|
-
body: activity.body,
|
|
957
|
-
occurredAt: activity.occurredAt,
|
|
958
|
-
authorUserId: activity.authorUserId,
|
|
959
|
-
appearanceIcon: activity.appearanceIcon,
|
|
960
|
-
appearanceColor: activity.appearanceColor,
|
|
961
|
-
deal: activity.dealId ? dealMap.get(activity.dealId) ?? null : null,
|
|
962
|
-
createdAt: activity.createdAt,
|
|
963
|
-
updatedAt: activity.updatedAt
|
|
964
|
-
});
|
|
965
|
-
em.persist(restoredActivity);
|
|
966
|
-
}
|
|
967
|
-
await em.flush();
|
|
968
|
-
await em.nativeDelete(CustomerComment, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
969
|
-
for (const comment of beforeComments) {
|
|
970
|
-
const restoredComment = em.create(CustomerComment, {
|
|
971
|
-
id: comment.id,
|
|
972
|
-
organizationId: entity.organizationId,
|
|
973
|
-
tenantId: entity.tenantId,
|
|
974
|
-
entity,
|
|
975
|
-
body: comment.body,
|
|
976
|
-
authorUserId: comment.authorUserId,
|
|
977
|
-
appearanceIcon: comment.appearanceIcon,
|
|
978
|
-
appearanceColor: comment.appearanceColor,
|
|
979
|
-
deal: comment.dealId ? dealMap.get(comment.dealId) ?? null : null,
|
|
980
|
-
createdAt: comment.createdAt,
|
|
981
|
-
updatedAt: comment.updatedAt,
|
|
982
|
-
deletedAt: comment.deletedAt
|
|
983
|
-
});
|
|
984
|
-
em.persist(restoredComment);
|
|
985
|
-
}
|
|
986
|
-
await em.flush();
|
|
987
|
-
await em.nativeDelete(CustomerAddress, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
988
|
-
for (const address of beforeAddresses) {
|
|
989
|
-
const restoredAddress = em.create(CustomerAddress, {
|
|
990
|
-
id: address.id,
|
|
991
|
-
organizationId: entity.organizationId,
|
|
992
|
-
tenantId: entity.tenantId,
|
|
993
|
-
entity,
|
|
994
|
-
name: address.name,
|
|
995
|
-
purpose: address.purpose,
|
|
996
|
-
addressLine1: address.addressLine1,
|
|
997
|
-
addressLine2: address.addressLine2,
|
|
998
|
-
city: address.city,
|
|
999
|
-
region: address.region,
|
|
1000
|
-
postalCode: address.postalCode,
|
|
1001
|
-
country: address.country,
|
|
1002
|
-
latitude: address.latitude,
|
|
1003
|
-
longitude: address.longitude,
|
|
1004
|
-
isPrimary: address.isPrimary
|
|
1005
|
-
});
|
|
1006
|
-
em.persist(restoredAddress);
|
|
1007
|
-
}
|
|
1008
|
-
await em.flush();
|
|
1009
|
-
await em.nativeDelete(CustomerTodoLink, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
1010
|
-
for (const todo of beforeTodos) {
|
|
1011
|
-
const restoredTodo = em.create(CustomerTodoLink, {
|
|
1012
|
-
id: todo.id,
|
|
1013
|
-
organizationId: entity.organizationId,
|
|
1014
|
-
tenantId: entity.tenantId,
|
|
1015
|
-
entity,
|
|
1016
|
-
todoId: todo.todoId,
|
|
1017
|
-
todoSource: todo.todoSource,
|
|
1018
|
-
createdAt: todo.createdAt,
|
|
1019
|
-
createdByUserId: todo.createdByUserId
|
|
1020
|
-
});
|
|
1021
|
-
em.persist(restoredTodo);
|
|
1022
|
-
}
|
|
1023
|
-
await em.flush();
|
|
1051
|
+
], { transaction: true });
|
|
1024
1052
|
const de = ctx.container.resolve("dataEngine");
|
|
1025
|
-
await em.nativeDelete(CustomerInteraction, { entity, organizationId: entity.organizationId, tenantId: entity.tenantId });
|
|
1026
|
-
for (const interaction of beforeInteractions) {
|
|
1027
|
-
const restoredInteraction = em.create(CustomerInteraction, {
|
|
1028
|
-
id: interaction.id,
|
|
1029
|
-
organizationId: entity.organizationId,
|
|
1030
|
-
tenantId: entity.tenantId,
|
|
1031
|
-
entity,
|
|
1032
|
-
interactionType: interaction.interactionType,
|
|
1033
|
-
title: interaction.title,
|
|
1034
|
-
body: interaction.body,
|
|
1035
|
-
status: interaction.status,
|
|
1036
|
-
scheduledAt: interaction.scheduledAt,
|
|
1037
|
-
occurredAt: interaction.occurredAt,
|
|
1038
|
-
priority: interaction.priority,
|
|
1039
|
-
authorUserId: interaction.authorUserId,
|
|
1040
|
-
ownerUserId: interaction.ownerUserId,
|
|
1041
|
-
dealId: interaction.dealId,
|
|
1042
|
-
source: interaction.source,
|
|
1043
|
-
appearanceIcon: interaction.appearanceIcon,
|
|
1044
|
-
appearanceColor: interaction.appearanceColor,
|
|
1045
|
-
createdAt: interaction.createdAt,
|
|
1046
|
-
updatedAt: interaction.updatedAt,
|
|
1047
|
-
deletedAt: interaction.deletedAt
|
|
1048
|
-
});
|
|
1049
|
-
em.persist(restoredInteraction);
|
|
1050
|
-
}
|
|
1051
|
-
await em.flush();
|
|
1052
1053
|
for (const interaction of beforeInteractions) {
|
|
1053
1054
|
if (!interaction.custom || !Object.keys(interaction.custom).length) continue;
|
|
1054
1055
|
await setCustomFieldsIfAny({
|