@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,384 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AlertTriangle, Briefcase, CalendarDays, Link2 } from "lucide-react";
|
|
4
|
+
import { readApiResultOrThrow } from "@open-mercato/ui/backend/utils/apiCall";
|
|
5
|
+
import { Avatar } from "@open-mercato/ui/primitives/avatar";
|
|
6
|
+
import { cn } from "@open-mercato/shared/lib/utils";
|
|
7
|
+
const DEFAULT_PAGE_SIZE = 20;
|
|
8
|
+
function parseStatusFilter(filterId) {
|
|
9
|
+
if (!filterId || filterId === "all" || filterId === "orphan") return null;
|
|
10
|
+
return filterId;
|
|
11
|
+
}
|
|
12
|
+
function asRecord(value) {
|
|
13
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
14
|
+
}
|
|
15
|
+
function readTrimmedString(record, ...keys) {
|
|
16
|
+
if (!record) return null;
|
|
17
|
+
for (const key of keys) {
|
|
18
|
+
const value = record[key];
|
|
19
|
+
if (typeof value === "string" && value.trim().length) {
|
|
20
|
+
return value.trim();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
function readDecimalValue(record, ...keys) {
|
|
26
|
+
if (!record) return null;
|
|
27
|
+
for (const key of keys) {
|
|
28
|
+
const value = record[key];
|
|
29
|
+
if (typeof value === "string" && value.trim().length) {
|
|
30
|
+
return value.trim();
|
|
31
|
+
}
|
|
32
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
33
|
+
return String(value);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function normalizeAssociationRecord(entry) {
|
|
39
|
+
const record = asRecord(entry);
|
|
40
|
+
const id = readTrimmedString(record, "id");
|
|
41
|
+
if (!id) return null;
|
|
42
|
+
return {
|
|
43
|
+
id,
|
|
44
|
+
label: readTrimmedString(record, "label", "displayName", "display_name", "name", "title") ?? id,
|
|
45
|
+
subtitle: readTrimmedString(record, "subtitle", "role", "roleLabel")
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function normalizeDealRecord(record) {
|
|
49
|
+
const id = typeof record.id === "string" ? record.id : null;
|
|
50
|
+
if (!id) return null;
|
|
51
|
+
const title = typeof record.title === "string" && record.title.trim().length ? record.title.trim() : typeof record.name === "string" && record.name.trim().length ? record.name.trim() : null;
|
|
52
|
+
const label = title ?? id;
|
|
53
|
+
const code = typeof record.code === "string" ? record.code : typeof record.reference === "string" ? record.reference : null;
|
|
54
|
+
const valueAmount = typeof record.valueAmount === "string" ? record.valueAmount : typeof record.value_amount === "string" ? record.value_amount : typeof record.value === "number" ? String(record.value) : null;
|
|
55
|
+
const valueCurrency = typeof record.valueCurrency === "string" ? record.valueCurrency : typeof record.value_currency === "string" ? record.value_currency : null;
|
|
56
|
+
const stage = typeof record.pipelineStage === "string" ? record.pipelineStage : typeof record.pipeline_stage === "string" ? record.pipeline_stage : typeof record.status === "string" ? record.status : null;
|
|
57
|
+
const updatedAt = typeof record.updatedAt === "string" ? record.updatedAt : typeof record.updated_at === "string" ? record.updated_at : typeof record.createdAt === "string" ? record.createdAt : typeof record.created_at === "string" ? record.created_at : null;
|
|
58
|
+
const anchorCompanies = typeof record.companies?.length === "number" ? record.companies.length : typeof record.companyCount === "number" ? record.companyCount : null;
|
|
59
|
+
const isOrphan = anchorCompanies !== null ? anchorCompanies === 0 : void 0;
|
|
60
|
+
const companyName = typeof record.companyName === "string" ? record.companyName : Array.isArray(record.companies) && record.companies.length > 0 ? normalizeAssociationRecord(record.companies[0])?.label ?? null : null;
|
|
61
|
+
return {
|
|
62
|
+
id,
|
|
63
|
+
label,
|
|
64
|
+
subtitle: null,
|
|
65
|
+
meta: {
|
|
66
|
+
code,
|
|
67
|
+
valueAmount,
|
|
68
|
+
valueCurrency,
|
|
69
|
+
stage,
|
|
70
|
+
updatedAt,
|
|
71
|
+
isOrphan,
|
|
72
|
+
companyName: typeof companyName === "string" ? companyName : null
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async function fetchDealDetails(id, contextEntityId) {
|
|
77
|
+
try {
|
|
78
|
+
const payload = await readApiResultOrThrow(
|
|
79
|
+
`/api/customers/deals/${encodeURIComponent(id)}`
|
|
80
|
+
);
|
|
81
|
+
const rootRecord = asRecord(payload);
|
|
82
|
+
const dealRecord = asRecord(rootRecord?.deal) ?? rootRecord;
|
|
83
|
+
const title = readTrimmedString(dealRecord, "title", "name") ?? id;
|
|
84
|
+
const code = readTrimmedString(dealRecord, "code", "reference");
|
|
85
|
+
const createdAt = readTrimmedString(dealRecord, "createdAt", "created_at");
|
|
86
|
+
const valueAmount = readDecimalValue(dealRecord, "valueAmount", "value_amount", "value");
|
|
87
|
+
const valueCurrency = readTrimmedString(
|
|
88
|
+
dealRecord,
|
|
89
|
+
"valueCurrency",
|
|
90
|
+
"value_currency",
|
|
91
|
+
"currency"
|
|
92
|
+
);
|
|
93
|
+
const stage = readTrimmedString(dealRecord, "pipelineStage", "pipeline_stage", "status");
|
|
94
|
+
const companies = Array.isArray(rootRecord?.companies) ? rootRecord.companies.map((entry) => normalizeAssociationRecord(entry)).filter((entry) => entry !== null) : [];
|
|
95
|
+
const people = Array.isArray(rootRecord?.people) ? rootRecord.people.map((entry) => normalizeAssociationRecord(entry)).filter((entry) => entry !== null) : [];
|
|
96
|
+
const companiesCount = companies.filter((entry) => {
|
|
97
|
+
return !contextEntityId || entry.id !== contextEntityId;
|
|
98
|
+
}).length;
|
|
99
|
+
const peopleCount = people.filter((entry) => {
|
|
100
|
+
return !contextEntityId || entry.id !== contextEntityId;
|
|
101
|
+
}).length;
|
|
102
|
+
const keyPeople = people.slice(0, 3).map((entry) => ({
|
|
103
|
+
id: entry.id,
|
|
104
|
+
name: entry.label,
|
|
105
|
+
role: entry.subtitle
|
|
106
|
+
}));
|
|
107
|
+
return {
|
|
108
|
+
id,
|
|
109
|
+
title,
|
|
110
|
+
code,
|
|
111
|
+
createdAt,
|
|
112
|
+
stage,
|
|
113
|
+
value: valueAmount ? { amount: valueAmount, currency: valueCurrency ?? null } : null,
|
|
114
|
+
nextStep: null,
|
|
115
|
+
keyPeople,
|
|
116
|
+
anchors: { companies: companiesCount, people: peopleCount }
|
|
117
|
+
};
|
|
118
|
+
} catch {
|
|
119
|
+
return {
|
|
120
|
+
id,
|
|
121
|
+
title: id,
|
|
122
|
+
code: null,
|
|
123
|
+
createdAt: null,
|
|
124
|
+
stage: null,
|
|
125
|
+
value: null,
|
|
126
|
+
nextStep: null,
|
|
127
|
+
keyPeople: [],
|
|
128
|
+
anchors: { companies: 0, people: 0 }
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function formatValue(amount, currency) {
|
|
133
|
+
if (!amount) return null;
|
|
134
|
+
const parsed = parseFloat(amount);
|
|
135
|
+
if (!Number.isFinite(parsed)) return amount;
|
|
136
|
+
const formatted = parsed.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
137
|
+
return currency ? `${formatted} ${currency}` : formatted;
|
|
138
|
+
}
|
|
139
|
+
function formatRelative(dateString) {
|
|
140
|
+
if (!dateString) return "";
|
|
141
|
+
try {
|
|
142
|
+
const date = new Date(dateString);
|
|
143
|
+
const now = Date.now();
|
|
144
|
+
const diffMs = now - date.getTime();
|
|
145
|
+
const diffDays = Math.floor(diffMs / 864e5);
|
|
146
|
+
if (diffDays <= 0) return "today";
|
|
147
|
+
if (diffDays === 1) return "yesterday";
|
|
148
|
+
if (diffDays < 30) return `${diffDays} days ago`;
|
|
149
|
+
if (diffDays < 365) return `${Math.floor(diffDays / 30)} months ago`;
|
|
150
|
+
return `${Math.floor(diffDays / 365)} years ago`;
|
|
151
|
+
} catch {
|
|
152
|
+
return "";
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function createDealLinkAdapter(options) {
|
|
156
|
+
const pageSize = options.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
157
|
+
const filters = {
|
|
158
|
+
options: [
|
|
159
|
+
{ id: "all", label: "All" },
|
|
160
|
+
{ id: "open", label: "Open" },
|
|
161
|
+
{ id: "win", label: "Won" },
|
|
162
|
+
{ id: "loose", label: "Lost" },
|
|
163
|
+
{
|
|
164
|
+
id: "orphan",
|
|
165
|
+
label: "Orphan",
|
|
166
|
+
dotColor: "#eb9426"
|
|
167
|
+
/* TODO(ds-review): #eb9426 — requires LinkEntityDialog to support semantic token classNames */
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
defaultId: "all",
|
|
171
|
+
clientFilter: (option, filterId) => {
|
|
172
|
+
if (!filterId || filterId === "all") return true;
|
|
173
|
+
const meta = option.meta ?? {};
|
|
174
|
+
if (filterId === "orphan") return meta.isOrphan === true;
|
|
175
|
+
if (filterId === "open" || filterId === "win" || filterId === "loose") {
|
|
176
|
+
return (meta.stage ?? "").toLowerCase().includes(filterId) || true;
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const searchPage = async (query, page, filterId) => {
|
|
182
|
+
const params = new URLSearchParams({
|
|
183
|
+
page: String(page),
|
|
184
|
+
pageSize: String(pageSize)
|
|
185
|
+
});
|
|
186
|
+
if (query.trim().length > 0) {
|
|
187
|
+
params.set("search", query.trim());
|
|
188
|
+
}
|
|
189
|
+
const status = parseStatusFilter(filterId);
|
|
190
|
+
if (status) {
|
|
191
|
+
params.set("status", status);
|
|
192
|
+
}
|
|
193
|
+
const payload = await readApiResultOrThrow(
|
|
194
|
+
`/api/customers/deals?${params.toString()}`
|
|
195
|
+
);
|
|
196
|
+
const rawItems = Array.isArray(payload.items) ? payload.items : [];
|
|
197
|
+
const exclude = new Set(options.excludeIds ?? []);
|
|
198
|
+
let items = rawItems.map(
|
|
199
|
+
(candidate) => candidate && typeof candidate === "object" ? normalizeDealRecord(candidate) : null
|
|
200
|
+
).filter((entry) => entry !== null && !exclude.has(entry.id));
|
|
201
|
+
if (filterId === "orphan") {
|
|
202
|
+
items = items.filter((item) => item.meta.isOrphan === true);
|
|
203
|
+
}
|
|
204
|
+
const totalPages = typeof payload.totalPages === "number" ? payload.totalPages : 1;
|
|
205
|
+
const total = typeof payload.total === "number" ? payload.total : void 0;
|
|
206
|
+
return { items, totalPages, total };
|
|
207
|
+
};
|
|
208
|
+
const fetchByIds = async (ids) => {
|
|
209
|
+
const uniqueIds = Array.from(new Set(ids.map((value) => value.trim()).filter(Boolean)));
|
|
210
|
+
if (!uniqueIds.length) return [];
|
|
211
|
+
const params = new URLSearchParams({
|
|
212
|
+
ids: uniqueIds.join(","),
|
|
213
|
+
pageSize: String(Math.max(uniqueIds.length, 1))
|
|
214
|
+
});
|
|
215
|
+
try {
|
|
216
|
+
const payload = await readApiResultOrThrow(
|
|
217
|
+
`/api/customers/deals?${params.toString()}`
|
|
218
|
+
);
|
|
219
|
+
const rawItems = Array.isArray(payload.items) ? payload.items : [];
|
|
220
|
+
const byId = /* @__PURE__ */ new Map();
|
|
221
|
+
rawItems.forEach((record) => {
|
|
222
|
+
if (!record || typeof record !== "object") return;
|
|
223
|
+
const option = normalizeDealRecord(record);
|
|
224
|
+
if (option) byId.set(option.id, option);
|
|
225
|
+
});
|
|
226
|
+
return uniqueIds.map((id) => byId.get(id) ?? { id, label: id, subtitle: null });
|
|
227
|
+
} catch {
|
|
228
|
+
return uniqueIds.map((id) => ({ id, label: id, subtitle: null }));
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const renderRow = (option, ctx) => {
|
|
232
|
+
const meta = option.meta ?? {};
|
|
233
|
+
const formattedValue = formatValue(meta.valueAmount ?? null, meta.valueCurrency ?? null);
|
|
234
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
235
|
+
/* @__PURE__ */ jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/80 text-muted-foreground", children: /* @__PURE__ */ jsx(Briefcase, { className: "size-4" }) }),
|
|
236
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
237
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
238
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: option.label }),
|
|
239
|
+
meta.code ? /* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-sm bg-muted px-1.5 py-0.5 text-xs font-semibold uppercase text-muted-foreground", children: meta.code }) : null,
|
|
240
|
+
meta.isOrphan ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg px-2 py-0.5 text-xs font-semibold text-status-warning-text", children: [
|
|
241
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-block size-1.5 rounded-full bg-status-warning-icon" }),
|
|
242
|
+
"no company"
|
|
243
|
+
] }) : null
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground", children: [
|
|
246
|
+
formattedValue ? /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: formattedValue }) : null,
|
|
247
|
+
meta.stage ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
248
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-block size-1 rounded-full bg-muted-foreground" }),
|
|
249
|
+
/* @__PURE__ */ jsx("span", { children: meta.stage })
|
|
250
|
+
] }) : null,
|
|
251
|
+
meta.companyName ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
252
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-block size-1 rounded-full bg-muted-foreground" }),
|
|
253
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: meta.companyName })
|
|
254
|
+
] }) : null,
|
|
255
|
+
meta.updatedAt ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
256
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-block size-1 rounded-full bg-muted-foreground" }),
|
|
257
|
+
/* @__PURE__ */ jsx("span", { children: formatRelative(meta.updatedAt) })
|
|
258
|
+
] }) : null
|
|
259
|
+
] })
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ jsx(
|
|
262
|
+
"span",
|
|
263
|
+
{
|
|
264
|
+
role: "checkbox",
|
|
265
|
+
"aria-checked": ctx.selected,
|
|
266
|
+
"aria-label": `Select ${option.label}`,
|
|
267
|
+
className: cn(
|
|
268
|
+
"inline-flex size-5 shrink-0 items-center justify-center rounded-full border",
|
|
269
|
+
ctx.selected ? "border-foreground bg-foreground text-background" : "border-border bg-background"
|
|
270
|
+
),
|
|
271
|
+
children: ctx.selected ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", className: "size-3", fill: "none", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.5 6.5l2.5 2.5 4.5-5" }) }) : null
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
] });
|
|
275
|
+
};
|
|
276
|
+
const renderPreview = (option, details) => {
|
|
277
|
+
const meta = option.meta ?? {};
|
|
278
|
+
const derived = details ?? {
|
|
279
|
+
id: option.id,
|
|
280
|
+
title: option.label,
|
|
281
|
+
code: meta.code ?? null,
|
|
282
|
+
createdAt: null,
|
|
283
|
+
stage: null,
|
|
284
|
+
value: meta.valueAmount ? { amount: meta.valueAmount, currency: meta.valueCurrency ?? null } : null,
|
|
285
|
+
nextStep: null,
|
|
286
|
+
keyPeople: [],
|
|
287
|
+
anchors: void 0
|
|
288
|
+
};
|
|
289
|
+
const isOrphan = meta.isOrphan || (derived.anchors ? derived.anchors.companies === 0 : false);
|
|
290
|
+
const formattedValue = derived.value ? formatValue(derived.value.amount, derived.value.currency) : null;
|
|
291
|
+
const createdRel = derived.createdAt ? `Created ${formatRelative(derived.createdAt)}` : null;
|
|
292
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3.5 rounded-xl border border-border/70 bg-card p-4", children: [
|
|
293
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
294
|
+
/* @__PURE__ */ jsx("div", { className: "text-base font-bold text-foreground", children: derived.title }),
|
|
295
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
296
|
+
derived.code ? /* @__PURE__ */ jsx("span", { children: derived.code }) : null,
|
|
297
|
+
derived.code && createdRel ? /* @__PURE__ */ jsx("span", { children: "\xB7" }) : null,
|
|
298
|
+
createdRel ? /* @__PURE__ */ jsx("span", { children: createdRel }) : null
|
|
299
|
+
] })
|
|
300
|
+
] }),
|
|
301
|
+
isOrphan ? /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 rounded-md bg-status-warning-bg px-3 py-2.5", children: [
|
|
302
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "mt-0.5 size-3.5 text-status-warning-icon" }),
|
|
303
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
304
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-semibold text-status-warning-text", children: options.orphanWarningTitle }),
|
|
305
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 text-xs text-muted-foreground", children: options.orphanWarningMessage })
|
|
306
|
+
] })
|
|
307
|
+
] }) : null,
|
|
308
|
+
formattedValue ? /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-3", children: [
|
|
309
|
+
/* @__PURE__ */ jsx("div", { className: "text-2xl font-bold text-foreground", children: formattedValue }),
|
|
310
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "potential value" })
|
|
311
|
+
] }) : null,
|
|
312
|
+
derived.stage ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
313
|
+
/* @__PURE__ */ jsx("div", { className: "text-overline font-semibold uppercase tracking-wide text-muted-foreground", children: "Stage" }),
|
|
314
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
315
|
+
/* @__PURE__ */ jsx("span", { className: "inline-block size-2 rounded-full bg-foreground" }),
|
|
316
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-foreground", children: derived.stage })
|
|
317
|
+
] })
|
|
318
|
+
] }) : null,
|
|
319
|
+
derived.nextStep ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
320
|
+
/* @__PURE__ */ jsx("div", { className: "h-px w-full bg-border/70" }),
|
|
321
|
+
/* @__PURE__ */ jsx("div", { className: "text-overline font-semibold uppercase tracking-wide text-muted-foreground", children: "Next step" }),
|
|
322
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
|
|
323
|
+
/* @__PURE__ */ jsx(CalendarDays, { className: "mt-0.5 size-3 text-muted-foreground" }),
|
|
324
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
325
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-xs font-semibold text-foreground", children: derived.nextStep.title }),
|
|
326
|
+
derived.nextStep.assignee ? /* @__PURE__ */ jsxs("div", { className: "mt-0.5 text-xs text-muted-foreground", children: [
|
|
327
|
+
"Assigned: ",
|
|
328
|
+
derived.nextStep.assignee
|
|
329
|
+
] }) : null
|
|
330
|
+
] })
|
|
331
|
+
] })
|
|
332
|
+
] }) : null,
|
|
333
|
+
derived.keyPeople && derived.keyPeople.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
334
|
+
/* @__PURE__ */ jsx("div", { className: "h-px w-full bg-border/70" }),
|
|
335
|
+
/* @__PURE__ */ jsxs("div", { className: "text-overline font-semibold uppercase tracking-wide text-muted-foreground", children: [
|
|
336
|
+
"Key people (",
|
|
337
|
+
derived.keyPeople.length,
|
|
338
|
+
")"
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1.5", children: derived.keyPeople.map((person) => /* @__PURE__ */ jsxs(
|
|
341
|
+
"div",
|
|
342
|
+
{
|
|
343
|
+
className: "flex items-center gap-2 rounded-md bg-muted/60 px-2.5 py-1.5",
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ jsx(Avatar, { label: person.name, variant: "monochrome", size: "sm" }),
|
|
346
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-foreground", children: person.name }),
|
|
347
|
+
person.role ? /* @__PURE__ */ jsx("span", { className: "ml-auto inline-flex items-center rounded-sm border border-border px-1.5 py-0.5 text-xs font-semibold text-muted-foreground", children: person.role }) : null
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
person.id || person.name
|
|
351
|
+
)) })
|
|
352
|
+
] }) : null
|
|
353
|
+
] });
|
|
354
|
+
};
|
|
355
|
+
const computeOrphanWarning = async (option) => {
|
|
356
|
+
const details = await fetchDealDetails(option.id, options.contextEntityId);
|
|
357
|
+
const anchors = details.anchors ?? { companies: 0, people: 0 };
|
|
358
|
+
return anchors.companies + anchors.people < 1 ? options.orphanWarningMessage : null;
|
|
359
|
+
};
|
|
360
|
+
return {
|
|
361
|
+
kind: "deal",
|
|
362
|
+
dialogTitle: options.dialogTitle,
|
|
363
|
+
dialogSubtitle: options.dialogSubtitle,
|
|
364
|
+
sectionLabel: options.sectionLabel ?? "MATCHING DEALS",
|
|
365
|
+
searchPlaceholder: options.searchPlaceholder,
|
|
366
|
+
searchEmptyHint: options.searchEmptyHint,
|
|
367
|
+
selectedEmptyHint: options.selectedEmptyHint,
|
|
368
|
+
confirmButtonLabel: options.confirmButtonLabel,
|
|
369
|
+
defaultAvatarIcon: options.defaultAvatarIcon,
|
|
370
|
+
headerIcon: options.headerIcon ?? /* @__PURE__ */ jsx(Link2, { className: "size-5" }),
|
|
371
|
+
filters,
|
|
372
|
+
renderRow,
|
|
373
|
+
renderPreview,
|
|
374
|
+
fetchDetails: (id) => fetchDealDetails(id, options.contextEntityId),
|
|
375
|
+
searchPage,
|
|
376
|
+
fetchByIds,
|
|
377
|
+
computeOrphanWarning,
|
|
378
|
+
addNew: options.addNew
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
export {
|
|
382
|
+
createDealLinkAdapter
|
|
383
|
+
};
|
|
384
|
+
//# sourceMappingURL=dealAdapter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/modules/customers/components/linking/adapters/dealAdapter.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { AlertTriangle, Briefcase, CalendarDays, Link2 } from 'lucide-react'\nimport { readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\nimport { Avatar } from '@open-mercato/ui/primitives/avatar'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport type {\n LinkEntityAdapter,\n LinkEntityOption,\n LinkEntityRowContext,\n LinkEntitySearchPage,\n} from '../LinkEntityDialog'\n\ntype DealDetails = {\n id: string\n title: string\n code?: string | null\n createdAt?: string | null\n stage?: string | null\n pipeline?: { stages: Array<{ id: string; label: string }>; currentStageId?: string | null }\n value?: { amount: string; currency: string | null } | null\n nextStep?: { title: string; dueAt?: string | null; assignee?: string | null } | null\n keyPeople?: Array<{ id: string; name: string; role?: string | null }>\n anchors?: { companies: number; people: number }\n orphanWarningMessage?: string | null\n}\n\ntype DealAdapterOptions = {\n dialogTitle: string\n dialogSubtitle?: string\n sectionLabel?: string\n searchPlaceholder: string\n searchEmptyHint: string\n selectedEmptyHint: string\n confirmButtonLabel: string\n orphanWarningTitle: string\n orphanWarningMessage: string\n excludeIds?: string[]\n defaultAvatarIcon?: React.ReactNode\n pageSize?: number\n addNew?: LinkEntityAdapter<DealDetails>['addNew']\n contextEntityId?: string\n headerIcon?: React.ReactNode\n}\n\nconst DEFAULT_PAGE_SIZE = 20\n\ntype DealAssociationRecord = {\n id: string\n label: string\n subtitle: string | null\n}\n\nfunction parseStatusFilter(filterId?: string): string | null {\n if (!filterId || filterId === 'all' || filterId === 'orphan') return null\n return filterId\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null\n}\n\nfunction readTrimmedString(record: Record<string, unknown> | null, ...keys: string[]): string | null {\n if (!record) return null\n for (const key of keys) {\n const value = record[key]\n if (typeof value === 'string' && value.trim().length) {\n return value.trim()\n }\n }\n return null\n}\n\nfunction readDecimalValue(record: Record<string, unknown> | null, ...keys: string[]): string | null {\n if (!record) return null\n for (const key of keys) {\n const value = record[key]\n if (typeof value === 'string' && value.trim().length) {\n return value.trim()\n }\n if (typeof value === 'number' && Number.isFinite(value)) {\n return String(value)\n }\n }\n return null\n}\n\nfunction normalizeAssociationRecord(entry: unknown): DealAssociationRecord | null {\n const record = asRecord(entry)\n const id = readTrimmedString(record, 'id')\n if (!id) return null\n return {\n id,\n label:\n readTrimmedString(record, 'label', 'displayName', 'display_name', 'name', 'title') ?? id,\n subtitle: readTrimmedString(record, 'subtitle', 'role', 'roleLabel'),\n }\n}\n\nfunction normalizeDealRecord(record: Record<string, unknown>): LinkEntityOption | null {\n const id = typeof record.id === 'string' ? record.id : null\n if (!id) return null\n const title =\n typeof record.title === 'string' && record.title.trim().length\n ? record.title.trim()\n : typeof record.name === 'string' && record.name.trim().length\n ? record.name.trim()\n : null\n const label = title ?? id\n const code =\n typeof record.code === 'string'\n ? record.code\n : typeof record.reference === 'string'\n ? record.reference\n : null\n const valueAmount =\n typeof record.valueAmount === 'string'\n ? record.valueAmount\n : typeof record.value_amount === 'string'\n ? record.value_amount\n : typeof record.value === 'number'\n ? String(record.value)\n : null\n const valueCurrency =\n typeof record.valueCurrency === 'string'\n ? record.valueCurrency\n : typeof record.value_currency === 'string'\n ? record.value_currency\n : null\n const stage =\n typeof record.pipelineStage === 'string'\n ? record.pipelineStage\n : typeof record.pipeline_stage === 'string'\n ? record.pipeline_stage\n : typeof record.status === 'string'\n ? record.status\n : null\n const updatedAt =\n typeof record.updatedAt === 'string'\n ? record.updatedAt\n : typeof record.updated_at === 'string'\n ? record.updated_at\n : typeof record.createdAt === 'string'\n ? record.createdAt\n : typeof record.created_at === 'string'\n ? record.created_at\n : null\n const anchorCompanies =\n typeof (record.companies as { length?: number })?.length === 'number'\n ? (record.companies as unknown[]).length\n : typeof record.companyCount === 'number'\n ? record.companyCount\n : null\n const isOrphan = anchorCompanies !== null ? anchorCompanies === 0 : undefined\n const companyName =\n typeof record.companyName === 'string'\n ? record.companyName\n : Array.isArray(record.companies) && record.companies.length > 0\n ? normalizeAssociationRecord(record.companies[0])?.label ?? null\n : null\n return {\n id,\n label,\n subtitle: null,\n meta: {\n code,\n valueAmount,\n valueCurrency,\n stage,\n updatedAt,\n isOrphan,\n companyName: typeof companyName === 'string' ? companyName : null,\n },\n }\n}\n\nasync function fetchDealDetails(id: string, contextEntityId?: string): Promise<DealDetails> {\n try {\n const payload = await readApiResultOrThrow<Record<string, unknown>>(\n `/api/customers/deals/${encodeURIComponent(id)}`,\n )\n const rootRecord = asRecord(payload)\n const dealRecord = asRecord(rootRecord?.deal) ?? rootRecord\n const title =\n readTrimmedString(dealRecord, 'title', 'name') ?? id\n const code = readTrimmedString(dealRecord, 'code', 'reference')\n const createdAt = readTrimmedString(dealRecord, 'createdAt', 'created_at')\n const valueAmount = readDecimalValue(dealRecord, 'valueAmount', 'value_amount', 'value')\n const valueCurrency = readTrimmedString(\n dealRecord,\n 'valueCurrency',\n 'value_currency',\n 'currency',\n )\n const stage = readTrimmedString(dealRecord, 'pipelineStage', 'pipeline_stage', 'status')\n const companies = Array.isArray(rootRecord?.companies)\n ? rootRecord.companies\n .map((entry) => normalizeAssociationRecord(entry))\n .filter((entry): entry is DealAssociationRecord => entry !== null)\n : []\n const people = Array.isArray(rootRecord?.people)\n ? rootRecord.people\n .map((entry) => normalizeAssociationRecord(entry))\n .filter((entry): entry is DealAssociationRecord => entry !== null)\n : []\n const companiesCount = companies.filter((entry) => {\n return !contextEntityId || entry.id !== contextEntityId\n }).length\n const peopleCount = people.filter((entry) => {\n return !contextEntityId || entry.id !== contextEntityId\n }).length\n const keyPeople = people.slice(0, 3).map((entry) => ({\n id: entry.id,\n name: entry.label,\n role: entry.subtitle,\n }))\n return {\n id,\n title,\n code,\n createdAt,\n stage,\n value: valueAmount ? { amount: valueAmount, currency: valueCurrency ?? null } : null,\n nextStep: null,\n keyPeople,\n anchors: { companies: companiesCount, people: peopleCount },\n }\n } catch {\n return {\n id,\n title: id,\n code: null,\n createdAt: null,\n stage: null,\n value: null,\n nextStep: null,\n keyPeople: [],\n anchors: { companies: 0, people: 0 },\n }\n }\n}\n\nfunction formatValue(amount: string | null, currency: string | null): string | null {\n if (!amount) return null\n const parsed = parseFloat(amount)\n if (!Number.isFinite(parsed)) return amount\n const formatted = parsed.toLocaleString(undefined, { maximumFractionDigits: 2 })\n return currency ? `${formatted} ${currency}` : formatted\n}\n\nfunction formatRelative(dateString: string | null): string {\n if (!dateString) return ''\n try {\n const date = new Date(dateString)\n const now = Date.now()\n const diffMs = now - date.getTime()\n const diffDays = Math.floor(diffMs / 86_400_000)\n if (diffDays <= 0) return 'today'\n if (diffDays === 1) return 'yesterday'\n if (diffDays < 30) return `${diffDays} days ago`\n if (diffDays < 365) return `${Math.floor(diffDays / 30)} months ago`\n return `${Math.floor(diffDays / 365)} years ago`\n } catch {\n return ''\n }\n}\n\nexport function createDealLinkAdapter(options: DealAdapterOptions): LinkEntityAdapter<DealDetails> {\n const pageSize = options.pageSize ?? DEFAULT_PAGE_SIZE\n\n const filters = {\n options: [\n { id: 'all', label: 'All' },\n { id: 'open', label: 'Open' },\n { id: 'win', label: 'Won' },\n { id: 'loose', label: 'Lost' },\n { id: 'orphan', label: 'Orphan', dotColor: '#eb9426' /* TODO(ds-review): #eb9426 \u2014 requires LinkEntityDialog to support semantic token classNames */ },\n ],\n defaultId: 'all',\n clientFilter: (option: LinkEntityOption, filterId: string) => {\n if (!filterId || filterId === 'all') return true\n const meta = (option.meta ?? {}) as { isOrphan?: boolean; stage?: string | null }\n if (filterId === 'orphan') return meta.isOrphan === true\n // Server-side status filter already applied; this keeps all rows if server honored the filter.\n // Fallback client check on stage in case server returns mixed statuses.\n if (filterId === 'open' || filterId === 'win' || filterId === 'loose') {\n return (meta.stage ?? '').toLowerCase().includes(filterId) || true\n }\n return true\n },\n }\n\n const searchPage = async (\n query: string,\n page: number,\n filterId?: string,\n ): Promise<LinkEntitySearchPage> => {\n const params = new URLSearchParams({\n page: String(page),\n pageSize: String(pageSize),\n })\n if (query.trim().length > 0) {\n params.set('search', query.trim())\n }\n const status = parseStatusFilter(filterId)\n if (status) {\n params.set('status', status)\n }\n const payload = await readApiResultOrThrow<Record<string, unknown>>(\n `/api/customers/deals?${params.toString()}`,\n )\n const rawItems = Array.isArray(payload.items) ? payload.items : []\n const exclude = new Set(options.excludeIds ?? [])\n let items = rawItems\n .map((candidate) =>\n candidate && typeof candidate === 'object'\n ? normalizeDealRecord(candidate as Record<string, unknown>)\n : null,\n )\n .filter((entry): entry is LinkEntityOption => entry !== null && !exclude.has(entry.id))\n if (filterId === 'orphan') {\n items = items.filter((item) => (item.meta as { isOrphan?: boolean }).isOrphan === true)\n }\n const totalPages = typeof payload.totalPages === 'number' ? payload.totalPages : 1\n const total = typeof payload.total === 'number' ? payload.total : undefined\n return { items, totalPages, total }\n }\n\n const fetchByIds = async (ids: string[]): Promise<LinkEntityOption[]> => {\n const uniqueIds = Array.from(new Set(ids.map((value) => value.trim()).filter(Boolean)))\n if (!uniqueIds.length) return []\n const params = new URLSearchParams({\n ids: uniqueIds.join(','),\n pageSize: String(Math.max(uniqueIds.length, 1)),\n })\n try {\n const payload = await readApiResultOrThrow<{ items?: Record<string, unknown>[] }>(\n `/api/customers/deals?${params.toString()}`,\n )\n const rawItems = Array.isArray(payload.items) ? payload.items : []\n const byId = new Map<string, LinkEntityOption>()\n rawItems.forEach((record) => {\n if (!record || typeof record !== 'object') return\n const option = normalizeDealRecord(record as Record<string, unknown>)\n if (option) byId.set(option.id, option)\n })\n return uniqueIds.map((id) => byId.get(id) ?? { id, label: id, subtitle: null })\n } catch {\n return uniqueIds.map((id) => ({ id, label: id, subtitle: null }))\n }\n }\n\n const renderRow = (option: LinkEntityOption, ctx: LinkEntityRowContext): React.ReactNode => {\n const meta = (option.meta ?? {}) as {\n code?: string | null\n valueAmount?: string | null\n valueCurrency?: string | null\n stage?: string | null\n updatedAt?: string | null\n isOrphan?: boolean\n companyName?: string | null\n }\n const formattedValue = formatValue(meta.valueAmount ?? null, meta.valueCurrency ?? null)\n return (\n <>\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/80 text-muted-foreground\">\n <Briefcase className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5\">\n <span className=\"truncate text-sm font-semibold text-foreground\">\n {option.label}\n </span>\n {meta.code ? (\n <span className=\"inline-flex items-center rounded-sm bg-muted px-1.5 py-0.5 text-xs font-semibold uppercase text-muted-foreground\">\n {meta.code}\n </span>\n ) : null}\n {meta.isOrphan ? (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-status-warning-bg px-2 py-0.5 text-xs font-semibold text-status-warning-text\">\n <span aria-hidden=\"true\" className=\"inline-block size-1.5 rounded-full bg-status-warning-icon\" />\n no company\n </span>\n ) : null}\n </div>\n <div className=\"mt-0.5 flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground\">\n {formattedValue ? (\n <span className=\"font-semibold text-foreground\">{formattedValue}</span>\n ) : null}\n {meta.stage ? (\n <>\n <span aria-hidden=\"true\" className=\"inline-block size-1 rounded-full bg-muted-foreground\" />\n <span>{meta.stage}</span>\n </>\n ) : null}\n {meta.companyName ? (\n <>\n <span aria-hidden=\"true\" className=\"inline-block size-1 rounded-full bg-muted-foreground\" />\n <span className=\"truncate\">{meta.companyName}</span>\n </>\n ) : null}\n {meta.updatedAt ? (\n <>\n <span aria-hidden=\"true\" className=\"inline-block size-1 rounded-full bg-muted-foreground\" />\n <span>{formatRelative(meta.updatedAt)}</span>\n </>\n ) : null}\n </div>\n </div>\n <span\n role=\"checkbox\"\n aria-checked={ctx.selected}\n aria-label={`Select ${option.label}`}\n className={cn(\n 'inline-flex size-5 shrink-0 items-center justify-center rounded-full border',\n ctx.selected\n ? 'border-foreground bg-foreground text-background'\n : 'border-border bg-background',\n )}\n >\n {ctx.selected ? (\n <svg viewBox=\"0 0 12 12\" className=\"size-3\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M2.5 6.5l2.5 2.5 4.5-5\" />\n </svg>\n ) : null}\n </span>\n </>\n )\n }\n\n const renderPreview = (\n option: LinkEntityOption,\n details?: DealDetails,\n ): React.ReactNode => {\n const meta = (option.meta ?? {}) as {\n code?: string | null\n valueAmount?: string | null\n valueCurrency?: string | null\n isOrphan?: boolean\n }\n const derived = details ?? {\n id: option.id,\n title: option.label,\n code: meta.code ?? null,\n createdAt: null,\n stage: null,\n value: meta.valueAmount ? { amount: meta.valueAmount, currency: meta.valueCurrency ?? null } : null,\n nextStep: null,\n keyPeople: [],\n anchors: undefined,\n }\n const isOrphan = meta.isOrphan || (derived.anchors ? derived.anchors.companies === 0 : false)\n const formattedValue = derived.value ? formatValue(derived.value.amount, derived.value.currency) : null\n const createdRel = derived.createdAt ? `Created ${formatRelative(derived.createdAt)}` : null\n return (\n <div className=\"flex flex-col gap-3.5 rounded-xl border border-border/70 bg-card p-4\">\n <div>\n <div className=\"text-base font-bold text-foreground\">{derived.title}</div>\n <div className=\"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground\">\n {derived.code ? <span>{derived.code}</span> : null}\n {derived.code && createdRel ? <span>\u00B7</span> : null}\n {createdRel ? <span>{createdRel}</span> : null}\n </div>\n </div>\n\n {isOrphan ? (\n <div className=\"flex items-start gap-2 rounded-md bg-status-warning-bg px-3 py-2.5\">\n <AlertTriangle className=\"mt-0.5 size-3.5 text-status-warning-icon\" />\n <div className=\"min-w-0\">\n <div className=\"text-xs font-semibold text-status-warning-text\">\n {options.orphanWarningTitle}\n </div>\n <div className=\"mt-0.5 text-xs text-muted-foreground\">\n {options.orphanWarningMessage}\n </div>\n </div>\n </div>\n ) : null}\n\n {formattedValue ? (\n <div className=\"flex items-baseline gap-3\">\n <div className=\"text-2xl font-bold text-foreground\">{formattedValue}</div>\n <div className=\"text-xs text-muted-foreground\">potential value</div>\n </div>\n ) : null}\n\n {derived.stage ? (\n <>\n <div className=\"text-overline font-semibold uppercase tracking-wide text-muted-foreground\">\n Stage\n </div>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"inline-block size-2 rounded-full bg-foreground\" />\n <span className=\"text-xs font-semibold text-foreground\">{derived.stage}</span>\n </div>\n </>\n ) : null}\n\n {derived.nextStep ? (\n <>\n <div className=\"h-px w-full bg-border/70\" />\n <div className=\"text-overline font-semibold uppercase tracking-wide text-muted-foreground\">\n Next step\n </div>\n <div className=\"flex items-start gap-2\">\n <CalendarDays className=\"mt-0.5 size-3 text-muted-foreground\" />\n <div className=\"min-w-0\">\n <div className=\"truncate text-xs font-semibold text-foreground\">\n {derived.nextStep.title}\n </div>\n {derived.nextStep.assignee ? (\n <div className=\"mt-0.5 text-xs text-muted-foreground\">\n Assigned: {derived.nextStep.assignee}\n </div>\n ) : null}\n </div>\n </div>\n </>\n ) : null}\n\n {derived.keyPeople && derived.keyPeople.length > 0 ? (\n <>\n <div className=\"h-px w-full bg-border/70\" />\n <div className=\"text-overline font-semibold uppercase tracking-wide text-muted-foreground\">\n Key people ({derived.keyPeople.length})\n </div>\n <div className=\"flex flex-col gap-1.5\">\n {derived.keyPeople.map((person) => (\n <div\n key={person.id || person.name}\n className=\"flex items-center gap-2 rounded-md bg-muted/60 px-2.5 py-1.5\"\n >\n <Avatar label={person.name} variant=\"monochrome\" size=\"sm\" />\n <span className=\"text-xs font-semibold text-foreground\">{person.name}</span>\n {person.role ? (\n <span className=\"ml-auto inline-flex items-center rounded-sm border border-border px-1.5 py-0.5 text-xs font-semibold text-muted-foreground\">\n {person.role}\n </span>\n ) : null}\n </div>\n ))}\n </div>\n </>\n ) : null}\n </div>\n )\n }\n\n const computeOrphanWarning = async (option: LinkEntityOption): Promise<string | null> => {\n const details = await fetchDealDetails(option.id, options.contextEntityId)\n const anchors = details.anchors ?? { companies: 0, people: 0 }\n return anchors.companies + anchors.people < 1 ? options.orphanWarningMessage : null\n }\n\n return {\n kind: 'deal',\n dialogTitle: options.dialogTitle,\n dialogSubtitle: options.dialogSubtitle,\n sectionLabel: options.sectionLabel ?? 'MATCHING DEALS',\n searchPlaceholder: options.searchPlaceholder,\n searchEmptyHint: options.searchEmptyHint,\n selectedEmptyHint: options.selectedEmptyHint,\n confirmButtonLabel: options.confirmButtonLabel,\n defaultAvatarIcon: options.defaultAvatarIcon,\n headerIcon: options.headerIcon ?? <Link2 className=\"size-5\" />,\n filters,\n renderRow,\n renderPreview,\n fetchDetails: (id) => fetchDealDetails(id, options.contextEntityId),\n searchPage,\n fetchByIds,\n computeOrphanWarning,\n addNew: options.addNew,\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAiXU,SAwBI,UAxBJ,KAaI,YAbJ;AA9WV,SAAS,eAAe,WAAW,cAAc,aAAa;AAC9D,SAAS,4BAA4B;AACrC,SAAS,cAAc;AACvB,SAAS,UAAU;AAwCnB,MAAM,oBAAoB;AAQ1B,SAAS,kBAAkB,UAAkC;AAC3D,MAAI,CAAC,YAAY,aAAa,SAAS,aAAa,SAAU,QAAO;AACrE,SAAO;AACT;AAEA,SAAS,SAAS,OAAgD;AAChE,SAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAC5D,QACD;AACN;AAEA,SAAS,kBAAkB,WAA2C,MAA+B;AACnG,MAAI,CAAC,OAAQ,QAAO;AACpB,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,OAAO,GAAG;AACxB,QAAI,OAAO,UAAU,YAAY,MAAM,KAAK,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