@open-mercato/core 0.5.1-develop.2663.2c29774b5b → 0.5.1-develop.2681.c559bb2bc3
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 +1 -1
- package/dist/generated/entities/action_log/index.js +8 -0
- package/dist/generated/entities/action_log/index.js.map +2 -2
- package/dist/generated/entities/customer_company_billing/index.js +23 -0
- package/dist/generated/entities/customer_company_billing/index.js.map +7 -0
- package/dist/generated/entities/customer_deal/index.js +8 -0
- package/dist/generated/entities/customer_deal/index.js.map +2 -2
- package/dist/generated/entities/customer_deal_stage_transition/index.js +31 -0
- package/dist/generated/entities/customer_deal_stage_transition/index.js.map +7 -0
- package/dist/generated/entities/customer_dictionary_kind_setting/index.js +21 -0
- package/dist/generated/entities/customer_dictionary_kind_setting/index.js.map +7 -0
- package/dist/generated/entities/customer_entity/index.js +8 -0
- package/dist/generated/entities/customer_entity/index.js.map +2 -2
- package/dist/generated/entities/customer_entity_role/index.js +23 -0
- package/dist/generated/entities/customer_entity_role/index.js.map +7 -0
- package/dist/generated/entities/customer_interaction/index.js +23 -1
- package/dist/generated/entities/customer_interaction/index.js.map +2 -2
- package/dist/generated/entities/customer_label/index.js +19 -0
- package/dist/generated/entities/customer_label/index.js.map +7 -0
- package/dist/generated/entities/customer_label_assignment/index.js +17 -0
- package/dist/generated/entities/customer_label_assignment/index.js.map +7 -0
- package/dist/generated/entities/customer_person_company_link/index.js +21 -0
- package/dist/generated/entities/customer_person_company_link/index.js.map +7 -0
- package/dist/generated/entities/customer_person_company_role/index.js +17 -0
- package/dist/generated/entities/customer_person_company_role/index.js.map +7 -0
- package/dist/generated/entities/dictionary_entry/index.js +4 -0
- package/dist/generated/entities/dictionary_entry/index.js.map +2 -2
- package/dist/generated/entities.ids.generated.js +9 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +116 -1
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/attachments/api/route.js +46 -8
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js +208 -0
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js.map +7 -0
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js +52 -6
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js.map +2 -2
- package/dist/modules/audit_logs/cli.js +62 -0
- package/dist/modules/audit_logs/cli.js.map +7 -0
- package/dist/modules/audit_logs/data/entities.js +21 -1
- package/dist/modules/audit_logs/data/entities.js.map +2 -2
- package/dist/modules/audit_logs/data/validators.js +9 -1
- package/dist/modules/audit_logs/data/validators.js.map +2 -2
- package/dist/modules/audit_logs/lib/changeRows.js +34 -0
- package/dist/modules/audit_logs/lib/changeRows.js.map +7 -0
- package/dist/modules/audit_logs/lib/display-helpers.js +2 -20
- package/dist/modules/audit_logs/lib/display-helpers.js.map +3 -3
- package/dist/modules/audit_logs/lib/projections.js +58 -0
- package/dist/modules/audit_logs/lib/projections.js.map +7 -0
- package/dist/modules/audit_logs/migrations/Migration20260412160533.js +21 -0
- package/dist/modules/audit_logs/migrations/Migration20260412160533.js.map +7 -0
- package/dist/modules/audit_logs/services/actionLogService.js +313 -79
- package/dist/modules/audit_logs/services/actionLogService.js.map +2 -2
- package/dist/modules/customers/acl.js +3 -1
- package/dist/modules/customers/acl.js.map +2 -2
- package/dist/modules/customers/api/activities/route.js +4 -0
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/dist/modules/customers/api/assignable-staff/route.js +208 -0
- package/dist/modules/customers/api/assignable-staff/route.js.map +7 -0
- package/dist/modules/customers/api/companies/[id]/people/route.js +205 -0
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +7 -0
- package/dist/modules/customers/api/companies/[id]/roles/route.js +22 -0
- package/dist/modules/customers/api/companies/[id]/roles/route.js.map +7 -0
- package/dist/modules/customers/api/companies/[id]/route.js +374 -32
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/companies/route.js +82 -7
- package/dist/modules/customers/api/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +172 -0
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +7 -0
- package/dist/modules/customers/api/deals/[id]/people/route.js +156 -0
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +7 -0
- package/dist/modules/customers/api/deals/[id]/route.js +459 -53
- package/dist/modules/customers/api/deals/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/stats/route.js +195 -0
- package/dist/modules/customers/api/deals/[id]/stats/route.js.map +7 -0
- package/dist/modules/customers/api/deals/route.js +20 -10
- package/dist/modules/customers/api/deals/route.js.map +3 -3
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js +105 -4
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/[kind]/route.js +118 -42
- package/dist/modules/customers/api/dictionaries/[kind]/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/context.js +30 -6
- package/dist/modules/customers/api/dictionaries/context.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/kind-settings/route.js +207 -0
- package/dist/modules/customers/api/dictionaries/kind-settings/route.js.map +7 -0
- package/dist/modules/customers/api/entity-roles-factory.js +471 -0
- package/dist/modules/customers/api/entity-roles-factory.js.map +7 -0
- package/dist/modules/customers/api/interactions/conflicts/route.js +158 -0
- package/dist/modules/customers/api/interactions/conflicts/route.js.map +7 -0
- package/dist/modules/customers/api/interactions/counts/route.js +92 -0
- package/dist/modules/customers/api/interactions/counts/route.js.map +7 -0
- package/dist/modules/customers/api/interactions/route.js +83 -4
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/api/labels/assign/route.js +189 -0
- package/dist/modules/customers/api/labels/assign/route.js.map +7 -0
- package/dist/modules/customers/api/labels/auth.js +17 -0
- package/dist/modules/customers/api/labels/auth.js.map +7 -0
- package/dist/modules/customers/api/labels/route.js +281 -0
- package/dist/modules/customers/api/labels/route.js.map +7 -0
- package/dist/modules/customers/api/labels/table-errors.js +38 -0
- package/dist/modules/customers/api/labels/table-errors.js.map +7 -0
- package/dist/modules/customers/api/labels/unassign/route.js +184 -0
- package/dist/modules/customers/api/labels/unassign/route.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js +292 -0
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/companies/context.js +66 -0
- package/dist/modules/customers/api/people/[id]/companies/context.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +334 -0
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/companies/route.js +205 -0
- package/dist/modules/customers/api/people/[id]/companies/route.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/roles/route.js +22 -0
- package/dist/modules/customers/api/people/[id]/roles/route.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/route.js +134 -21
- package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/people/route.js +122 -23
- package/dist/modules/customers/api/people/route.js.map +2 -2
- package/dist/modules/customers/api/todos/route.js +4 -0
- package/dist/modules/customers/api/todos/route.js.map +2 -2
- package/dist/modules/customers/api/utils.js +22 -0
- package/dist/modules/customers/api/utils.js.map +2 -2
- package/dist/modules/customers/backend/config/customers/page.js +2 -6
- package/dist/modules/customers/backend/config/customers/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js +37 -26
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +265 -262
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +3 -3
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/formatters.js +23 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/formatters.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/types.js +1 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/types.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js +43 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js +264 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js +88 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealData.js +41 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealData.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealFormHandlers.js +66 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealFormHandlers.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealInjectedTabs.js +39 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealInjectedTabs.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealMutationContext.js +49 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealMutationContext.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealPipeline.js +43 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealPipeline.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useScheduleDialog.js +28 -0
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useScheduleDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/[id]/page.js +556 -503
- package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +3 -3
- package/dist/modules/customers/backend/customers/deals/page.js +66 -21
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +36 -28
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +318 -203
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +3 -3
- package/dist/modules/customers/cli.js +105 -13
- package/dist/modules/customers/cli.js.map +2 -2
- package/dist/modules/customers/commands/activities.js +6 -0
- package/dist/modules/customers/commands/activities.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +315 -107
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/dictionaries.js +166 -32
- package/dist/modules/customers/commands/dictionaries.js.map +2 -2
- package/dist/modules/customers/commands/dictionaryKindSettings.js +208 -0
- package/dist/modules/customers/commands/dictionaryKindSettings.js.map +7 -0
- package/dist/modules/customers/commands/entity-roles.js +415 -0
- package/dist/modules/customers/commands/entity-roles.js.map +7 -0
- package/dist/modules/customers/commands/index.js +4 -0
- package/dist/modules/customers/commands/index.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js +108 -21
- package/dist/modules/customers/commands/interactions.js.map +2 -2
- package/dist/modules/customers/commands/labels.js +539 -0
- package/dist/modules/customers/commands/labels.js.map +7 -0
- package/dist/modules/customers/commands/people.js +560 -463
- package/dist/modules/customers/commands/people.js.map +3 -3
- package/dist/modules/customers/commands/personCompanyLinks.js +568 -0
- package/dist/modules/customers/commands/personCompanyLinks.js.map +7 -0
- package/dist/modules/customers/commands/shared.js +12 -4
- package/dist/modules/customers/commands/shared.js.map +2 -2
- package/dist/modules/customers/commands/todos.js +10 -1
- package/dist/modules/customers/commands/todos.js.map +2 -2
- package/dist/modules/customers/components/AddressEditor.js +1 -1
- package/dist/modules/customers/components/AddressEditor.js.map +2 -2
- package/dist/modules/customers/components/CustomersConfigurationSections.js +31 -0
- package/dist/modules/customers/components/CustomersConfigurationSections.js.map +7 -0
- package/dist/modules/customers/components/DictionarySettings.js +37 -2
- package/dist/modules/customers/components/DictionarySettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActiveDealCard.js +121 -0
- package/dist/modules/customers/components/detail/ActiveDealCard.js.map +7 -0
- package/dist/modules/customers/components/detail/ActivitiesSection.js +222 -331
- package/dist/modules/customers/components/detail/ActivitiesSection.js.map +3 -3
- package/dist/modules/customers/components/detail/ActivityAiActions.js +36 -0
- package/dist/modules/customers/components/detail/ActivityAiActions.js.map +7 -0
- package/dist/modules/customers/components/detail/ActivityCard.js +126 -0
- package/dist/modules/customers/components/detail/ActivityCard.js.map +7 -0
- package/dist/modules/customers/components/detail/ActivityHistorySection.js +340 -0
- package/dist/modules/customers/components/detail/ActivityHistorySection.js.map +7 -0
- package/dist/modules/customers/components/detail/ActivityLogTab.js +56 -0
- package/dist/modules/customers/components/detail/ActivityLogTab.js.map +7 -0
- package/dist/modules/customers/components/detail/ActivityTimeline.js +108 -0
- package/dist/modules/customers/components/detail/ActivityTimeline.js.map +7 -0
- package/dist/modules/customers/components/detail/ActivityTimelineFilters.js +139 -0
- package/dist/modules/customers/components/detail/ActivityTimelineFilters.js.map +7 -0
- package/dist/modules/customers/components/detail/ActivityTypeSelector.js +42 -0
- package/dist/modules/customers/components/detail/ActivityTypeSelector.js.map +7 -0
- package/dist/modules/customers/components/detail/AiActionChips.js +38 -0
- package/dist/modules/customers/components/detail/AiActionChips.js.map +7 -0
- package/dist/modules/customers/components/detail/AssignRoleDialog.js +534 -0
- package/dist/modules/customers/components/detail/AssignRoleDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/ChangelogEntryRow.js +79 -0
- package/dist/modules/customers/components/detail/ChangelogEntryRow.js.map +7 -0
- package/dist/modules/customers/components/detail/ChangelogFilters.js +176 -0
- package/dist/modules/customers/components/detail/ChangelogFilters.js.map +7 -0
- package/dist/modules/customers/components/detail/ChangelogKpiCards.js +88 -0
- package/dist/modules/customers/components/detail/ChangelogKpiCards.js.map +7 -0
- package/dist/modules/customers/components/detail/ChangelogTab.js +470 -0
- package/dist/modules/customers/components/detail/ChangelogTab.js.map +7 -0
- package/dist/modules/customers/components/detail/ComingSoonPlaceholder.js +16 -0
- package/dist/modules/customers/components/detail/ComingSoonPlaceholder.js.map +7 -0
- package/dist/modules/customers/components/detail/CompanyCard.js +283 -0
- package/dist/modules/customers/components/detail/CompanyCard.js.map +7 -0
- package/dist/modules/customers/components/detail/CompanyDashboardTab.js +133 -0
- package/dist/modules/customers/components/detail/CompanyDashboardTab.js.map +7 -0
- package/dist/modules/customers/components/detail/CompanyDetailHeader.js +191 -0
- package/dist/modules/customers/components/detail/CompanyDetailHeader.js.map +7 -0
- package/dist/modules/customers/components/detail/CompanyDetailTabs.js +123 -0
- package/dist/modules/customers/components/detail/CompanyDetailTabs.js.map +7 -0
- package/dist/modules/customers/components/detail/CompanyKpiBar.js +174 -0
- package/dist/modules/customers/components/detail/CompanyKpiBar.js.map +7 -0
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js +514 -230
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyTagsDialog.js +22 -0
- package/dist/modules/customers/components/detail/CompanyTagsDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js +159 -0
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/CreatePersonDialog.js +135 -0
- package/dist/modules/customers/components/detail/CreatePersonDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/DealClosureActionBar.js +59 -0
- package/dist/modules/customers/components/detail/DealClosureActionBar.js.map +7 -0
- package/dist/modules/customers/components/detail/DealDetailHeader.js +237 -0
- package/dist/modules/customers/components/detail/DealDetailHeader.js.map +7 -0
- package/dist/modules/customers/components/detail/DealDetailTabs.js +109 -0
- package/dist/modules/customers/components/detail/DealDetailTabs.js.map +7 -0
- package/dist/modules/customers/components/detail/DealForm.js +219 -92
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/DealLinkedEntitiesTab.js +295 -0
- package/dist/modules/customers/components/detail/DealLinkedEntitiesTab.js.map +7 -0
- package/dist/modules/customers/components/detail/DealLostSummaryDialog.js +107 -0
- package/dist/modules/customers/components/detail/DealLostSummaryDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/DealWonPopup.js +113 -0
- package/dist/modules/customers/components/detail/DealWonPopup.js.map +7 -0
- package/dist/modules/customers/components/detail/DealsSection.js +206 -193
- package/dist/modules/customers/components/detail/DealsSection.js.map +2 -2
- package/dist/modules/customers/components/detail/DecisionMakersFooter.js +39 -0
- package/dist/modules/customers/components/detail/DecisionMakersFooter.js.map +7 -0
- package/dist/modules/customers/components/detail/EntityTagsDialog.js +1096 -0
- package/dist/modules/customers/components/detail/EntityTagsDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/InlineActivityComposer.js +197 -0
- package/dist/modules/customers/components/detail/InlineActivityComposer.js.map +7 -0
- package/dist/modules/customers/components/detail/ManageTagsDialog.js +1091 -0
- package/dist/modules/customers/components/detail/ManageTagsDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/MiniWeekCalendar.js +272 -0
- package/dist/modules/customers/components/detail/MiniWeekCalendar.js.map +7 -0
- package/dist/modules/customers/components/detail/MobilePersonDetail.js +106 -0
- package/dist/modules/customers/components/detail/MobilePersonDetail.js.map +7 -0
- package/dist/modules/customers/components/detail/NextStepCard.js +72 -0
- package/dist/modules/customers/components/detail/NextStepCard.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonCard.js +192 -0
- package/dist/modules/customers/components/detail/PersonCard.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js +345 -0
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonDetailHeader.js +220 -0
- package/dist/modules/customers/components/detail/PersonDetailHeader.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonDetailTabs.js +122 -0
- package/dist/modules/customers/components/detail/PersonDetailTabs.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonTagsDialog.js +24 -0
- package/dist/modules/customers/components/detail/PersonTagsDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/PipelineStepper.js +191 -0
- package/dist/modules/customers/components/detail/PipelineStepper.js.map +7 -0
- package/dist/modules/customers/components/detail/PlannedActivitiesSection.js +222 -0
- package/dist/modules/customers/components/detail/PlannedActivitiesSection.js.map +7 -0
- package/dist/modules/customers/components/detail/RelationshipHealthCard.js +49 -0
- package/dist/modules/customers/components/detail/RelationshipHealthCard.js.map +7 -0
- package/dist/modules/customers/components/detail/RoleAssignmentRow.js +189 -0
- package/dist/modules/customers/components/detail/RoleAssignmentRow.js.map +7 -0
- package/dist/modules/customers/components/detail/RolesSection.js +234 -0
- package/dist/modules/customers/components/detail/RolesSection.js.map +7 -0
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js +410 -0
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js.map +7 -0
- package/dist/modules/customers/components/detail/aiActionCatalog.js +41 -0
- package/dist/modules/customers/components/detail/aiActionCatalog.js.map +7 -0
- package/dist/modules/customers/components/detail/assignableStaff.js +48 -0
- package/dist/modules/customers/components/detail/assignableStaff.js.map +7 -0
- package/dist/modules/customers/components/detail/dashboard/ActiveDealWidget.js +48 -0
- package/dist/modules/customers/components/detail/dashboard/ActiveDealWidget.js.map +7 -0
- package/dist/modules/customers/components/detail/dashboard/OpenTasksWidget.js +86 -0
- package/dist/modules/customers/components/detail/dashboard/OpenTasksWidget.js.map +7 -0
- package/dist/modules/customers/components/detail/dashboard/RecentActivityWidget.js +53 -0
- package/dist/modules/customers/components/detail/dashboard/RecentActivityWidget.js.map +7 -0
- package/dist/modules/customers/components/detail/dashboard/RelationshipHealthWidget.js +30 -0
- package/dist/modules/customers/components/detail/dashboard/RelationshipHealthWidget.js.map +7 -0
- package/dist/modules/customers/components/detail/dashboard/UpcomingMeetingsWidget.js +43 -0
- package/dist/modules/customers/components/detail/dashboard/UpcomingMeetingsWidget.js.map +7 -0
- package/dist/modules/customers/components/detail/dashboard/helpers.js +71 -0
- package/dist/modules/customers/components/detail/dashboard/helpers.js.map +7 -0
- package/dist/modules/customers/components/detail/healthScoreUtils.js +69 -0
- package/dist/modules/customers/components/detail/healthScoreUtils.js.map +7 -0
- package/dist/modules/customers/components/detail/hooks/useCurrencyDictionary.js +5 -5
- package/dist/modules/customers/components/detail/hooks/useCurrencyDictionary.js.map +2 -2
- package/dist/modules/customers/components/detail/hooks/useCustomerDictionary.js +9 -8
- package/dist/modules/customers/components/detail/hooks/useCustomerDictionary.js.map +3 -3
- package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js +65 -0
- package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js.map +7 -0
- package/dist/modules/customers/components/detail/notesAdapter.js +70 -30
- package/dist/modules/customers/components/detail/notesAdapter.js.map +2 -2
- package/dist/modules/customers/components/detail/pipelineStageUtils.js +26 -0
- package/dist/modules/customers/components/detail/pipelineStageUtils.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/DateTimeFields.js +144 -0
- package/dist/modules/customers/components/detail/schedule/DateTimeFields.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/FooterFields.js +60 -0
- package/dist/modules/customers/components/detail/schedule/FooterFields.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/LinkedEntitiesField.js +216 -0
- package/dist/modules/customers/components/detail/schedule/LinkedEntitiesField.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/LocationField.js +34 -0
- package/dist/modules/customers/components/detail/schedule/LocationField.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/ParticipantsField.js +226 -0
- package/dist/modules/customers/components/detail/schedule/ParticipantsField.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/fieldConfig.js +69 -0
- package/dist/modules/customers/components/detail/schedule/fieldConfig.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/index.js +21 -0
- package/dist/modules/customers/components/detail/schedule/index.js.map +7 -0
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js +172 -0
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js.map +7 -0
- package/dist/modules/customers/components/detail/utils.js +23 -0
- package/dist/modules/customers/components/detail/utils.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +144 -22
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/components/linking/LinkEntityDialog.js +661 -0
- package/dist/modules/customers/components/linking/LinkEntityDialog.js.map +7 -0
- package/dist/modules/customers/components/linking/adapters/companyAdapter.js +252 -0
- package/dist/modules/customers/components/linking/adapters/companyAdapter.js.map +7 -0
- package/dist/modules/customers/components/linking/adapters/dealAdapter.js +384 -0
- package/dist/modules/customers/components/linking/adapters/dealAdapter.js.map +7 -0
- package/dist/modules/customers/components/linking/adapters/personAdapter.js +324 -0
- package/dist/modules/customers/components/linking/adapters/personAdapter.js.map +7 -0
- package/dist/modules/customers/components/list/CollectionPreviewCell.js +53 -0
- package/dist/modules/customers/components/list/CollectionPreviewCell.js.map +7 -0
- package/dist/modules/customers/data/entities.js +407 -1
- package/dist/modules/customers/data/entities.js.map +2 -2
- package/dist/modules/customers/data/validators.js +139 -21
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/customers/events.js +19 -1
- package/dist/modules/customers/events.js.map +2 -2
- package/dist/modules/customers/lib/customerRoleTypes.js +19 -0
- package/dist/modules/customers/lib/customerRoleTypes.js.map +7 -0
- package/dist/modules/customers/lib/dealClosureNotification.js +39 -0
- package/dist/modules/customers/lib/dealClosureNotification.js.map +7 -0
- package/dist/modules/customers/lib/dealStageTransitionTable.js +29 -0
- package/dist/modules/customers/lib/dealStageTransitionTable.js.map +7 -0
- package/dist/modules/customers/lib/dictionaries.js +25 -0
- package/dist/modules/customers/lib/dictionaries.js.map +2 -2
- package/dist/modules/customers/lib/interactionReadModel.js +10 -0
- package/dist/modules/customers/lib/interactionReadModel.js.map +2 -2
- package/dist/modules/customers/lib/personCompanies.js +235 -0
- package/dist/modules/customers/lib/personCompanies.js.map +7 -0
- package/dist/modules/customers/lib/personCompanyLinkTable.js +42 -0
- package/dist/modules/customers/lib/personCompanyLinkTable.js.map +7 -0
- package/dist/modules/customers/lib/roleTypeUsage.js +104 -0
- package/dist/modules/customers/lib/roleTypeUsage.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260406214502.js +18 -0
- package/dist/modules/customers/migrations/Migration20260406214502.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260408135736.js +17 -0
- package/dist/modules/customers/migrations/Migration20260408135736.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260408225345.js +21 -0
- package/dist/modules/customers/migrations/Migration20260408225345.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260411075533.js +27 -0
- package/dist/modules/customers/migrations/Migration20260411075533.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260411103551.js +13 -0
- package/dist/modules/customers/migrations/Migration20260411103551.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260411130944.js +26 -0
- package/dist/modules/customers/migrations/Migration20260411130944.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260415095203.js +13 -0
- package/dist/modules/customers/migrations/Migration20260415095203.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260415135056.js +20 -0
- package/dist/modules/customers/migrations/Migration20260415135056.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260417140000.js +15 -0
- package/dist/modules/customers/migrations/Migration20260417140000.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260417160000.js +17 -0
- package/dist/modules/customers/migrations/Migration20260417160000.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260417235407.js +13 -0
- package/dist/modules/customers/migrations/Migration20260417235407.js.map +7 -0
- package/dist/modules/customers/setup.js +16 -1
- package/dist/modules/customers/setup.js.map +2 -2
- package/dist/modules/customers/subscribers/deal-closure-notification.js +16 -0
- package/dist/modules/customers/subscribers/deal-closure-notification.js.map +7 -0
- package/dist/modules/customers/subscribers/deal-lost-notification.js +16 -0
- package/dist/modules/customers/subscribers/deal-lost-notification.js.map +7 -0
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js +2 -0
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js +154 -0
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js.map +7 -0
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +6 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js +154 -0
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js.map +7 -0
- package/dist/modules/dictionaries/api/context.js +8 -1
- package/dist/modules/dictionaries/api/context.js.map +2 -2
- package/dist/modules/dictionaries/api/openapi.js +18 -1
- package/dist/modules/dictionaries/api/openapi.js.map +2 -2
- package/dist/modules/dictionaries/commands/entry-operations.js +388 -0
- package/dist/modules/dictionaries/commands/entry-operations.js.map +7 -0
- package/dist/modules/dictionaries/commands/factory.js +24 -3
- package/dist/modules/dictionaries/commands/factory.js.map +2 -2
- package/dist/modules/dictionaries/commands/index.js +1 -0
- package/dist/modules/dictionaries/commands/index.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryTable.js +6 -3
- package/dist/modules/dictionaries/components/DictionaryTable.js.map +2 -2
- package/dist/modules/dictionaries/data/entities.js +11 -1
- package/dist/modules/dictionaries/data/entities.js.map +2 -2
- package/dist/modules/dictionaries/data/validators.js +28 -2
- package/dist/modules/dictionaries/data/validators.js.map +2 -2
- package/dist/modules/dictionaries/events.js +18 -0
- package/dist/modules/dictionaries/events.js.map +7 -0
- package/dist/modules/dictionaries/lib/clientEntries.js +43 -0
- package/dist/modules/dictionaries/lib/clientEntries.js.map +7 -0
- package/dist/modules/dictionaries/migrations/Migration20260410171544.js +45 -0
- package/dist/modules/dictionaries/migrations/Migration20260410171544.js.map +7 -0
- package/dist/modules/inbox_ops/api/proposals/[id]/route.js +4 -1
- package/dist/modules/inbox_ops/api/proposals/[id]/route.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +1 -1
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +82 -42
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/lib/dictionaries.js +16 -0
- package/dist/modules/sales/lib/dictionaries.js.map +2 -2
- package/dist/modules/sales/widgets/injection-table.js +5 -1
- package/dist/modules/sales/widgets/injection-table.js.map +2 -2
- package/generated/entities/action_log/index.ts +4 -0
- package/generated/entities/customer_company_billing/index.ts +10 -0
- package/generated/entities/customer_deal/index.ts +4 -0
- package/generated/entities/customer_deal_stage_transition/index.ts +14 -0
- package/generated/entities/customer_dictionary_kind_setting/index.ts +9 -0
- package/generated/entities/customer_entity/index.ts +4 -0
- package/generated/entities/customer_entity_role/index.ts +10 -0
- package/generated/entities/customer_interaction/index.ts +11 -0
- package/generated/entities/customer_label/index.ts +8 -0
- package/generated/entities/customer_label_assignment/index.ts +7 -0
- package/generated/entities/customer_person_company_link/index.ts +9 -0
- package/generated/entities/customer_person_company_role/index.ts +7 -0
- package/generated/entities/dictionary_entry/index.ts +2 -0
- package/generated/entities.ids.generated.ts +9 -1
- package/generated/entity-fields-registry.ts +116 -1
- package/package.json +3 -3
- package/src/modules/attachments/api/route.ts +48 -6
- package/src/modules/attachments/i18n/de.json +4 -0
- package/src/modules/attachments/i18n/en.json +4 -0
- package/src/modules/attachments/i18n/es.json +4 -0
- package/src/modules/attachments/i18n/pl.json +4 -0
- package/src/modules/audit_logs/api/audit-logs/actions/export/route.ts +260 -0
- package/src/modules/audit_logs/api/audit-logs/actions/route.ts +81 -6
- package/src/modules/audit_logs/cli.ts +79 -0
- package/src/modules/audit_logs/data/entities.ts +17 -0
- package/src/modules/audit_logs/data/validators.ts +9 -1
- package/src/modules/audit_logs/lib/changeRows.ts +47 -0
- package/src/modules/audit_logs/lib/display-helpers.tsx +4 -30
- package/src/modules/audit_logs/lib/projections.ts +110 -0
- package/src/modules/audit_logs/migrations/.snapshot-open-mercato.json +325 -2
- package/src/modules/audit_logs/migrations/Migration20260412160533.ts +21 -0
- package/src/modules/audit_logs/services/actionLogService.ts +455 -85
- package/src/modules/catalog/i18n/de.json +1 -0
- package/src/modules/catalog/i18n/en.json +1 -0
- package/src/modules/catalog/i18n/es.json +1 -0
- package/src/modules/catalog/i18n/pl.json +1 -0
- package/src/modules/customer_accounts/i18n/de.json +2 -0
- package/src/modules/customer_accounts/i18n/en.json +2 -0
- package/src/modules/customer_accounts/i18n/es.json +2 -0
- package/src/modules/customer_accounts/i18n/pl.json +2 -0
- package/src/modules/customers/acl.ts +2 -0
- package/src/modules/customers/api/activities/route.ts +4 -0
- package/src/modules/customers/api/assignable-staff/route.ts +250 -0
- package/src/modules/customers/api/companies/[id]/people/route.ts +244 -0
- package/src/modules/customers/api/companies/[id]/roles/route.ts +15 -0
- package/src/modules/customers/api/companies/[id]/route.ts +458 -40
- package/src/modules/customers/api/companies/route.ts +93 -15
- package/src/modules/customers/api/deals/[id]/companies/route.ts +203 -0
- package/src/modules/customers/api/deals/[id]/people/route.ts +182 -0
- package/src/modules/customers/api/deals/[id]/route.ts +554 -57
- package/src/modules/customers/api/deals/[id]/stats/route.ts +221 -0
- package/src/modules/customers/api/deals/route.ts +35 -46
- package/src/modules/customers/api/dictionaries/[kind]/[id]/route.ts +105 -3
- package/src/modules/customers/api/dictionaries/[kind]/route.ts +143 -44
- package/src/modules/customers/api/dictionaries/context.ts +45 -16
- package/src/modules/customers/api/dictionaries/kind-settings/route.ts +232 -0
- package/src/modules/customers/api/entity-roles-factory.ts +520 -0
- package/src/modules/customers/api/interactions/conflicts/route.ts +196 -0
- package/src/modules/customers/api/interactions/counts/route.ts +112 -0
- package/src/modules/customers/api/interactions/route.ts +95 -2
- package/src/modules/customers/api/labels/assign/route.ts +202 -0
- package/src/modules/customers/api/labels/auth.ts +19 -0
- package/src/modules/customers/api/labels/route.ts +310 -0
- package/src/modules/customers/api/labels/table-errors.ts +36 -0
- package/src/modules/customers/api/labels/unassign/route.ts +197 -0
- package/src/modules/customers/api/people/[id]/companies/[linkId]/route.ts +331 -0
- package/src/modules/customers/api/people/[id]/companies/context.ts +70 -0
- package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +384 -0
- package/src/modules/customers/api/people/[id]/companies/route.ts +215 -0
- package/src/modules/customers/api/people/[id]/roles/route.ts +15 -0
- package/src/modules/customers/api/people/[id]/route.ts +153 -26
- package/src/modules/customers/api/people/route.ts +134 -31
- package/src/modules/customers/api/todos/route.ts +4 -0
- package/src/modules/customers/api/utils.ts +36 -0
- package/src/modules/customers/backend/config/customers/page.tsx +2 -6
- package/src/modules/customers/backend/customers/companies/page.tsx +36 -26
- package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +277 -262
- package/src/modules/customers/backend/customers/deals/[id]/hooks/formatters.ts +19 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/types.ts +104 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.ts +60 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.ts +362 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.ts +113 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealData.ts +52 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealFormHandlers.ts +86 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealInjectedTabs.tsx +60 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealMutationContext.ts +76 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealPipeline.ts +56 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useScheduleDialog.ts +38 -0
- package/src/modules/customers/backend/customers/deals/[id]/page.tsx +587 -624
- package/src/modules/customers/backend/customers/deals/page.tsx +71 -28
- package/src/modules/customers/backend/customers/people/page.tsx +35 -29
- package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +343 -209
- package/src/modules/customers/cli.ts +107 -12
- package/src/modules/customers/commands/activities.ts +13 -0
- package/src/modules/customers/commands/deals.ts +386 -114
- package/src/modules/customers/commands/dictionaries.ts +175 -32
- package/src/modules/customers/commands/dictionaryKindSettings.ts +268 -0
- package/src/modules/customers/commands/entity-roles.ts +494 -0
- package/src/modules/customers/commands/index.ts +4 -0
- package/src/modules/customers/commands/interactions.ts +125 -21
- package/src/modules/customers/commands/labels.ts +626 -0
- package/src/modules/customers/commands/people.ts +373 -259
- package/src/modules/customers/commands/personCompanyLinks.ts +654 -0
- package/src/modules/customers/commands/shared.ts +16 -15
- package/src/modules/customers/commands/todos.ts +17 -1
- package/src/modules/customers/components/AddressEditor.tsx +1 -1
- package/src/modules/customers/components/CustomersConfigurationSections.tsx +36 -0
- package/src/modules/customers/components/DictionarySettings.tsx +43 -2
- package/src/modules/customers/components/detail/ActiveDealCard.tsx +175 -0
- package/src/modules/customers/components/detail/ActivitiesSection.tsx +267 -361
- package/src/modules/customers/components/detail/ActivityAiActions.tsx +49 -0
- package/src/modules/customers/components/detail/ActivityCard.tsx +154 -0
- package/src/modules/customers/components/detail/ActivityHistorySection.tsx +412 -0
- package/src/modules/customers/components/detail/ActivityLogTab.tsx +67 -0
- package/src/modules/customers/components/detail/ActivityTimeline.tsx +158 -0
- package/src/modules/customers/components/detail/ActivityTimelineFilters.tsx +163 -0
- package/src/modules/customers/components/detail/ActivityTypeSelector.tsx +53 -0
- package/src/modules/customers/components/detail/AiActionChips.tsx +48 -0
- package/src/modules/customers/components/detail/AssignRoleDialog.tsx +672 -0
- package/src/modules/customers/components/detail/ChangelogEntryRow.tsx +132 -0
- package/src/modules/customers/components/detail/ChangelogFilters.tsx +193 -0
- package/src/modules/customers/components/detail/ChangelogKpiCards.tsx +107 -0
- package/src/modules/customers/components/detail/ChangelogTab.tsx +629 -0
- package/src/modules/customers/components/detail/ComingSoonPlaceholder.tsx +21 -0
- package/src/modules/customers/components/detail/CompanyCard.tsx +419 -0
- package/src/modules/customers/components/detail/CompanyDashboardTab.tsx +161 -0
- package/src/modules/customers/components/detail/CompanyDetailHeader.tsx +243 -0
- package/src/modules/customers/components/detail/CompanyDetailTabs.tsx +172 -0
- package/src/modules/customers/components/detail/CompanyKpiBar.tsx +206 -0
- package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +582 -288
- package/src/modules/customers/components/detail/CompanyTagsDialog.tsx +23 -0
- package/src/modules/customers/components/detail/ConfirmDealLostDialog.tsx +210 -0
- package/src/modules/customers/components/detail/CreatePersonDialog.tsx +178 -0
- package/src/modules/customers/components/detail/DealClosureActionBar.tsx +63 -0
- package/src/modules/customers/components/detail/DealDetailHeader.tsx +335 -0
- package/src/modules/customers/components/detail/DealDetailTabs.tsx +154 -0
- package/src/modules/customers/components/detail/DealForm.tsx +253 -101
- package/src/modules/customers/components/detail/DealLinkedEntitiesTab.tsx +349 -0
- package/src/modules/customers/components/detail/DealLostSummaryDialog.tsx +156 -0
- package/src/modules/customers/components/detail/DealWonPopup.tsx +164 -0
- package/src/modules/customers/components/detail/DealsSection.tsx +276 -221
- package/src/modules/customers/components/detail/DecisionMakersFooter.tsx +56 -0
- package/src/modules/customers/components/detail/EntityTagsDialog.tsx +1372 -0
- package/src/modules/customers/components/detail/InlineActivityComposer.tsx +239 -0
- package/src/modules/customers/components/detail/ManageTagsDialog.tsx +1331 -0
- package/src/modules/customers/components/detail/MiniWeekCalendar.tsx +338 -0
- package/src/modules/customers/components/detail/MobilePersonDetail.tsx +124 -0
- package/src/modules/customers/components/detail/NextStepCard.tsx +104 -0
- package/src/modules/customers/components/detail/PersonCard.tsx +238 -0
- package/src/modules/customers/components/detail/PersonCompaniesSection.tsx +426 -0
- package/src/modules/customers/components/detail/PersonDetailHeader.tsx +294 -0
- package/src/modules/customers/components/detail/PersonDetailTabs.tsx +172 -0
- package/src/modules/customers/components/detail/PersonTagsDialog.tsx +26 -0
- package/src/modules/customers/components/detail/PipelineStepper.tsx +245 -0
- package/src/modules/customers/components/detail/PlannedActivitiesSection.tsx +255 -0
- package/src/modules/customers/components/detail/RelationshipHealthCard.tsx +63 -0
- package/src/modules/customers/components/detail/RoleAssignmentRow.tsx +248 -0
- package/src/modules/customers/components/detail/RolesSection.tsx +311 -0
- package/src/modules/customers/components/detail/ScheduleActivityDialog.tsx +481 -0
- package/src/modules/customers/components/detail/aiActionCatalog.ts +77 -0
- package/src/modules/customers/components/detail/assignableStaff.ts +124 -0
- package/src/modules/customers/components/detail/dashboard/ActiveDealWidget.tsx +63 -0
- package/src/modules/customers/components/detail/dashboard/OpenTasksWidget.tsx +114 -0
- package/src/modules/customers/components/detail/dashboard/RecentActivityWidget.tsx +69 -0
- package/src/modules/customers/components/detail/dashboard/RelationshipHealthWidget.tsx +40 -0
- package/src/modules/customers/components/detail/dashboard/UpcomingMeetingsWidget.tsx +64 -0
- package/src/modules/customers/components/detail/dashboard/helpers.ts +78 -0
- package/src/modules/customers/components/detail/healthScoreUtils.ts +91 -0
- package/src/modules/customers/components/detail/hooks/useCurrencyDictionary.ts +8 -8
- package/src/modules/customers/components/detail/hooks/useCustomerDictionary.ts +10 -6
- package/src/modules/customers/components/detail/hooks/useInteractionMutations.ts +91 -0
- package/src/modules/customers/components/detail/notesAdapter.ts +91 -30
- package/src/modules/customers/components/detail/pipelineStageUtils.ts +29 -0
- package/src/modules/customers/components/detail/schedule/DateTimeFields.tsx +187 -0
- package/src/modules/customers/components/detail/schedule/FooterFields.tsx +79 -0
- package/src/modules/customers/components/detail/schedule/LinkedEntitiesField.tsx +277 -0
- package/src/modules/customers/components/detail/schedule/LocationField.tsx +42 -0
- package/src/modules/customers/components/detail/schedule/ParticipantsField.tsx +255 -0
- package/src/modules/customers/components/detail/schedule/fieldConfig.ts +70 -0
- package/src/modules/customers/components/detail/schedule/index.ts +9 -0
- package/src/modules/customers/components/detail/schedule/useScheduleFormState.ts +221 -0
- package/src/modules/customers/components/detail/types.ts +16 -0
- package/src/modules/customers/components/detail/utils.ts +25 -0
- package/src/modules/customers/components/formConfig.tsx +223 -28
- package/src/modules/customers/components/linking/LinkEntityDialog.tsx +920 -0
- package/src/modules/customers/components/linking/adapters/companyAdapter.tsx +398 -0
- package/src/modules/customers/components/linking/adapters/dealAdapter.tsx +578 -0
- package/src/modules/customers/components/linking/adapters/personAdapter.tsx +512 -0
- package/src/modules/customers/components/list/CollectionPreviewCell.tsx +66 -0
- package/src/modules/customers/data/entities.ts +353 -1
- package/src/modules/customers/data/validators.ts +170 -19
- package/src/modules/customers/events.ts +22 -0
- package/src/modules/customers/i18n/de.json +841 -2
- package/src/modules/customers/i18n/en.json +841 -2
- package/src/modules/customers/i18n/es.json +840 -1
- package/src/modules/customers/i18n/pl.json +841 -2
- package/src/modules/customers/lib/customerRoleTypes.ts +24 -0
- package/src/modules/customers/lib/dealClosureNotification.ts +64 -0
- package/src/modules/customers/lib/dealStageTransitionTable.ts +32 -0
- package/src/modules/customers/lib/dictionaries.ts +26 -10
- package/src/modules/customers/lib/interactionReadModel.ts +10 -0
- package/src/modules/customers/lib/personCompanies.ts +317 -0
- package/src/modules/customers/lib/personCompanyLinkTable.ts +58 -0
- package/src/modules/customers/lib/roleTypeUsage.ts +146 -0
- package/src/modules/customers/migrations/.snapshot-open-mercato.json +2747 -798
- package/src/modules/customers/migrations/Migration20260406214502.ts +19 -0
- package/src/modules/customers/migrations/Migration20260408135736.ts +15 -0
- package/src/modules/customers/migrations/Migration20260408225345.ts +23 -0
- package/src/modules/customers/migrations/Migration20260411075533.ts +30 -0
- package/src/modules/customers/migrations/Migration20260411103551.ts +13 -0
- package/src/modules/customers/migrations/Migration20260411130944.ts +30 -0
- package/src/modules/customers/migrations/Migration20260415095203.ts +13 -0
- package/src/modules/customers/migrations/Migration20260415135056.ts +22 -0
- package/src/modules/customers/migrations/Migration20260417140000.ts +15 -0
- package/src/modules/customers/migrations/Migration20260417160000.ts +17 -0
- package/src/modules/customers/migrations/Migration20260417235407.ts +13 -0
- package/src/modules/customers/setup.ts +15 -0
- package/src/modules/customers/subscribers/deal-closure-notification.ts +22 -0
- package/src/modules/customers/subscribers/deal-lost-notification.ts +22 -0
- package/src/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.ts +2 -0
- package/src/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.ts +162 -0
- package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +6 -2
- package/src/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.ts +162 -0
- package/src/modules/dictionaries/api/context.ts +9 -0
- package/src/modules/dictionaries/api/openapi.ts +17 -0
- package/src/modules/dictionaries/commands/entry-operations.ts +457 -0
- package/src/modules/dictionaries/commands/factory.ts +31 -3
- package/src/modules/dictionaries/commands/index.ts +1 -0
- package/src/modules/dictionaries/components/DictionaryTable.tsx +15 -6
- package/src/modules/dictionaries/data/entities.ts +9 -0
- package/src/modules/dictionaries/data/validators.ts +34 -0
- package/src/modules/dictionaries/events.ts +20 -0
- package/src/modules/dictionaries/i18n/de.json +2 -0
- package/src/modules/dictionaries/i18n/en.json +2 -0
- package/src/modules/dictionaries/i18n/es.json +2 -0
- package/src/modules/dictionaries/i18n/pl.json +2 -0
- package/src/modules/dictionaries/lib/clientEntries.ts +66 -0
- package/src/modules/dictionaries/migrations/.snapshot-open-mercato.json +185 -3
- package/src/modules/dictionaries/migrations/Migration20260410171544.ts +49 -0
- package/src/modules/inbox_ops/api/proposals/[id]/route.ts +4 -1
- package/src/modules/query_index/lib/engine.ts +9 -1
- package/src/modules/sales/components/documents/AddressesSection.tsx +92 -42
- package/src/modules/sales/i18n/de.json +28 -0
- package/src/modules/sales/i18n/en.json +28 -0
- package/src/modules/sales/i18n/es.json +28 -0
- package/src/modules/sales/i18n/pl.json +28 -0
- package/src/modules/sales/lib/dictionaries.ts +18 -0
- package/src/modules/sales/widgets/injection-table.ts +4 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Users, Phone, Check, Mail, Calendar, AlertTriangle, X } from "lucide-react";
|
|
5
|
+
import { cn } from "@open-mercato/shared/lib/utils";
|
|
6
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
7
|
+
import { apiCallOrThrow, readApiResultOrThrow } from "@open-mercato/ui/backend/utils/apiCall";
|
|
8
|
+
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
9
|
+
import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
|
|
10
|
+
import { Alert, AlertDescription, AlertTitle } from "@open-mercato/ui/primitives/alert";
|
|
11
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
12
|
+
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
13
|
+
import { Dialog, DialogContent, DialogTitle } from "@open-mercato/ui/primitives/dialog";
|
|
14
|
+
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
15
|
+
import { SwitchableMarkdownInput } from "@open-mercato/ui/backend/inputs";
|
|
16
|
+
import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
|
|
17
|
+
import {
|
|
18
|
+
useScheduleFormState,
|
|
19
|
+
FIELD_VISIBILITY,
|
|
20
|
+
getFieldLabel,
|
|
21
|
+
DateTimeFields,
|
|
22
|
+
ParticipantsField,
|
|
23
|
+
LocationField,
|
|
24
|
+
FooterFields,
|
|
25
|
+
LinkedEntitiesField
|
|
26
|
+
} from "./schedule/index.js";
|
|
27
|
+
const TYPE_TABS = [
|
|
28
|
+
{ type: "meeting", icon: Users, labelKey: "customers.schedule.types.meeting", fallback: "Meeting" },
|
|
29
|
+
{ type: "call", icon: Phone, labelKey: "customers.schedule.types.call", fallback: "Call" },
|
|
30
|
+
{ type: "task", icon: Check, labelKey: "customers.schedule.types.task", fallback: "Task" },
|
|
31
|
+
{ type: "email", icon: Mail, labelKey: "customers.schedule.types.email", fallback: "Email" }
|
|
32
|
+
];
|
|
33
|
+
function ScheduleActivityDialog({
|
|
34
|
+
open,
|
|
35
|
+
onClose,
|
|
36
|
+
entityId,
|
|
37
|
+
dealId = null,
|
|
38
|
+
entityName,
|
|
39
|
+
companyName,
|
|
40
|
+
entityType,
|
|
41
|
+
onActivityCreated,
|
|
42
|
+
editData
|
|
43
|
+
}) {
|
|
44
|
+
const t = useT();
|
|
45
|
+
const state = useScheduleFormState({ open, editData: editData ?? null });
|
|
46
|
+
const visibleFields = FIELD_VISIBILITY[state.activityType];
|
|
47
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog();
|
|
48
|
+
const formSnapshot = React.useMemo(() => JSON.stringify({
|
|
49
|
+
activityType: state.activityType,
|
|
50
|
+
title: state.title,
|
|
51
|
+
date: state.date,
|
|
52
|
+
startTime: state.startTime,
|
|
53
|
+
duration: state.duration,
|
|
54
|
+
allDay: state.allDay,
|
|
55
|
+
description: state.description,
|
|
56
|
+
location: state.location,
|
|
57
|
+
reminderMinutes: state.reminderMinutes,
|
|
58
|
+
visibility: state.visibility,
|
|
59
|
+
participants: state.participants,
|
|
60
|
+
linkedEntities: state.linkedEntities,
|
|
61
|
+
recurrenceEnabled: state.recurrenceEnabled,
|
|
62
|
+
recurrenceDays: state.recurrenceDays,
|
|
63
|
+
recurrenceEndType: state.recurrenceEndType,
|
|
64
|
+
recurrenceCount: state.recurrenceCount,
|
|
65
|
+
recurrenceEndDate: state.recurrenceEndDate,
|
|
66
|
+
guestPermissions: state.guestPermissions
|
|
67
|
+
}), [
|
|
68
|
+
state.activityType,
|
|
69
|
+
state.title,
|
|
70
|
+
state.date,
|
|
71
|
+
state.startTime,
|
|
72
|
+
state.duration,
|
|
73
|
+
state.allDay,
|
|
74
|
+
state.description,
|
|
75
|
+
state.location,
|
|
76
|
+
state.reminderMinutes,
|
|
77
|
+
state.visibility,
|
|
78
|
+
state.participants,
|
|
79
|
+
state.linkedEntities,
|
|
80
|
+
state.recurrenceEnabled,
|
|
81
|
+
state.recurrenceDays,
|
|
82
|
+
state.recurrenceEndType,
|
|
83
|
+
state.recurrenceCount,
|
|
84
|
+
state.recurrenceEndDate,
|
|
85
|
+
state.guestPermissions
|
|
86
|
+
]);
|
|
87
|
+
const initialSnapshotRef = React.useRef(null);
|
|
88
|
+
const snapshotOpenKeyRef = React.useRef(null);
|
|
89
|
+
const snapshotSettleCountRef = React.useRef(0);
|
|
90
|
+
const openKey = open ? `${editData?.id ?? "new"}` : null;
|
|
91
|
+
React.useEffect(() => {
|
|
92
|
+
if (!open) {
|
|
93
|
+
initialSnapshotRef.current = null;
|
|
94
|
+
snapshotOpenKeyRef.current = null;
|
|
95
|
+
snapshotSettleCountRef.current = 0;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (snapshotOpenKeyRef.current !== openKey) {
|
|
99
|
+
snapshotOpenKeyRef.current = openKey;
|
|
100
|
+
snapshotSettleCountRef.current = 0;
|
|
101
|
+
initialSnapshotRef.current = null;
|
|
102
|
+
}
|
|
103
|
+
if (snapshotSettleCountRef.current < 2) {
|
|
104
|
+
initialSnapshotRef.current = formSnapshot;
|
|
105
|
+
snapshotSettleCountRef.current += 1;
|
|
106
|
+
}
|
|
107
|
+
}, [open, openKey, formSnapshot]);
|
|
108
|
+
const isDirty = React.useCallback(() => {
|
|
109
|
+
if (initialSnapshotRef.current == null) return false;
|
|
110
|
+
return initialSnapshotRef.current !== formSnapshot;
|
|
111
|
+
}, [formSnapshot]);
|
|
112
|
+
const guardedClose = React.useCallback(async () => {
|
|
113
|
+
if (!isDirty()) {
|
|
114
|
+
onClose();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const ok = await confirm({
|
|
118
|
+
title: t("customers.schedule.discardConfirm.title", "Discard unsaved changes?"),
|
|
119
|
+
description: t(
|
|
120
|
+
"customers.schedule.discardConfirm.description",
|
|
121
|
+
"You have unsaved edits in this activity. Save them first or continue to discard them."
|
|
122
|
+
),
|
|
123
|
+
confirmText: t("customers.schedule.discardConfirm.confirm", "Discard"),
|
|
124
|
+
cancelText: t("customers.schedule.discardConfirm.cancel", "Keep editing"),
|
|
125
|
+
variant: "destructive"
|
|
126
|
+
});
|
|
127
|
+
if (ok) onClose();
|
|
128
|
+
}, [confirm, isDirty, onClose, t]);
|
|
129
|
+
const mutationContextId = React.useMemo(
|
|
130
|
+
() => `customer-activity:${entityType}:${entityId}`,
|
|
131
|
+
[entityId, entityType]
|
|
132
|
+
);
|
|
133
|
+
const { runMutation, retryLastMutation } = useGuardedMutation({
|
|
134
|
+
contextId: mutationContextId,
|
|
135
|
+
blockedMessage: t("ui.forms.flash.saveBlocked", "Save blocked by validation")
|
|
136
|
+
});
|
|
137
|
+
const mutationContext = React.useMemo(
|
|
138
|
+
() => ({
|
|
139
|
+
formId: mutationContextId,
|
|
140
|
+
resourceKind: entityType === "company" ? "customers.company" : entityType === "person" ? "customers.person" : "customers.deal",
|
|
141
|
+
resourceId: entityId,
|
|
142
|
+
entityType,
|
|
143
|
+
retryLastMutation
|
|
144
|
+
}),
|
|
145
|
+
[entityId, entityType, mutationContextId, retryLastMutation]
|
|
146
|
+
);
|
|
147
|
+
const runGuardedMutation = React.useCallback(
|
|
148
|
+
async (operation, mutationPayload) => runMutation({
|
|
149
|
+
operation,
|
|
150
|
+
mutationPayload,
|
|
151
|
+
context: mutationContext
|
|
152
|
+
}),
|
|
153
|
+
[mutationContext, runMutation]
|
|
154
|
+
);
|
|
155
|
+
React.useEffect(() => {
|
|
156
|
+
if (!open || state.allDay || !state.date || !state.startTime) {
|
|
157
|
+
state.setConflict(null);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const timer = setTimeout(async () => {
|
|
161
|
+
try {
|
|
162
|
+
const localStart = /* @__PURE__ */ new Date(`${state.date}T${state.startTime}:00`);
|
|
163
|
+
const params = new URLSearchParams({
|
|
164
|
+
date: state.date,
|
|
165
|
+
startTime: state.startTime,
|
|
166
|
+
duration: String(state.duration)
|
|
167
|
+
});
|
|
168
|
+
if (editData?.id) {
|
|
169
|
+
params.set("excludeId", editData.id);
|
|
170
|
+
}
|
|
171
|
+
if (!Number.isNaN(localStart.getTime())) {
|
|
172
|
+
params.set("timezoneOffsetMinutes", String(-localStart.getTimezoneOffset()));
|
|
173
|
+
}
|
|
174
|
+
const data = await readApiResultOrThrow(`/api/customers/interactions/conflicts?${params.toString()}`);
|
|
175
|
+
if (data?.hasConflicts && Array.isArray(data.conflicts) && data.conflicts.length > 0) {
|
|
176
|
+
const descriptions = data.conflicts.map((c) => `${c.startTime}\u2013${c.endTime}: ${c.title ?? c.type}`).join(", ");
|
|
177
|
+
state.setConflict(
|
|
178
|
+
t("customers.schedule.conflict.description", "Overlaps with: {{items}}", { items: descriptions })
|
|
179
|
+
);
|
|
180
|
+
} else {
|
|
181
|
+
state.setConflict(null);
|
|
182
|
+
}
|
|
183
|
+
} catch {
|
|
184
|
+
state.setConflict(null);
|
|
185
|
+
}
|
|
186
|
+
}, 500);
|
|
187
|
+
return () => clearTimeout(timer);
|
|
188
|
+
}, [editData?.id, open, state.date, state.startTime, state.duration, state.allDay, t]);
|
|
189
|
+
const handleSave = React.useCallback(async () => {
|
|
190
|
+
if (!state.title.trim()) return;
|
|
191
|
+
state.setSaving(true);
|
|
192
|
+
try {
|
|
193
|
+
const scheduledAt = state.allDay ? (/* @__PURE__ */ new Date(`${state.date}T00:00:00`)).toISOString() : (/* @__PURE__ */ new Date(`${state.date}T${state.startTime}:00`)).toISOString();
|
|
194
|
+
const recurrenceRule = state.recurrenceEnabled ? buildRecurrenceRule(state.recurrenceDays, state.recurrenceEndType, state.recurrenceCount, state.recurrenceEndDate) : null;
|
|
195
|
+
const isEditing = Boolean(editData?.id);
|
|
196
|
+
const payload = {
|
|
197
|
+
...isEditing ? { id: editData.id } : {},
|
|
198
|
+
entityId,
|
|
199
|
+
dealId,
|
|
200
|
+
interactionType: state.activityType,
|
|
201
|
+
title: state.title.trim(),
|
|
202
|
+
body: state.description.trim() || null,
|
|
203
|
+
status: "planned",
|
|
204
|
+
scheduledAt,
|
|
205
|
+
durationMinutes: visibleFields.has("duration") && !state.allDay ? state.duration : null,
|
|
206
|
+
location: visibleFields.has("location") ? state.location.trim() || null : null,
|
|
207
|
+
allDay: visibleFields.has("allDay") ? state.allDay : null,
|
|
208
|
+
recurrenceRule: visibleFields.has("recurrence") ? recurrenceRule : null,
|
|
209
|
+
recurrenceEnd: visibleFields.has("recurrence") && state.recurrenceEndType === "date" && state.recurrenceEndDate ? new Date(state.recurrenceEndDate).toISOString() : null,
|
|
210
|
+
participants: visibleFields.has("participants") && state.participants.length > 0 ? state.participants.map((p) => ({ userId: p.userId, name: p.name, email: p.email, status: p.status ?? "pending" })) : null,
|
|
211
|
+
guestPermissions: visibleFields.has("participants") && state.participants.length > 0 ? state.guestPermissions : null,
|
|
212
|
+
linkedEntities: state.linkedEntities.length > 0 ? state.linkedEntities.map((e) => ({ id: e.id, type: e.type, label: e.label })) : null,
|
|
213
|
+
reminderMinutes: visibleFields.has("reminder") ? state.reminderMinutes : null,
|
|
214
|
+
visibility: visibleFields.has("visibility") ? state.visibility : null
|
|
215
|
+
};
|
|
216
|
+
await runGuardedMutation(
|
|
217
|
+
() => apiCallOrThrow("/api/customers/interactions", {
|
|
218
|
+
method: isEditing ? "PUT" : "POST",
|
|
219
|
+
headers: { "content-type": "application/json" },
|
|
220
|
+
body: JSON.stringify(payload)
|
|
221
|
+
}),
|
|
222
|
+
{
|
|
223
|
+
operation: isEditing ? "updateActivity" : "createActivity",
|
|
224
|
+
interactionId: editData?.id ?? null,
|
|
225
|
+
interactionType: state.activityType
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
flash(t("customers.schedule.saved", "Activity scheduled"), "success");
|
|
229
|
+
onClose();
|
|
230
|
+
requestAnimationFrame(() => {
|
|
231
|
+
onActivityCreated?.();
|
|
232
|
+
});
|
|
233
|
+
} catch {
|
|
234
|
+
flash(t("customers.schedule.error", "Failed to schedule activity"), "error");
|
|
235
|
+
} finally {
|
|
236
|
+
state.setSaving(false);
|
|
237
|
+
}
|
|
238
|
+
}, [state.activityType, state.allDay, state.date, state.description, dealId, state.duration, editData, entityId, state.guestPermissions, state.linkedEntities, state.location, onActivityCreated, onClose, state.participants, state.recurrenceCount, state.recurrenceDays, state.recurrenceEnabled, state.recurrenceEndDate, state.recurrenceEndType, state.reminderMinutes, runGuardedMutation, state.startTime, t, state.title, state.visibility, visibleFields]);
|
|
239
|
+
const handleKeyDown = React.useCallback((e) => {
|
|
240
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
|
|
241
|
+
e.preventDefault();
|
|
242
|
+
handleSave();
|
|
243
|
+
}
|
|
244
|
+
}, [handleSave]);
|
|
245
|
+
return /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: (o) => {
|
|
246
|
+
if (!o) void guardedClose();
|
|
247
|
+
}, children: [
|
|
248
|
+
ConfirmDialogElement,
|
|
249
|
+
/* @__PURE__ */ jsxs(DialogContent, { className: "flex max-h-[90vh] flex-col overflow-hidden border-border p-0 shadow-xl sm:max-w-[680px] sm:rounded-xl [&>[data-dialog-close]]:hidden", onKeyDown: handleKeyDown, "aria-describedby": void 0, children: [
|
|
250
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(DialogTitle, { children: editData ? t("customers.schedule.editTitle", "Edit activity") : t("customers.schedule.title", "Schedule activity") }) }),
|
|
251
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border bg-background px-6 py-5", children: [
|
|
252
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
253
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-bold leading-tight text-foreground", children: editData ? t("customers.schedule.editTitle", "Edit activity") : t("customers.schedule.title", "Schedule activity") }),
|
|
254
|
+
entityName && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
255
|
+
/* @__PURE__ */ jsx("span", { className: "inline-block size-3.5 rounded-full bg-status-success-icon shrink-0" }),
|
|
256
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
257
|
+
t("customers.schedule.context", "On timeline: {{name}}", { name: entityName }),
|
|
258
|
+
companyName && ` \xB7 ${companyName}`
|
|
259
|
+
] })
|
|
260
|
+
] })
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ jsx(IconButton, { type: "button", variant: "ghost", size: "sm", onClick: () => {
|
|
263
|
+
void guardedClose();
|
|
264
|
+
}, className: "flex size-9 shrink-0 items-center justify-center rounded-md border border-border bg-background", "aria-label": t("customers.schedule.cancel", "Cancel"), children: /* @__PURE__ */ jsx(X, { className: "size-4 text-muted-foreground" }) })
|
|
265
|
+
] }),
|
|
266
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 bg-background p-6", children: [
|
|
267
|
+
state.conflict && /* @__PURE__ */ jsxs(Alert, { variant: "warning", className: "rounded-lg", children: [
|
|
268
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "size-5" }),
|
|
269
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("customers.schedule.conflict.title", "Calendar conflict") }),
|
|
270
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: state.conflict })
|
|
271
|
+
] }),
|
|
272
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-0.5 rounded-md border border-border bg-muted p-1", children: TYPE_TABS.map(({ type, icon: Icon, labelKey, fallback }) => {
|
|
273
|
+
const isActive = state.activityType === type;
|
|
274
|
+
return /* @__PURE__ */ jsxs(
|
|
275
|
+
Button,
|
|
276
|
+
{
|
|
277
|
+
type: "button",
|
|
278
|
+
variant: "ghost",
|
|
279
|
+
size: "sm",
|
|
280
|
+
onClick: () => state.setActivityType(type),
|
|
281
|
+
className: cn(
|
|
282
|
+
"h-auto flex items-center gap-2 rounded-md px-3.5 py-2 text-sm transition-colors",
|
|
283
|
+
isActive ? "bg-background font-semibold text-foreground shadow-sm" : "bg-transparent font-normal text-muted-foreground"
|
|
284
|
+
),
|
|
285
|
+
children: [
|
|
286
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-3.5" }),
|
|
287
|
+
t(labelKey, fallback)
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
type
|
|
291
|
+
);
|
|
292
|
+
}) }),
|
|
293
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
294
|
+
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold text-muted-foreground tracking-wider", children: getFieldLabel(state.activityType, "title", t, "customers.schedule.titleLabel", "Title") }),
|
|
295
|
+
/* @__PURE__ */ jsx(
|
|
296
|
+
"input",
|
|
297
|
+
{
|
|
298
|
+
type: "text",
|
|
299
|
+
value: state.title,
|
|
300
|
+
onChange: (e) => state.setTitle(e.target.value),
|
|
301
|
+
placeholder: t("customers.schedule.titlePlaceholder", "Activity title..."),
|
|
302
|
+
className: "w-full rounded-md border border-border bg-background px-3 py-2.5 text-sm text-foreground outline-none focus:border-foreground",
|
|
303
|
+
autoFocus: true
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] }),
|
|
307
|
+
/* @__PURE__ */ jsx(
|
|
308
|
+
DateTimeFields,
|
|
309
|
+
{
|
|
310
|
+
visible: visibleFields,
|
|
311
|
+
activityType: state.activityType,
|
|
312
|
+
date: state.date,
|
|
313
|
+
setDate: state.setDate,
|
|
314
|
+
startTime: state.startTime,
|
|
315
|
+
setStartTime: state.setStartTime,
|
|
316
|
+
duration: state.duration,
|
|
317
|
+
setDuration: state.setDuration,
|
|
318
|
+
allDay: state.allDay,
|
|
319
|
+
setAllDay: state.setAllDay,
|
|
320
|
+
recurrenceEnabled: state.recurrenceEnabled,
|
|
321
|
+
setRecurrenceEnabled: state.setRecurrenceEnabled,
|
|
322
|
+
recurrenceDays: state.recurrenceDays,
|
|
323
|
+
toggleRecurrenceDay: state.toggleRecurrenceDay,
|
|
324
|
+
recurrenceEndType: state.recurrenceEndType,
|
|
325
|
+
setRecurrenceEndType: state.setRecurrenceEndType,
|
|
326
|
+
recurrenceCount: state.recurrenceCount,
|
|
327
|
+
setRecurrenceCount: state.setRecurrenceCount,
|
|
328
|
+
recurrenceEndDate: state.recurrenceEndDate,
|
|
329
|
+
setRecurrenceEndDate: state.setRecurrenceEndDate
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
/* @__PURE__ */ jsx(
|
|
333
|
+
ParticipantsField,
|
|
334
|
+
{
|
|
335
|
+
visible: visibleFields,
|
|
336
|
+
activityType: state.activityType,
|
|
337
|
+
participants: state.participants,
|
|
338
|
+
setParticipants: state.setParticipants,
|
|
339
|
+
removeParticipant: state.removeParticipant,
|
|
340
|
+
guestPermissions: state.guestPermissions,
|
|
341
|
+
setGuestPermissions: state.setGuestPermissions
|
|
342
|
+
}
|
|
343
|
+
),
|
|
344
|
+
/* @__PURE__ */ jsx(
|
|
345
|
+
LocationField,
|
|
346
|
+
{
|
|
347
|
+
visible: visibleFields,
|
|
348
|
+
activityType: state.activityType,
|
|
349
|
+
location: state.location,
|
|
350
|
+
setLocation: state.setLocation
|
|
351
|
+
}
|
|
352
|
+
),
|
|
353
|
+
/* @__PURE__ */ jsx(
|
|
354
|
+
LinkedEntitiesField,
|
|
355
|
+
{
|
|
356
|
+
visible: visibleFields,
|
|
357
|
+
activityType: state.activityType,
|
|
358
|
+
linkedEntities: state.linkedEntities,
|
|
359
|
+
setLinkedEntities: state.setLinkedEntities
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
363
|
+
/* @__PURE__ */ jsx("label", { className: "text-overline font-semibold uppercase text-muted-foreground tracking-wider", children: getFieldLabel(state.activityType, "description", t, "customers.schedule.description", "Description") }),
|
|
364
|
+
/* @__PURE__ */ jsx("div", { className: "mt-[8px]", children: /* @__PURE__ */ jsx(
|
|
365
|
+
SwitchableMarkdownInput,
|
|
366
|
+
{
|
|
367
|
+
value: state.description,
|
|
368
|
+
onChange: state.setDescription,
|
|
369
|
+
isMarkdownEnabled: state.markdownEnabled,
|
|
370
|
+
height: 120,
|
|
371
|
+
placeholder: t("customers.schedule.descriptionPlaceholder", "Add details...")
|
|
372
|
+
}
|
|
373
|
+
) })
|
|
374
|
+
] }),
|
|
375
|
+
/* @__PURE__ */ jsx(
|
|
376
|
+
FooterFields,
|
|
377
|
+
{
|
|
378
|
+
visible: visibleFields,
|
|
379
|
+
activityType: state.activityType,
|
|
380
|
+
reminderMinutes: state.reminderMinutes,
|
|
381
|
+
setReminderMinutes: state.setReminderMinutes,
|
|
382
|
+
visibility: state.visibility,
|
|
383
|
+
setVisibility: state.setVisibility
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
] }) }),
|
|
387
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center justify-end gap-2.5 border-t border-border bg-muted/50 px-6 py-4", children: [
|
|
388
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
389
|
+
void guardedClose();
|
|
390
|
+
}, className: "rounded-md border border-input bg-background px-5 py-3 text-sm font-semibold text-foreground", children: t("customers.schedule.cancel", "Cancel") }),
|
|
391
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", onClick: handleSave, disabled: state.saving || !state.title.trim(), className: "flex items-center gap-2 rounded-md bg-primary px-5 py-3 text-sm font-semibold text-primary-foreground disabled:opacity-50", children: [
|
|
392
|
+
/* @__PURE__ */ jsx(Calendar, { className: "size-3.5" }),
|
|
393
|
+
state.saving ? t("customers.schedule.saving", "Saving...") : editData ? t("customers.schedule.update", "Update activity") : t("customers.schedule.save", "Save activity")
|
|
394
|
+
] })
|
|
395
|
+
] })
|
|
396
|
+
] })
|
|
397
|
+
] });
|
|
398
|
+
}
|
|
399
|
+
function buildRecurrenceRule(days, endType, count, endDate) {
|
|
400
|
+
const dayNames = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"];
|
|
401
|
+
const selectedDays = days.map((active, i) => active ? dayNames[i] : null).filter(Boolean);
|
|
402
|
+
let rule = `FREQ=WEEKLY;BYDAY=${selectedDays.join(",")}`;
|
|
403
|
+
if (endType === "count") rule += `;COUNT=${count}`;
|
|
404
|
+
if (endType === "date" && endDate) rule += `;UNTIL=${endDate.replace(/-/g, "")}T235959Z`;
|
|
405
|
+
return rule;
|
|
406
|
+
}
|
|
407
|
+
export {
|
|
408
|
+
ScheduleActivityDialog
|
|
409
|
+
};
|
|
410
|
+
//# sourceMappingURL=ScheduleActivityDialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/ScheduleActivityDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Users, Phone, Check, Mail, Calendar, AlertTriangle, X } from 'lucide-react'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { apiCallOrThrow, readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { Alert, AlertDescription, AlertTitle } from '@open-mercato/ui/primitives/alert'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { Dialog, DialogContent, DialogTitle } from '@open-mercato/ui/primitives/dialog'\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\nimport { SwitchableMarkdownInput } from '@open-mercato/ui/backend/inputs'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport {\n useScheduleFormState,\n FIELD_VISIBILITY,\n getFieldLabel,\n DateTimeFields,\n ParticipantsField,\n LocationField,\n FooterFields,\n LinkedEntitiesField,\n} from './schedule'\nimport type { ActivityType, ScheduleActivityEditData } from './schedule'\n\nconst TYPE_TABS: Array<{ type: ActivityType; icon: React.ComponentType<{ className?: string }>; labelKey: string; fallback: string }> = [\n { type: 'meeting', icon: Users, labelKey: 'customers.schedule.types.meeting', fallback: 'Meeting' },\n { type: 'call', icon: Phone, labelKey: 'customers.schedule.types.call', fallback: 'Call' },\n { type: 'task', icon: Check, labelKey: 'customers.schedule.types.task', fallback: 'Task' },\n { type: 'email', icon: Mail, labelKey: 'customers.schedule.types.email', fallback: 'Email' },\n]\n\ninterface ScheduleActivityDialogProps {\n open: boolean\n onClose: () => void\n entityId: string\n dealId?: string | null\n entityName?: string\n companyName?: string | null\n entityType: 'company' | 'person' | 'deal'\n onActivityCreated?: () => void\n /** When provided, dialog opens in edit mode with pre-filled data */\n editData?: ScheduleActivityEditData | null\n}\n\nexport function ScheduleActivityDialog({\n open,\n onClose,\n entityId,\n dealId = null,\n entityName,\n companyName,\n entityType,\n onActivityCreated,\n editData,\n}: ScheduleActivityDialogProps) {\n const t = useT()\n const state = useScheduleFormState({ open, editData: editData ?? null })\n const visibleFields = FIELD_VISIBILITY[state.activityType]\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n\n const formSnapshot = React.useMemo(() => JSON.stringify({\n activityType: state.activityType,\n title: state.title,\n date: state.date,\n startTime: state.startTime,\n duration: state.duration,\n allDay: state.allDay,\n description: state.description,\n location: state.location,\n reminderMinutes: state.reminderMinutes,\n visibility: state.visibility,\n participants: state.participants,\n linkedEntities: state.linkedEntities,\n recurrenceEnabled: state.recurrenceEnabled,\n recurrenceDays: state.recurrenceDays,\n recurrenceEndType: state.recurrenceEndType,\n recurrenceCount: state.recurrenceCount,\n recurrenceEndDate: state.recurrenceEndDate,\n guestPermissions: state.guestPermissions,\n }), [\n state.activityType, state.title, state.date, state.startTime, state.duration, state.allDay,\n state.description, state.location, state.reminderMinutes, state.visibility, state.participants,\n state.linkedEntities, state.recurrenceEnabled, state.recurrenceDays, state.recurrenceEndType,\n state.recurrenceCount, state.recurrenceEndDate, state.guestPermissions,\n ])\n const initialSnapshotRef = React.useRef<string | null>(null)\n const snapshotOpenKeyRef = React.useRef<string | null>(null)\n const snapshotSettleCountRef = React.useRef(0)\n const openKey = open ? `${editData?.id ?? 'new'}` : null\n React.useEffect(() => {\n if (!open) {\n initialSnapshotRef.current = null\n snapshotOpenKeyRef.current = null\n snapshotSettleCountRef.current = 0\n return\n }\n if (snapshotOpenKeyRef.current !== openKey) {\n snapshotOpenKeyRef.current = openKey\n snapshotSettleCountRef.current = 0\n initialSnapshotRef.current = null\n }\n if (snapshotSettleCountRef.current < 2) {\n initialSnapshotRef.current = formSnapshot\n snapshotSettleCountRef.current += 1\n }\n }, [open, openKey, formSnapshot])\n\n const isDirty = React.useCallback(() => {\n if (initialSnapshotRef.current == null) return false\n return initialSnapshotRef.current !== formSnapshot\n }, [formSnapshot])\n\n const guardedClose = React.useCallback(async () => {\n if (!isDirty()) {\n onClose()\n return\n }\n const ok = await confirm({\n title: t('customers.schedule.discardConfirm.title', 'Discard unsaved changes?'),\n description: t(\n 'customers.schedule.discardConfirm.description',\n 'You have unsaved edits in this activity. Save them first or continue to discard them.',\n ),\n confirmText: t('customers.schedule.discardConfirm.confirm', 'Discard'),\n cancelText: t('customers.schedule.discardConfirm.cancel', 'Keep editing'),\n variant: 'destructive',\n })\n if (ok) onClose()\n }, [confirm, isDirty, onClose, t])\n\n const mutationContextId = React.useMemo(\n () => `customer-activity:${entityType}:${entityId}`,\n [entityId, entityType],\n )\n const { runMutation, retryLastMutation } = useGuardedMutation<{\n formId: string\n resourceKind: string\n resourceId: string\n entityType: 'company' | 'person' | 'deal'\n retryLastMutation: () => Promise<boolean>\n }>({\n contextId: mutationContextId,\n blockedMessage: t('ui.forms.flash.saveBlocked', 'Save blocked by validation'),\n })\n const mutationContext = React.useMemo(\n () => ({\n formId: mutationContextId,\n resourceKind:\n entityType === 'company'\n ? 'customers.company'\n : entityType === 'person'\n ? 'customers.person'\n : 'customers.deal',\n resourceId: entityId,\n entityType,\n retryLastMutation,\n }),\n [entityId, entityType, mutationContextId, retryLastMutation],\n )\n const runGuardedMutation = React.useCallback(\n async <T,>(operation: () => Promise<T>, mutationPayload: Record<string, unknown>) =>\n runMutation({\n operation,\n mutationPayload,\n context: mutationContext,\n }),\n [mutationContext, runMutation],\n )\n\n // Conflict detection -- debounced check when date/time/duration changes\n React.useEffect(() => {\n if (!open || state.allDay || !state.date || !state.startTime) {\n state.setConflict(null)\n return\n }\n const timer = setTimeout(async () => {\n try {\n const localStart = new Date(`${state.date}T${state.startTime}:00`)\n const params = new URLSearchParams({\n date: state.date,\n startTime: state.startTime,\n duration: String(state.duration),\n })\n if (editData?.id) {\n params.set('excludeId', editData.id)\n }\n if (!Number.isNaN(localStart.getTime())) {\n params.set('timezoneOffsetMinutes', String(-localStart.getTimezoneOffset()))\n }\n const data = await readApiResultOrThrow<{\n hasConflicts: boolean\n conflicts: Array<{ id: string; title: string | null; startTime: string; endTime: string; type: string }>\n }>(`/api/customers/interactions/conflicts?${params.toString()}`)\n if (data?.hasConflicts && Array.isArray(data.conflicts) && data.conflicts.length > 0) {\n const descriptions = data.conflicts\n .map((c) => `${c.startTime}\u2013${c.endTime}: ${c.title ?? c.type}`)\n .join(', ')\n state.setConflict(\n t('customers.schedule.conflict.description', 'Overlaps with: {{items}}', { items: descriptions }),\n )\n } else {\n state.setConflict(null)\n }\n } catch {\n state.setConflict(null)\n }\n }, 500)\n return () => clearTimeout(timer)\n }, [editData?.id, open, state.date, state.startTime, state.duration, state.allDay, t]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSave = React.useCallback(async () => {\n if (!state.title.trim()) return\n state.setSaving(true)\n try {\n const scheduledAt = state.allDay\n ? new Date(`${state.date}T00:00:00`).toISOString()\n : new Date(`${state.date}T${state.startTime}:00`).toISOString()\n\n const recurrenceRule = state.recurrenceEnabled\n ? buildRecurrenceRule(state.recurrenceDays, state.recurrenceEndType, state.recurrenceCount, state.recurrenceEndDate)\n : null\n\n const isEditing = Boolean(editData?.id)\n const payload = {\n ...(isEditing ? { id: editData!.id } : {}),\n entityId,\n dealId,\n interactionType: state.activityType,\n title: state.title.trim(),\n body: state.description.trim() || null,\n status: 'planned',\n scheduledAt,\n durationMinutes: visibleFields.has('duration') && !state.allDay ? state.duration : null,\n location: visibleFields.has('location') ? (state.location.trim() || null) : null,\n allDay: visibleFields.has('allDay') ? state.allDay : null,\n recurrenceRule: visibleFields.has('recurrence') ? recurrenceRule : null,\n recurrenceEnd: visibleFields.has('recurrence') && state.recurrenceEndType === 'date' && state.recurrenceEndDate\n ? new Date(state.recurrenceEndDate).toISOString()\n : null,\n participants: visibleFields.has('participants') && state.participants.length > 0\n ? state.participants.map((p) => ({ userId: p.userId, name: p.name, email: p.email, status: p.status ?? 'pending' }))\n : null,\n guestPermissions: visibleFields.has('participants') && state.participants.length > 0 ? state.guestPermissions : null,\n linkedEntities: state.linkedEntities.length > 0\n ? state.linkedEntities.map((e) => ({ id: e.id, type: e.type, label: e.label }))\n : null,\n reminderMinutes: visibleFields.has('reminder') ? state.reminderMinutes : null,\n visibility: visibleFields.has('visibility') ? state.visibility : null,\n }\n await runGuardedMutation(\n () =>\n apiCallOrThrow('/api/customers/interactions', {\n method: isEditing ? 'PUT' : 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(payload),\n }),\n {\n operation: isEditing ? 'updateActivity' : 'createActivity',\n interactionId: editData?.id ?? null,\n interactionType: state.activityType,\n },\n )\n flash(t('customers.schedule.saved', 'Activity scheduled'), 'success')\n onClose()\n // Delay data reload so the dialog can unmount cleanly and Radix restores body scroll\n requestAnimationFrame(() => { onActivityCreated?.() })\n } catch {\n flash(t('customers.schedule.error', 'Failed to schedule activity'), 'error')\n } finally {\n state.setSaving(false)\n }\n }, [state.activityType, state.allDay, state.date, state.description, dealId, state.duration, editData, entityId, state.guestPermissions, state.linkedEntities, state.location, onActivityCreated, onClose, state.participants, state.recurrenceCount, state.recurrenceDays, state.recurrenceEnabled, state.recurrenceEndDate, state.recurrenceEndType, state.reminderMinutes, runGuardedMutation, state.startTime, t, state.title, state.visibility, visibleFields]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {\n e.preventDefault()\n handleSave()\n }\n }, [handleSave])\n\n return (\n <Dialog open={open} onOpenChange={(o) => { if (!o) void guardedClose() }}>\n {ConfirmDialogElement}\n <DialogContent className=\"flex max-h-[90vh] flex-col overflow-hidden border-border p-0 shadow-xl sm:max-w-[680px] sm:rounded-xl [&>[data-dialog-close]]:hidden\" onKeyDown={handleKeyDown} aria-describedby={undefined}>\n <VisuallyHidden>\n <DialogTitle>{editData ? t('customers.schedule.editTitle', 'Edit activity') : t('customers.schedule.title', 'Schedule activity')}</DialogTitle>\n </VisuallyHidden>\n\n {/* Header */}\n <div className=\"flex shrink-0 items-start justify-between gap-3 border-b border-border bg-background px-6 py-5\">\n <div className=\"flex flex-col gap-1.5\">\n <h2 className=\"text-lg font-bold leading-tight text-foreground\">\n {editData ? t('customers.schedule.editTitle', 'Edit activity') : t('customers.schedule.title', 'Schedule activity')}\n </h2>\n {entityName && (\n <div className=\"flex items-center gap-1.5\">\n <span className=\"inline-block size-3.5 rounded-full bg-status-success-icon shrink-0\" />\n <span className=\"text-xs text-muted-foreground\">\n {t('customers.schedule.context', 'On timeline: {{name}}', { name: entityName })}\n {companyName && ` \u00B7 ${companyName}`}\n </span>\n </div>\n )}\n </div>\n <IconButton type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => { void guardedClose() }} className=\"flex size-9 shrink-0 items-center justify-center rounded-md border border-border bg-background\" aria-label={t('customers.schedule.cancel', 'Cancel')}>\n <X className=\"size-4 text-muted-foreground\" />\n </IconButton>\n </div>\n\n <div className=\"flex-1 overflow-y-auto\">\n <div className=\"flex flex-col gap-4 bg-background p-6\">\n\n {/* Conflict warning */}\n {state.conflict && (\n <Alert variant=\"warning\" className=\"rounded-lg\">\n <AlertTriangle className=\"size-5\" />\n <AlertTitle>\n {t('customers.schedule.conflict.title', 'Calendar conflict')}\n </AlertTitle>\n <AlertDescription>{state.conflict}</AlertDescription>\n </Alert>\n )}\n\n {/* Type tabs */}\n <div className=\"flex gap-0.5 rounded-md border border-border bg-muted p-1\">\n {TYPE_TABS.map(({ type, icon: Icon, labelKey, fallback }) => {\n const isActive = state.activityType === type\n return (\n <Button\n key={type}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => state.setActivityType(type)}\n className={cn(\n 'h-auto flex items-center gap-2 rounded-md px-3.5 py-2 text-sm transition-colors',\n isActive\n ? 'bg-background font-semibold text-foreground shadow-sm'\n : 'bg-transparent font-normal text-muted-foreground',\n )}\n >\n <Icon className=\"size-3.5\" />\n {t(labelKey, fallback)}\n </Button>\n )\n })}\n </div>\n\n {/* Title */}\n <div className=\"flex flex-col gap-1.5\">\n <label className=\"text-overline font-semibold text-muted-foreground tracking-wider\">\n {getFieldLabel(state.activityType, 'title', t, 'customers.schedule.titleLabel', 'Title')}\n </label>\n <input\n type=\"text\"\n value={state.title}\n onChange={(e) => state.setTitle(e.target.value)}\n placeholder={t('customers.schedule.titlePlaceholder', 'Activity title...')}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2.5 text-sm text-foreground outline-none focus:border-foreground\"\n autoFocus\n />\n </div>\n\n {/* Date/Time/Duration */}\n <DateTimeFields\n visible={visibleFields}\n activityType={state.activityType}\n date={state.date}\n setDate={state.setDate}\n startTime={state.startTime}\n setStartTime={state.setStartTime}\n duration={state.duration}\n setDuration={state.setDuration}\n allDay={state.allDay}\n setAllDay={state.setAllDay}\n recurrenceEnabled={state.recurrenceEnabled}\n setRecurrenceEnabled={state.setRecurrenceEnabled}\n recurrenceDays={state.recurrenceDays}\n toggleRecurrenceDay={state.toggleRecurrenceDay}\n recurrenceEndType={state.recurrenceEndType}\n setRecurrenceEndType={state.setRecurrenceEndType}\n recurrenceCount={state.recurrenceCount}\n setRecurrenceCount={state.setRecurrenceCount}\n recurrenceEndDate={state.recurrenceEndDate}\n setRecurrenceEndDate={state.setRecurrenceEndDate}\n />\n\n {/* Participants */}\n <ParticipantsField\n visible={visibleFields}\n activityType={state.activityType}\n participants={state.participants}\n setParticipants={state.setParticipants}\n removeParticipant={state.removeParticipant}\n guestPermissions={state.guestPermissions}\n setGuestPermissions={state.setGuestPermissions}\n />\n\n {/* Location */}\n <LocationField\n visible={visibleFields}\n activityType={state.activityType}\n location={state.location}\n setLocation={state.setLocation}\n />\n\n {/* Linked Entities */}\n <LinkedEntitiesField\n visible={visibleFields}\n activityType={state.activityType}\n linkedEntities={state.linkedEntities}\n setLinkedEntities={state.setLinkedEntities}\n />\n\n {/* Description */}\n <div>\n <label className=\"text-overline font-semibold uppercase text-muted-foreground tracking-wider\">\n {getFieldLabel(state.activityType, 'description', t, 'customers.schedule.description', 'Description')}\n </label>\n <div className=\"mt-[8px]\">\n <SwitchableMarkdownInput\n value={state.description}\n onChange={state.setDescription}\n isMarkdownEnabled={state.markdownEnabled}\n height={120}\n placeholder={t('customers.schedule.descriptionPlaceholder', 'Add details...')}\n />\n </div>\n </div>\n\n {/* Reminder + Visibility */}\n <FooterFields\n visible={visibleFields}\n activityType={state.activityType}\n reminderMinutes={state.reminderMinutes}\n setReminderMinutes={state.setReminderMinutes}\n visibility={state.visibility}\n setVisibility={state.setVisibility}\n />\n\n </div>\n </div>\n\n {/* Footer */}\n <div className=\"flex shrink-0 items-center justify-end gap-2.5 border-t border-border bg-muted/50 px-6 py-4\">\n <Button type=\"button\" variant=\"outline\" onClick={() => { void guardedClose() }} className=\"rounded-md border border-input bg-background px-5 py-3 text-sm font-semibold text-foreground\">\n {t('customers.schedule.cancel', 'Cancel')}\n </Button>\n <Button type=\"button\" onClick={handleSave} disabled={state.saving || !state.title.trim()} className=\"flex items-center gap-2 rounded-md bg-primary px-5 py-3 text-sm font-semibold text-primary-foreground disabled:opacity-50\">\n <Calendar className=\"size-3.5\" />\n {state.saving\n ? t('customers.schedule.saving', 'Saving...')\n : editData\n ? t('customers.schedule.update', 'Update activity')\n : t('customers.schedule.save', 'Save activity')}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport type { ScheduleActivityEditData }\n\nfunction buildRecurrenceRule(\n days: boolean[],\n endType: 'never' | 'count' | 'date',\n count: number,\n endDate: string,\n): string {\n const dayNames = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']\n const selectedDays = days.map((active, i) => (active ? dayNames[i] : null)).filter(Boolean)\n let rule = `FREQ=WEEKLY;BYDAY=${selectedDays.join(',')}`\n if (endType === 'count') rule += `;COUNT=${count}`\n if (endType === 'date' && endDate) rule += `;UNTIL=${endDate.replace(/-/g, '')}T235959Z`\n return rule\n}\n"],
|
|
5
|
+
"mappings": ";AAiSU,cAYM,YAZN;AA/RV,YAAY,WAAW;AACvB,SAAS,OAAO,OAAO,OAAO,MAAM,UAAU,eAAe,SAAS;AACtE,SAAS,UAAU;AACnB,SAAS,YAAY;AACrB,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,aAAa;AACtB,SAAS,0BAA0B;AACnC,SAAS,OAAO,kBAAkB,kBAAkB;AACpD,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,QAAQ,eAAe,mBAAmB;AACnD,SAAS,sBAAsB;AAC/B,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,MAAM,YAAkI;AAAA,EACtI,EAAE,MAAM,WAAW,MAAM,OAAO,UAAU,oCAAoC,UAAU,UAAU;AAAA,EAClG,EAAE,MAAM,QAAQ,MAAM,OAAO,UAAU,iCAAiC,UAAU,OAAO;AAAA,EACzF,EAAE,MA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OAAO,qBAAqB,aAAa,KAAK,GAAG,CAAC;AACtD,MAAI,YAAY,QAAS,SAAQ,UAAU,KAAK;AAChD,MAAI,YAAY,UAAU,QAAS,SAAQ,UAAU,QAAQ,QAAQ,MAAM,EAAE,CAAC;AAC9E,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BarChart3, FileText, ListTodo, Mail, NotebookPen, Play, Reply, Sparkles, Users } from "lucide-react";
|
|
2
|
+
const AI_ACTION_DEFINITIONS = {
|
|
3
|
+
ai: { key: "ai", i18nKey: "customers.ai.actions.ai", fallback: "AI", icon: Sparkles },
|
|
4
|
+
summarize: { key: "summarize", i18nKey: "customers.ai.actions.summarize", fallback: "Summarize", icon: FileText },
|
|
5
|
+
replay: { key: "replay", i18nKey: "customers.ai.actions.replay", fallback: "Replay", icon: Play },
|
|
6
|
+
transcription: { key: "transcription", i18nKey: "customers.ai.actions.transcription", fallback: "Transcription", icon: NotebookPen },
|
|
7
|
+
actionItems: { key: "actionItems", i18nKey: "customers.ai.actions.actionItems", fallback: "Action items", icon: ListTodo },
|
|
8
|
+
showEmail: { key: "showEmail", i18nKey: "customers.ai.actions.showEmail", fallback: "Show email", icon: Mail },
|
|
9
|
+
reply: { key: "reply", i18nKey: "customers.ai.actions.reply", fallback: "Reply", icon: Reply },
|
|
10
|
+
sentiment: { key: "sentiment", i18nKey: "customers.ai.actions.sentiment", fallback: "Sentiment", icon: BarChart3 },
|
|
11
|
+
notes: { key: "notes", i18nKey: "customers.ai.actions.notes", fallback: "Notes", icon: NotebookPen },
|
|
12
|
+
attendees: { key: "attendees", i18nKey: "customers.ai.actions.attendees", fallback: "Attendees", icon: Users },
|
|
13
|
+
leadScore: { key: "leadScore", i18nKey: "customers.ai.actions.leadScore", fallback: "Lead score", icon: BarChart3 },
|
|
14
|
+
expand: { key: "expand", i18nKey: "customers.ai.actions.expand", fallback: "Expand", icon: Sparkles },
|
|
15
|
+
bulletize: { key: "bulletize", i18nKey: "customers.ai.actions.bulletize", fallback: "Bulletize", icon: ListTodo },
|
|
16
|
+
translate: { key: "translate", i18nKey: "customers.ai.actions.translate", fallback: "Translate", icon: Sparkles }
|
|
17
|
+
};
|
|
18
|
+
const AI_CARD_ACTIONS_BY_TYPE = {
|
|
19
|
+
call: ["ai", "summarize", "replay", "transcription", "actionItems"],
|
|
20
|
+
email: ["ai", "summarize", "showEmail", "reply", "sentiment"],
|
|
21
|
+
meeting: ["ai", "summarize", "notes", "attendees"],
|
|
22
|
+
note: ["ai", "summarize"]
|
|
23
|
+
};
|
|
24
|
+
const AI_TIMELINE_ACTIONS_BY_TYPE = {
|
|
25
|
+
call: ["summarize", "replay", "transcription", "actionItems"],
|
|
26
|
+
email: ["summarize", "showEmail", "reply", "sentiment"],
|
|
27
|
+
meeting: ["summarize", "replay", "actionItems", "leadScore"],
|
|
28
|
+
note: ["expand", "bulletize", "translate"]
|
|
29
|
+
};
|
|
30
|
+
function resolveAiActions(activityType, table) {
|
|
31
|
+
const fallbackKeys = table.note ?? [];
|
|
32
|
+
const keys = table[activityType] ?? fallbackKeys;
|
|
33
|
+
return keys.map((key) => AI_ACTION_DEFINITIONS[key]).filter(Boolean);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
AI_ACTION_DEFINITIONS,
|
|
37
|
+
AI_CARD_ACTIONS_BY_TYPE,
|
|
38
|
+
AI_TIMELINE_ACTIONS_BY_TYPE,
|
|
39
|
+
resolveAiActions
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=aiActionCatalog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/aiActionCatalog.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Shared catalog of \"coming soon\" AI action chips used by both\n * ActivityAiActions (outline button chips on activity cards) and\n * AiActionChips (inline pipe-separated chips on timeline rows).\n *\n * Each presentation surface can subset / reorder the catalog.\n * Action handlers are intentionally absent \u2014 the UI is disabled\n * until the AI assistant wiring lands.\n */\n\nimport type { ComponentType, SVGProps } from 'react'\nimport { BarChart3, FileText, ListTodo, Mail, NotebookPen, Play, Reply, Sparkles, Users } from 'lucide-react'\n\nexport type AiActionKey =\n | 'ai'\n | 'summarize'\n | 'replay'\n | 'transcription'\n | 'actionItems'\n | 'showEmail'\n | 'reply'\n | 'sentiment'\n | 'notes'\n | 'attendees'\n | 'leadScore'\n | 'expand'\n | 'bulletize'\n | 'translate'\n\nexport type AiActionDefinition = {\n key: AiActionKey\n i18nKey: string\n fallback: string\n icon: ComponentType<SVGProps<SVGSVGElement>>\n}\n\nexport const AI_ACTION_DEFINITIONS: Record<AiActionKey, AiActionDefinition> = {\n ai: { key: 'ai', i18nKey: 'customers.ai.actions.ai', fallback: 'AI', icon: Sparkles },\n summarize: { key: 'summarize', i18nKey: 'customers.ai.actions.summarize', fallback: 'Summarize', icon: FileText },\n replay: { key: 'replay', i18nKey: 'customers.ai.actions.replay', fallback: 'Replay', icon: Play },\n transcription: { key: 'transcription', i18nKey: 'customers.ai.actions.transcription', fallback: 'Transcription', icon: NotebookPen },\n actionItems: { key: 'actionItems', i18nKey: 'customers.ai.actions.actionItems', fallback: 'Action items', icon: ListTodo },\n showEmail: { key: 'showEmail', i18nKey: 'customers.ai.actions.showEmail', fallback: 'Show email', icon: Mail },\n reply: { key: 'reply', i18nKey: 'customers.ai.actions.reply', fallback: 'Reply', icon: Reply },\n sentiment: { key: 'sentiment', i18nKey: 'customers.ai.actions.sentiment', fallback: 'Sentiment', icon: BarChart3 },\n notes: { key: 'notes', i18nKey: 'customers.ai.actions.notes', fallback: 'Notes', icon: NotebookPen },\n attendees: { key: 'attendees', i18nKey: 'customers.ai.actions.attendees', fallback: 'Attendees', icon: Users },\n leadScore: { key: 'leadScore', i18nKey: 'customers.ai.actions.leadScore', fallback: 'Lead score', icon: BarChart3 },\n expand: { key: 'expand', i18nKey: 'customers.ai.actions.expand', fallback: 'Expand', icon: Sparkles },\n bulletize: { key: 'bulletize', i18nKey: 'customers.ai.actions.bulletize', fallback: 'Bulletize', icon: ListTodo },\n translate: { key: 'translate', i18nKey: 'customers.ai.actions.translate', fallback: 'Translate', icon: Sparkles },\n}\n\n/** Per-activity-type action keys in card (outline chip) layout. */\nexport const AI_CARD_ACTIONS_BY_TYPE: Record<string, AiActionKey[]> = {\n call: ['ai', 'summarize', 'replay', 'transcription', 'actionItems'],\n email: ['ai', 'summarize', 'showEmail', 'reply', 'sentiment'],\n meeting: ['ai', 'summarize', 'notes', 'attendees'],\n note: ['ai', 'summarize'],\n}\n\n/** Per-activity-type action keys in timeline (inline) layout. */\nexport const AI_TIMELINE_ACTIONS_BY_TYPE: Record<string, AiActionKey[]> = {\n call: ['summarize', 'replay', 'transcription', 'actionItems'],\n email: ['summarize', 'showEmail', 'reply', 'sentiment'],\n meeting: ['summarize', 'replay', 'actionItems', 'leadScore'],\n note: ['expand', 'bulletize', 'translate'],\n}\n\nexport function resolveAiActions(\n activityType: string,\n table: Record<string, AiActionKey[]>,\n): AiActionDefinition[] {\n const fallbackKeys = table.note ?? []\n const keys = table[activityType] ?? fallbackKeys\n return keys.map((key) => AI_ACTION_DEFINITIONS[key]).filter(Boolean)\n}\n"],
|
|
5
|
+
"mappings": "AAWA,SAAS,WAAW,UAAU,UAAU,MAAM,aAAa,MAAM,OAAO,UAAU,aAAa;AAyBxF,MAAM,wBAAiE;AAAA,EAC5E,IAAI,EAAE,KAAK,MAAM,SAAS,2BAA2B,UAAU,MAAM,MAAM,SAAS;AAAA,EACpF,WAAW,EAAE,KAAK,aAAa,SAAS,kCAAkC,UAAU,aAAa,MAAM,SAAS;AAAA,EAChH,QAAQ,EAAE,KAAK,UAAU,SAAS,+BAA+B,UAAU,UAAU,MAAM,KAAK;AAAA,EAChG,eAAe,EAAE,KAAK,iBAAiB,SAAS,sCAAsC,UAAU,iBAAiB,MAAM,YAAY;AAAA,EAC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M,eAAe,MAAM,QAAQ,CAAC;AACpC,QAAM,OAAO,MAAM,YAAY,KAAK;AACpC,SAAO,KAAK,IAAI,CAAC,QAAQ,sBAAsB,GAAG,CAAC,EAAE,OAAO,OAAO;AACrE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { readApiResultOrThrow } from "@open-mercato/ui/backend/utils/apiCall";
|
|
2
|
+
async function fetchAssignableStaffMembersPage(query, options) {
|
|
3
|
+
const params = new URLSearchParams();
|
|
4
|
+
params.set("page", String(options?.page ?? 1));
|
|
5
|
+
params.set("pageSize", String(options?.pageSize ?? 24));
|
|
6
|
+
const normalizedQuery = query.trim();
|
|
7
|
+
if (normalizedQuery.length > 0) {
|
|
8
|
+
params.set("search", normalizedQuery);
|
|
9
|
+
}
|
|
10
|
+
const data = await readApiResultOrThrow(
|
|
11
|
+
`/api/customers/assignable-staff?${params.toString()}`,
|
|
12
|
+
options?.signal ? { signal: options.signal } : void 0
|
|
13
|
+
);
|
|
14
|
+
const rawItems = Array.isArray(data?.items) ? data.items : [];
|
|
15
|
+
const deduped = /* @__PURE__ */ new Map();
|
|
16
|
+
for (const item of rawItems) {
|
|
17
|
+
const userId = typeof item?.userId === "string" ? item.userId : typeof item?.user_id === "string" ? item.user_id : null;
|
|
18
|
+
if (!userId || deduped.has(userId)) continue;
|
|
19
|
+
const user = item?.user && typeof item.user === "object" ? item.user : null;
|
|
20
|
+
const team = item?.team && typeof item.team === "object" ? item.team : null;
|
|
21
|
+
const displayName = typeof item?.displayName === "string" && item.displayName.trim().length > 0 ? item.displayName.trim() : typeof item?.display_name === "string" && item.display_name.trim().length > 0 ? item.display_name.trim() : null;
|
|
22
|
+
const email = user && typeof user.email === "string" && user.email.trim().length > 0 ? user.email.trim() : typeof item?.email === "string" && item.email.trim().length > 0 ? item.email.trim() : null;
|
|
23
|
+
const teamName = typeof item?.teamName === "string" && item.teamName.trim().length > 0 ? item.teamName.trim() : typeof item?.team_name === "string" && item.team_name.trim().length > 0 ? item.team_name.trim() : team && typeof team.name === "string" && team.name.trim().length > 0 ? team.name.trim() : null;
|
|
24
|
+
const teamMemberId = typeof item?.teamMemberId === "string" ? item.teamMemberId : typeof item?.team_member_id === "string" ? item.team_member_id : typeof item?.id === "string" ? item.id : userId;
|
|
25
|
+
deduped.set(userId, {
|
|
26
|
+
teamMemberId,
|
|
27
|
+
userId,
|
|
28
|
+
displayName: displayName ?? email ?? userId,
|
|
29
|
+
email,
|
|
30
|
+
teamName
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
items: Array.from(deduped.values()),
|
|
35
|
+
total: typeof data?.total === "number" && Number.isFinite(data.total) ? data.total : deduped.size,
|
|
36
|
+
page: typeof data?.page === "number" && Number.isFinite(data.page) ? data.page : options?.page ?? 1,
|
|
37
|
+
pageSize: typeof data?.pageSize === "number" && Number.isFinite(data.pageSize) ? data.pageSize : options?.pageSize ?? 24
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async function fetchAssignableStaffMembers(query, options) {
|
|
41
|
+
const result = await fetchAssignableStaffMembersPage(query, options);
|
|
42
|
+
return result.items;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
fetchAssignableStaffMembers,
|
|
46
|
+
fetchAssignableStaffMembersPage
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=assignableStaff.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/assignableStaff.ts"],
|
|
4
|
+
"sourcesContent": ["import { readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\n\nexport type AssignableStaffMember = {\n teamMemberId: string\n userId: string\n displayName: string\n email: string | null\n teamName: string | null\n}\n\ntype AssignableStaffResponse = {\n items?: Array<Record<string, unknown>>\n total?: number\n page?: number\n pageSize?: number\n}\n\nexport type AssignableStaffMembersPage = {\n items: AssignableStaffMember[]\n total: number\n page: number\n pageSize: number\n}\n\nexport async function fetchAssignableStaffMembersPage(\n query: string,\n options?: { page?: number; pageSize?: number; signal?: AbortSignal },\n): Promise<AssignableStaffMembersPage> {\n const params = new URLSearchParams()\n params.set('page', String(options?.page ?? 1))\n params.set('pageSize', String(options?.pageSize ?? 24))\n const normalizedQuery = query.trim()\n if (normalizedQuery.length > 0) {\n params.set('search', normalizedQuery)\n }\n\n const data = await readApiResultOrThrow<AssignableStaffResponse>(\n `/api/customers/assignable-staff?${params.toString()}`,\n options?.signal ? { signal: options.signal } : undefined,\n )\n\n const rawItems = Array.isArray(data?.items) ? data.items : []\n const deduped = new Map<string, AssignableStaffMember>()\n\n for (const item of rawItems) {\n const userId =\n typeof item?.userId === 'string'\n ? item.userId\n : typeof item?.user_id === 'string'\n ? item.user_id\n : null\n if (!userId || deduped.has(userId)) continue\n\n const user =\n item?.user && typeof item.user === 'object'\n ? (item.user as Record<string, unknown>)\n : null\n const team =\n item?.team && typeof item.team === 'object'\n ? (item.team as Record<string, unknown>)\n : null\n\n const displayName =\n typeof item?.displayName === 'string' && item.displayName.trim().length > 0\n ? item.displayName.trim()\n : typeof item?.display_name === 'string' && item.display_name.trim().length > 0\n ? item.display_name.trim()\n : null\n const email =\n user && typeof user.email === 'string' && user.email.trim().length > 0\n ? user.email.trim()\n : typeof item?.email === 'string' && item.email.trim().length > 0\n ? item.email.trim()\n : null\n const teamName =\n typeof item?.teamName === 'string' && item.teamName.trim().length > 0\n ? item.teamName.trim()\n : typeof item?.team_name === 'string' && item.team_name.trim().length > 0\n ? item.team_name.trim()\n : team && typeof team.name === 'string' && team.name.trim().length > 0\n ? team.name.trim()\n : null\n const teamMemberId =\n typeof item?.teamMemberId === 'string'\n ? item.teamMemberId\n : typeof item?.team_member_id === 'string'\n ? item.team_member_id\n : typeof item?.id === 'string'\n ? item.id\n : userId\n\n deduped.set(userId, {\n teamMemberId,\n userId,\n displayName: displayName ?? email ?? userId,\n email,\n teamName,\n })\n }\n\n return {\n items: Array.from(deduped.values()),\n total:\n typeof data?.total === 'number' && Number.isFinite(data.total)\n ? data.total\n : deduped.size,\n page:\n typeof data?.page === 'number' && Number.isFinite(data.page)\n ? data.page\n : options?.page ?? 1,\n pageSize:\n typeof data?.pageSize === 'number' && Number.isFinite(data.pageSize)\n ? data.pageSize\n : options?.pageSize ?? 24,\n }\n}\n\nexport async function fetchAssignableStaffMembers(\n query: string,\n options?: { pageSize?: number; signal?: AbortSignal },\n): Promise<AssignableStaffMember[]> {\n const result = await fetchAssignableStaffMembersPage(query, options)\n return result.items\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,4BAA4B;AAwBrC,eAAsB,gCACpB,OACA,SACqC;AACrC,QAAM,SAAS,IAAI,gBAAgB;AACnC,SAAO,IAAI,QAAQ,OAAO,SAAS,QAAQ,CAAC,CAAC;AAC7C,SAAO,IAAI,YAAY,OAAO,SAAS,YAAY,EAAE,CAAC;AACtD,QAAM,kBAAkB,MAAM,KAAK;AACnC,MAAI,gBAAgB,SAAS,GAAG;AAC9B,WAAO,IAAI,UAAU,eAAe;AAAA,EACtC;AAEA,QAAM,OAAO,MAAM;AAAA,IACjB,mCAAmC,OAAO,SAAS,CAAC;AAAA,IACpD,SAAS,SAAS,EAAE,QAAQ,QAAQ,OAAO,IAAI;AAAA,EACjD;AAEA,QAAM,WAAW,MAAM,QAAQ,MAAM,KAAK,IAAI,KAAK,QAAQ,CAAC;AAC5D,QAAM,UAAU,oBAAI,IAAmC;AAEvD,aAAW,QAAQ,UAAU;AAC3B,UAAM,SACJ,OAAO,MAAM,WAAW,WACpB,KAAK,SACL,OAAO,MAAM,YAAY,WACvB,KAAK,UACL;AACR,QAAI,CAAC,UAAU,QAAQ,IAAI,MAAM,EAAG;AAEpC,UAAM,OACJ,MAAM,QAAQ,OAAO,KAAK,SAAS,WAC9B,KAAK,OACN;AACN,UAAM,OACJ,MAAM,QAAQ,OAAO,KAAK,SAAS,WAC9B,K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