@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,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/MobilePersonDetail.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { Button } from '@open-mercato/ui/primitives/button'\n\nexport type MobilePersonZone = 'details' | 'activity'\n\nexport type MobilePersonDetailProps = {\n zone1: React.ReactNode\n zone2: React.ReactNode\n defaultZone?: MobilePersonZone\n /**\n * Controls whether zone state is synced to the URL `?zone=` query param.\n * Defaults to true on the page route so deep links round-trip.\n */\n syncToUrl?: boolean\n}\n\nconst ZONES: Array<{ id: MobilePersonZone; labelKey: string; fallback: string }> = [\n { id: 'details', labelKey: 'customers.people.mobile.zoneSwitcher.details', fallback: 'Details' },\n { id: 'activity', labelKey: 'customers.people.mobile.zoneSwitcher.activity', fallback: 'Activity' },\n]\n\nexport function MobilePersonDetail({\n zone1,\n zone2,\n defaultZone = 'details',\n syncToUrl = true,\n}: MobilePersonDetailProps) {\n const t = useT()\n const router = useRouter()\n const searchParams = useSearchParams()\n\n const initialZone = React.useMemo<MobilePersonZone>(() => {\n if (!syncToUrl) return defaultZone\n const raw = searchParams?.get('zone')\n if (raw === 'activity' || raw === 'details') return raw\n return defaultZone\n // Intentionally compute only from the initial searchParams snapshot; external URL updates\n // (browser back, manual edit) are acceptable to be out of sync on mobile \u2014 local clicks\n // own the zone state thereafter.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const [zone, setZone] = React.useState<MobilePersonZone>(initialZone)\n const lastWrittenZoneRef = React.useRef<MobilePersonZone | null>(null)\n\n const handleZoneChange = React.useCallback(\n (next: MobilePersonZone) => {\n setZone(next)\n lastWrittenZoneRef.current = next\n if (!syncToUrl) return\n const params = new URLSearchParams(searchParams?.toString() ?? '')\n if (next === defaultZone) {\n params.delete('zone')\n } else {\n params.set('zone', next)\n }\n const query = params.toString()\n router.replace(query.length ? `?${query}` : '?', { scroll: false })\n },\n [defaultZone, router, searchParams, syncToUrl],\n )\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n const currentIndex = ZONES.findIndex((entry) => entry.id === zone)\n if (currentIndex < 0) return\n const offset = event.key === 'ArrowRight' ? 1 : -1\n const nextIndex = (currentIndex + offset + ZONES.length) % ZONES.length\n handleZoneChange(ZONES[nextIndex].id)\n },\n [handleZoneChange, zone],\n )\n\n return (\n <div className=\"space-y-4\">\n <div\n role=\"tablist\"\n aria-label={t(\n 'customers.people.mobile.zoneSwitcher.ariaLabel',\n 'Zone selector',\n )}\n className=\"grid grid-cols-2 gap-1 rounded-lg border border-border/70 bg-muted/20 p-1\"\n onKeyDown={handleKeyDown}\n >\n {ZONES.map((entry) => {\n const isActive = zone === entry.id\n return (\n <Button\n key={entry.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`mobile-person-zone-${entry.id}`}\n variant={isActive ? 'default' : 'ghost'}\n className={cn(\n 'h-11 rounded-lg text-sm font-semibold',\n isActive ? '' : 'text-muted-foreground',\n )}\n onClick={() => handleZoneChange(entry.id)}\n >\n {t(entry.labelKey, entry.fallback)}\n </Button>\n )\n })}\n </div>\n <div\n id={`mobile-person-zone-${zone}`}\n role=\"tabpanel\"\n aria-labelledby={`mobile-person-zone-${zone}-tab`}\n >\n {zone === 'details' ? zone1 : zone2}\n </div>\n </div>\n )\n}\n\nexport default MobilePersonDetail\n"],
|
|
5
|
+
"mappings": ";AAiFI,SAaQ,KAbR;AA/EJ,YAAY,WAAW;AACvB,SAAS,WAAW,uBAAuB;AAC3C,SAAS,YAAY;AACrB,SAAS,UAAU;AACnB,SAAS,cAAc;AAevB,MAAM,QAA6E;AAAA,EACjF,EAAE,IAAI,WAAW,UAAU,gDAAgD,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,IAAI;AAChD,YAAM,aAAa,eAAe,SAAS,MAAM,UAAU,MAAM;AACjE,uBAAiB,MAAM,SAAS,EAAE,EAAE;AAAA,IACtC;AAAA,IACA,CAAC,kBAAkB,IAAI;AAAA,EACzB;AAEA,SACE,qBAAC,SAAI,WAAU,aACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAY;AAAA,UACV;AAAA,UACA;AAAA,QACF;AAAA,QACA,WAAU;AAAA,QACV,WAAW;AAAA,QAEV,gBAAM,IAAI,CAAC,UAAU;AACpB,gBAAM,WAAW,SAAS,MAAM;AAChC,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAK;AAAA,cACL,MAAK;AAAA,cACL,iBAAe;AAAA,cACf,iBAAe,sBAAsB,MAAM,EAAE;AAAA,cAC7C,SAAS,WAAW,YAAY;AAAA,cAChC,WAAW;AAAA,gBACT;AAAA,gBACA,WAAW,KAAK;AAAA,cAClB;AAAA,cACA,SAAS,MAAM,iBAAiB,MAAM,EAAE;AAAA,cAEvC,YAAE,MAAM,UAAU,MAAM,QAAQ;AAAA;AAAA,YAZ5B,MAAM;AAAA,UAab;AAAA,QAEJ,CAAC;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,IAAI,sBAAsB,IAAI;AAAA,QAC9B,MAAK;AAAA,QACL,mBAAiB,sBAAsB,IAAI;AAAA,QAE1C,mBAAS,YAAY,QAAQ;AAAA;AAAA,IAChC;AAAA,KACF;AAEJ;AAEA,IAAO,6BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { CalendarClock, Phone, FileText, EyeOff } from "lucide-react";
|
|
5
|
+
import { cn } from "@open-mercato/shared/lib/utils";
|
|
6
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
7
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
8
|
+
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@open-mercato/ui/primitives/tooltip";
|
|
10
|
+
function NextStepCard({ nextInteractionAt, nextInteractionName, onHide }) {
|
|
11
|
+
const t = useT();
|
|
12
|
+
const daysUntil = React.useMemo(() => {
|
|
13
|
+
if (!nextInteractionAt) return null;
|
|
14
|
+
const diff = new Date(nextInteractionAt).getTime() - Date.now();
|
|
15
|
+
return Math.ceil(diff / 864e5);
|
|
16
|
+
}, [nextInteractionAt]);
|
|
17
|
+
if (!nextInteractionAt) {
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-5", children: [
|
|
19
|
+
/* @__PURE__ */ jsxs("h3", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
20
|
+
/* @__PURE__ */ jsx(CalendarClock, { className: "size-4" }),
|
|
21
|
+
t("customers.companies.detail.nextStep.title", "Next Step")
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: t("customers.companies.detail.nextStep.none", "No upcoming interactions scheduled") })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
const isOverdue = daysUntil !== null && daysUntil < 0;
|
|
27
|
+
const countdownText = daysUntil !== null ? daysUntil === 0 ? t("customers.companies.detail.nextStep.today", "today") : daysUntil > 0 ? t("customers.companies.detail.nextStep.in", "in {days} days", { days: daysUntil }) : t("customers.companies.detail.nextStep.overdue", "{days} days overdue", { days: Math.abs(daysUntil) }) : null;
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: "group relative rounded-lg border bg-card p-5", children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
30
|
+
/* @__PURE__ */ jsxs("h3", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
31
|
+
/* @__PURE__ */ jsx(CalendarClock, { className: "size-4" }),
|
|
32
|
+
t("customers.companies.detail.nextStep.title", "Next Step")
|
|
33
|
+
] }),
|
|
34
|
+
onHide && /* @__PURE__ */ jsx(
|
|
35
|
+
IconButton,
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
variant: "ghost",
|
|
39
|
+
size: "xs",
|
|
40
|
+
onClick: onHide,
|
|
41
|
+
className: "opacity-0 transition-opacity group-hover:opacity-60",
|
|
42
|
+
"aria-label": t("customers.companies.dashboard.hideTile", "Hide tile"),
|
|
43
|
+
children: /* @__PURE__ */ jsx(EyeOff, { className: "size-3.5" })
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3", children: [
|
|
48
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-foreground", children: nextInteractionName || t("customers.companies.detail.nextStep.untitled", "Scheduled interaction") }),
|
|
49
|
+
countdownText && /* @__PURE__ */ jsx("p", { className: cn("mt-1 text-sm", isOverdue ? "font-medium text-destructive" : "text-muted-foreground"), children: countdownText })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
52
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "h-7 text-xs", disabled: true, children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Phone, { className: "mr-1 size-3" }),
|
|
55
|
+
t("customers.companies.detail.nextStep.call", "Call")
|
|
56
|
+
] }) }),
|
|
57
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: t("customers.ai.comingSoon", "Coming soon") })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
60
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "h-7 text-xs", disabled: true, children: [
|
|
61
|
+
/* @__PURE__ */ jsx(FileText, { className: "mr-1 size-3" }),
|
|
62
|
+
t("customers.companies.detail.nextStep.proposal", "Proposal")
|
|
63
|
+
] }) }),
|
|
64
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: t("customers.ai.comingSoon", "Coming soon") })
|
|
65
|
+
] })
|
|
66
|
+
] })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
NextStepCard
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=NextStepCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/NextStepCard.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { CalendarClock, Phone, FileText, EyeOff } from 'lucide-react'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@open-mercato/ui/primitives/tooltip'\n\ntype NextStepCardProps = {\n nextInteractionAt?: string | null\n nextInteractionName?: string | null\n onHide?: () => void\n}\n\nexport function NextStepCard({ nextInteractionAt, nextInteractionName, onHide }: NextStepCardProps) {\n const t = useT()\n\n const daysUntil = React.useMemo(() => {\n if (!nextInteractionAt) return null\n const diff = new Date(nextInteractionAt).getTime() - Date.now()\n return Math.ceil(diff / 86_400_000)\n }, [nextInteractionAt])\n\n if (!nextInteractionAt) {\n return (\n <div className=\"rounded-lg border bg-card p-5\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-foreground\">\n <CalendarClock className=\"size-4\" />\n {t('customers.companies.detail.nextStep.title', 'Next Step')}\n </h3>\n <p className=\"mt-3 text-sm text-muted-foreground\">\n {t('customers.companies.detail.nextStep.none', 'No upcoming interactions scheduled')}\n </p>\n </div>\n )\n }\n\n const isOverdue = daysUntil !== null && daysUntil < 0\n const countdownText = daysUntil !== null\n ? daysUntil === 0\n ? t('customers.companies.detail.nextStep.today', 'today')\n : daysUntil > 0\n ? t('customers.companies.detail.nextStep.in', 'in {days} days', { days: daysUntil })\n : t('customers.companies.detail.nextStep.overdue', '{days} days overdue', { days: Math.abs(daysUntil) })\n : null\n\n return (\n <div className=\"group relative rounded-lg border bg-card p-5\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-foreground\">\n <CalendarClock className=\"size-4\" />\n {t('customers.companies.detail.nextStep.title', 'Next Step')}\n </h3>\n {onHide && (\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n onClick={onHide}\n className=\"opacity-0 transition-opacity group-hover:opacity-60\"\n aria-label={t('customers.companies.dashboard.hideTile', 'Hide tile')}\n >\n <EyeOff className=\"size-3.5\" />\n </IconButton>\n )}\n </div>\n\n <div className=\"mt-3\">\n <p className=\"font-semibold text-foreground\">\n {nextInteractionName || t('customers.companies.detail.nextStep.untitled', 'Scheduled interaction')}\n </p>\n {countdownText && (\n <p className={cn('mt-1 text-sm', isOverdue ? 'font-medium text-destructive' : 'text-muted-foreground')}>\n {countdownText}\n </p>\n )}\n </div>\n\n {/* Quick action buttons (disabled stubs) */}\n <div className=\"mt-3 flex items-center gap-2\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-7 text-xs\" disabled>\n <Phone className=\"mr-1 size-3\" />\n {t('customers.companies.detail.nextStep.call', 'Call')}\n </Button>\n </TooltipTrigger>\n <TooltipContent>{t('customers.ai.comingSoon', 'Coming soon')}</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-7 text-xs\" disabled>\n <FileText className=\"mr-1 size-3\" />\n {t('customers.companies.detail.nextStep.proposal', 'Proposal')}\n </Button>\n </TooltipTrigger>\n <TooltipContent>{t('customers.ai.comingSoon', 'Coming soon')}</TooltipContent>\n </Tooltip>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA4BQ,SACE,KADF;AA1BR,YAAY,WAAW;AACvB,SAAS,eAAe,OAAO,UAAU,cAAc;AACvD,SAAS,UAAU;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,SAAS,gBAAgB,sBAAsB;AAQjD,SAAS,aAAa,EAAE,mBAAmB,qBAAqB,OAAO,GAAsB;AAClG,QAAM,IAAI,KAAK;AAEf,QAAM,YAAY,MAAM,QAAQ,MAAM;AACpC,QAAI,CAAC,kBAAmB,QAAO;AAC/B,UAAM,OAAO,IAAI,KAAK,iBAAiB,EAAE,QAAQ,IAAI,KAAK,IAAI;AAC9D,WAAO,KAAK,KAAK,OAAO,KAAU;AAAA,EACpC,GAAG,CAAC,iBAAiB,CAAC;AAEtB,MAAI,CAAC,mBAAmB;AACtB,WACE,qBAAC,SAAI,WAAU,iCACb;AAAA,2BAAC,QAAG,WAAU,iEACZ;AAAA,4BAAC,iBAAc,WAAU,UAAS;AAAA,QACjC,EAAE,6CAA6C,WAAW;AAAA,SAC7D;AAAA,MACA,oBAAC,OAAE,WAAU,sCACV,YAAE,4CAA4C,oCAAoC,GACrF;AAAA,OACF;AAAA,EAEJ;AAEA,QAAM,YAAY,cAAc,QAAQ,YAAY;AACpD,QAAM,gBAAgB,cAAc,OAChC,cAAc,IACZ,EAAE,6CAA6C,OAAO,IACtD,YAAY,IACV,EAAE,0CAA0C,kBAAkB,EAAE,MAAM,UAAU,CAAC,IACjF,EAAE,+CAA+C,uBAAuB,EAAE,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC,IACzG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
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { Mail, Phone, Star, MoreHorizontal, ArrowUpRight, Unlink } from "lucide-react";
|
|
6
|
+
import { cn } from "@open-mercato/shared/lib/utils";
|
|
7
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
8
|
+
import { Badge } from "@open-mercato/ui/primitives/badge";
|
|
9
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
10
|
+
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
11
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@open-mercato/ui/primitives/popover";
|
|
12
|
+
import { formatDate, formatFallbackLabel, getInitials } from "./utils.js";
|
|
13
|
+
const sourceColorMap = {
|
|
14
|
+
linkedin: "border-status-info-icon text-status-info-icon",
|
|
15
|
+
email: "border-status-success-icon text-status-success-icon",
|
|
16
|
+
web_form: "border-status-info-icon text-status-info-icon",
|
|
17
|
+
"web form": "border-status-info-icon text-status-info-icon",
|
|
18
|
+
referral: "border-status-warning-icon text-status-warning-icon",
|
|
19
|
+
customer_referral: "border-status-warning-icon text-status-warning-icon",
|
|
20
|
+
"customer referral": "border-status-warning-icon text-status-warning-icon",
|
|
21
|
+
partner_referral: "border-status-warning-icon text-status-warning-icon",
|
|
22
|
+
"partner referral": "border-status-warning-icon text-status-warning-icon",
|
|
23
|
+
event: "border-status-info-icon text-status-info-icon",
|
|
24
|
+
"conference/event": "border-status-info-icon text-status-info-icon",
|
|
25
|
+
cold_outreach: "border-status-neutral-icon text-status-neutral-icon",
|
|
26
|
+
"cold outreach": "border-status-neutral-icon text-status-neutral-icon",
|
|
27
|
+
facebook: "border-status-info-icon text-status-info-icon",
|
|
28
|
+
typeform: "border-status-info-icon text-status-info-icon",
|
|
29
|
+
other: "border-status-neutral-icon text-status-neutral-icon"
|
|
30
|
+
};
|
|
31
|
+
const temperatureConfig = {
|
|
32
|
+
hot: { filled: 5, dotClassName: "bg-status-error-icon", labelKey: "customers.temperature.hot", fallback: "Hot Client" },
|
|
33
|
+
warm: { filled: 4, dotClassName: "bg-status-warning-icon", labelKey: "customers.temperature.warm", fallback: "High Interest" },
|
|
34
|
+
high: { filled: 4, dotClassName: "bg-status-warning-icon", labelKey: "customers.temperature.high", fallback: "High Interest" },
|
|
35
|
+
neutral: { filled: 3, dotClassName: "bg-status-info-icon", labelKey: "customers.temperature.neutral", fallback: "Engaged" },
|
|
36
|
+
medium: { filled: 3, dotClassName: "bg-status-info-icon", labelKey: "customers.temperature.medium", fallback: "Engaged" },
|
|
37
|
+
cool: { filled: 2, dotClassName: "bg-status-neutral-icon", labelKey: "customers.temperature.cool", fallback: "Low Activity" },
|
|
38
|
+
low: { filled: 2, dotClassName: "bg-status-neutral-icon", labelKey: "customers.temperature.low", fallback: "Low Activity" },
|
|
39
|
+
cold: { filled: 1, dotClassName: "bg-status-neutral-icon", labelKey: "customers.temperature.cold", fallback: "At Risk" }
|
|
40
|
+
};
|
|
41
|
+
function splitSourceTags(source) {
|
|
42
|
+
if (typeof source !== "string") return [];
|
|
43
|
+
return source.split(/[;,|]/).map((entry) => entry.trim()).filter((entry, index, array) => entry.length > 0 && array.indexOf(entry) === index);
|
|
44
|
+
}
|
|
45
|
+
function PersonCard({ person, isStarred, onToggleStar, onUnlink }) {
|
|
46
|
+
const t = useT();
|
|
47
|
+
const sourceTags = React.useMemo(() => splitSourceTags(person.source), [person.source]);
|
|
48
|
+
const temperature = React.useMemo(() => {
|
|
49
|
+
const value = typeof person.temperature === "string" ? person.temperature.trim().toLowerCase() : "";
|
|
50
|
+
return value in temperatureConfig ? temperatureConfig[value] : null;
|
|
51
|
+
}, [person.temperature]);
|
|
52
|
+
const linkedDate = React.useMemo(() => formatDate(person.linkedAt ?? person.createdAt), [person.createdAt, person.linkedAt]);
|
|
53
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-w-0 overflow-hidden rounded-lg border bg-card p-4", children: [
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
56
|
+
/* @__PURE__ */ jsx("div", { className: "flex size-11 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-bold text-muted-foreground", children: getInitials(person.displayName) }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 break-words text-sm font-bold leading-5 text-foreground", children: person.displayName }),
|
|
60
|
+
onToggleStar && /* @__PURE__ */ jsx(
|
|
61
|
+
IconButton,
|
|
62
|
+
{
|
|
63
|
+
type: "button",
|
|
64
|
+
variant: "ghost",
|
|
65
|
+
size: "sm",
|
|
66
|
+
onClick: () => onToggleStar(person.id),
|
|
67
|
+
className: "h-auto shrink-0 p-0 text-muted-foreground hover:text-status-warning-icon",
|
|
68
|
+
"aria-label": t("customers.people.card.toggleStar", "Toggle star"),
|
|
69
|
+
children: /* @__PURE__ */ jsx(Star, { className: cn("size-3.5", isStarred && "fill-status-warning-icon text-status-warning-icon") })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
74
|
+
person.jobTitle && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "max-w-full truncate px-2 py-0.5 text-xs font-semibold", children: person.jobTitle }),
|
|
75
|
+
person.status && /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "shrink-0 px-2 py-0.5 text-xs font-medium", children: [
|
|
76
|
+
/* @__PURE__ */ jsx("span", { className: "mr-1 inline-block size-1.5 rounded-full bg-status-success-icon" }),
|
|
77
|
+
person.status
|
|
78
|
+
] })
|
|
79
|
+
] })
|
|
80
|
+
] })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsxs(Popover, { children: [
|
|
83
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
84
|
+
IconButton,
|
|
85
|
+
{
|
|
86
|
+
type: "button",
|
|
87
|
+
variant: "ghost",
|
|
88
|
+
size: "xs",
|
|
89
|
+
className: "shrink-0",
|
|
90
|
+
"aria-label": t("customers.people.card.more", "More"),
|
|
91
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-3.5" })
|
|
92
|
+
}
|
|
93
|
+
) }),
|
|
94
|
+
/* @__PURE__ */ jsx(PopoverContent, { align: "end", className: "w-36 p-1", children: onUnlink && /* @__PURE__ */ jsxs(
|
|
95
|
+
Button,
|
|
96
|
+
{
|
|
97
|
+
type: "button",
|
|
98
|
+
variant: "ghost",
|
|
99
|
+
size: "sm",
|
|
100
|
+
className: "w-full justify-start text-xs text-destructive hover:text-destructive",
|
|
101
|
+
onClick: () => onUnlink(person.id),
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx(Unlink, { className: "mr-1.5 size-3" }),
|
|
104
|
+
t("customers.people.card.unlink", "Unlink")
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) })
|
|
108
|
+
] })
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-2 border-t pt-3 text-xs text-foreground", children: [
|
|
111
|
+
person.primaryEmail && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
112
|
+
/* @__PURE__ */ jsx(Mail, { className: "size-3 shrink-0 text-muted-foreground" }),
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "break-all", children: person.primaryEmail })
|
|
114
|
+
] }),
|
|
115
|
+
person.primaryPhone && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Phone, { className: "size-3 shrink-0 text-muted-foreground" }),
|
|
117
|
+
/* @__PURE__ */ jsx("span", { className: "break-all", children: person.primaryPhone })
|
|
118
|
+
] }),
|
|
119
|
+
(person.lifecycleStage || linkedDate) && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground", children: [
|
|
120
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: person.lifecycleStage ?? t("customers.people.card.defaultStage", "customer") }),
|
|
121
|
+
linkedDate ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
122
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7" }),
|
|
123
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: t("customers.people.card.linkedOn", "Linked {{date}}", { date: linkedDate }) })
|
|
124
|
+
] }) : null
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
(temperature || sourceTags.length > 0) && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex flex-col gap-3 border-t pt-3 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
128
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 space-y-1", children: sourceTags.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
+
/* @__PURE__ */ jsx("p", { className: "text-overline font-bold uppercase tracking-wide text-muted-foreground", children: t("customers.people.card.source", "Source") }),
|
|
130
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: sourceTags.map((sourceTag) => {
|
|
131
|
+
const normalized = sourceTag.toLowerCase().replace(/\s+/g, "_");
|
|
132
|
+
return /* @__PURE__ */ jsx(
|
|
133
|
+
Badge,
|
|
134
|
+
{
|
|
135
|
+
variant: "outline",
|
|
136
|
+
className: cn(
|
|
137
|
+
"max-w-full truncate px-2 py-0.5 text-xs font-semibold",
|
|
138
|
+
sourceColorMap[normalized] ?? sourceColorMap[sourceTag.toLowerCase()] ?? "border-border text-muted-foreground"
|
|
139
|
+
),
|
|
140
|
+
children: formatFallbackLabel(sourceTag)
|
|
141
|
+
},
|
|
142
|
+
sourceTag
|
|
143
|
+
);
|
|
144
|
+
}) })
|
|
145
|
+
] }) : null }),
|
|
146
|
+
temperature ? /* @__PURE__ */ jsxs("div", { className: "space-y-1 sm:ml-auto sm:text-right", children: [
|
|
147
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 text-overline font-bold text-muted-foreground sm:justify-end", children: /* @__PURE__ */ jsx("span", { children: t(temperature.labelKey, temperature.fallback) }) }),
|
|
148
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 sm:justify-end", children: Array.from({ length: 5 }).map((_, index) => /* @__PURE__ */ jsx(
|
|
149
|
+
"span",
|
|
150
|
+
{
|
|
151
|
+
className: cn(
|
|
152
|
+
"inline-block size-2 rounded-full border border-border/70",
|
|
153
|
+
index < temperature.filled ? temperature.dotClassName : "bg-muted"
|
|
154
|
+
)
|
|
155
|
+
},
|
|
156
|
+
index
|
|
157
|
+
)) })
|
|
158
|
+
] }) : null
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex flex-col gap-2 border-t pt-3 sm:flex-row sm:flex-wrap", children: [
|
|
161
|
+
/* @__PURE__ */ jsx(
|
|
162
|
+
Button,
|
|
163
|
+
{
|
|
164
|
+
asChild: true,
|
|
165
|
+
type: "button",
|
|
166
|
+
variant: "outline",
|
|
167
|
+
size: "sm",
|
|
168
|
+
className: "h-8 w-full text-xs font-semibold sm:min-w-[9rem] sm:flex-1",
|
|
169
|
+
children: /* @__PURE__ */ jsxs(Link, { href: `/backend/customers/people-v2/${person.id}`, children: [
|
|
170
|
+
/* @__PURE__ */ jsx(ArrowUpRight, { className: "mr-1 size-3" }),
|
|
171
|
+
t("customers.people.card.open", "Open person")
|
|
172
|
+
] })
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
onUnlink && /* @__PURE__ */ jsx(
|
|
176
|
+
Button,
|
|
177
|
+
{
|
|
178
|
+
type: "button",
|
|
179
|
+
variant: "outline",
|
|
180
|
+
size: "sm",
|
|
181
|
+
className: "h-8 w-full border-destructive/30 text-xs font-semibold text-destructive hover:bg-destructive/10 sm:min-w-[7rem] sm:flex-none",
|
|
182
|
+
onClick: () => onUnlink(person.id),
|
|
183
|
+
children: t("customers.people.card.unlink", "Unlink")
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
] })
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
export {
|
|
190
|
+
PersonCard
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=PersonCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/PersonCard.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport Link from 'next/link'\nimport { Mail, Phone, Star, MoreHorizontal, ArrowUpRight, Unlink } from 'lucide-react'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { Popover, PopoverContent, PopoverTrigger } from '@open-mercato/ui/primitives/popover'\nimport type { CompanyPersonSummary } from './CompanyPeopleSection'\nimport { formatDate, formatFallbackLabel, getInitials } from './utils'\n\nconst sourceColorMap: Record<string, string> = {\n linkedin: 'border-status-info-icon text-status-info-icon',\n email: 'border-status-success-icon text-status-success-icon',\n web_form: 'border-status-info-icon text-status-info-icon',\n 'web form': 'border-status-info-icon text-status-info-icon',\n referral: 'border-status-warning-icon text-status-warning-icon',\n customer_referral: 'border-status-warning-icon text-status-warning-icon',\n 'customer referral': 'border-status-warning-icon text-status-warning-icon',\n partner_referral: 'border-status-warning-icon text-status-warning-icon',\n 'partner referral': 'border-status-warning-icon text-status-warning-icon',\n event: 'border-status-info-icon text-status-info-icon',\n 'conference/event': 'border-status-info-icon text-status-info-icon',\n cold_outreach: 'border-status-neutral-icon text-status-neutral-icon',\n 'cold outreach': 'border-status-neutral-icon text-status-neutral-icon',\n facebook: 'border-status-info-icon text-status-info-icon',\n typeform: 'border-status-info-icon text-status-info-icon',\n other: 'border-status-neutral-icon text-status-neutral-icon',\n}\n\nconst temperatureConfig = {\n hot: { filled: 5, dotClassName: 'bg-status-error-icon', labelKey: 'customers.temperature.hot', fallback: 'Hot Client' },\n warm: { filled: 4, dotClassName: 'bg-status-warning-icon', labelKey: 'customers.temperature.warm', fallback: 'High Interest' },\n high: { filled: 4, dotClassName: 'bg-status-warning-icon', labelKey: 'customers.temperature.high', fallback: 'High Interest' },\n neutral: { filled: 3, dotClassName: 'bg-status-info-icon', labelKey: 'customers.temperature.neutral', fallback: 'Engaged' },\n medium: { filled: 3, dotClassName: 'bg-status-info-icon', labelKey: 'customers.temperature.medium', fallback: 'Engaged' },\n cool: { filled: 2, dotClassName: 'bg-status-neutral-icon', labelKey: 'customers.temperature.cool', fallback: 'Low Activity' },\n low: { filled: 2, dotClassName: 'bg-status-neutral-icon', labelKey: 'customers.temperature.low', fallback: 'Low Activity' },\n cold: { filled: 1, dotClassName: 'bg-status-neutral-icon', labelKey: 'customers.temperature.cold', fallback: 'At Risk' },\n} as const\n\nfunction splitSourceTags(source: string | null | undefined): string[] {\n if (typeof source !== 'string') return []\n return source\n .split(/[;,|]/)\n .map((entry) => entry.trim())\n .filter((entry, index, array) => entry.length > 0 && array.indexOf(entry) === index)\n}\n\ninterface PersonCardProps {\n person: CompanyPersonSummary\n isStarred?: boolean\n onToggleStar?: (personId: string) => void\n onUnlink?: (personId: string) => void\n}\n\nexport function PersonCard({ person, isStarred, onToggleStar, onUnlink }: PersonCardProps) {\n const t = useT()\n const sourceTags = React.useMemo(() => splitSourceTags(person.source), [person.source])\n const temperature = React.useMemo(() => {\n const value = typeof person.temperature === 'string' ? person.temperature.trim().toLowerCase() : ''\n return value in temperatureConfig ? temperatureConfig[value as keyof typeof temperatureConfig] : null\n }, [person.temperature])\n const linkedDate = React.useMemo(() => formatDate(person.linkedAt ?? person.createdAt), [person.createdAt, person.linkedAt])\n\n return (\n <div className=\"min-w-0 overflow-hidden rounded-lg border bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 flex-1 items-start gap-3\">\n <div className=\"flex size-11 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-bold text-muted-foreground\">\n {getInitials(person.displayName)}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5\">\n <span className=\"min-w-0 break-words text-sm font-bold leading-5 text-foreground\">{person.displayName}</span>\n {onToggleStar && (\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => onToggleStar(person.id)}\n className=\"h-auto shrink-0 p-0 text-muted-foreground hover:text-status-warning-icon\"\n aria-label={t('customers.people.card.toggleStar', 'Toggle star')}\n >\n <Star className={cn('size-3.5', isStarred && 'fill-status-warning-icon text-status-warning-icon')} />\n </IconButton>\n )}\n </div>\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {person.jobTitle && (\n <Badge variant=\"secondary\" className=\"max-w-full truncate px-2 py-0.5 text-xs font-semibold\">\n {person.jobTitle}\n </Badge>\n )}\n {person.status && (\n <Badge variant=\"outline\" className=\"shrink-0 px-2 py-0.5 text-xs font-medium\">\n <span className=\"mr-1 inline-block size-1.5 rounded-full bg-status-success-icon\" />\n {person.status}\n </Badge>\n )}\n </div>\n </div>\n </div>\n <Popover>\n <PopoverTrigger asChild>\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n className=\"shrink-0\"\n aria-label={t('customers.people.card.more', 'More')}\n >\n <MoreHorizontal className=\"size-3.5\" />\n </IconButton>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-36 p-1\">\n {onUnlink && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"w-full justify-start text-xs text-destructive hover:text-destructive\"\n onClick={() => onUnlink(person.id)}\n >\n <Unlink className=\"mr-1.5 size-3\" />\n {t('customers.people.card.unlink', 'Unlink')}\n </Button>\n )}\n </PopoverContent>\n </Popover>\n </div>\n\n <div className=\"mt-3 space-y-2 border-t pt-3 text-xs text-foreground\">\n {person.primaryEmail && (\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <Mail className=\"size-3 shrink-0 text-muted-foreground\" />\n <span className=\"break-all\">{person.primaryEmail}</span>\n </div>\n )}\n {person.primaryPhone && (\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <Phone className=\"size-3 shrink-0 text-muted-foreground\" />\n <span className=\"break-all\">{person.primaryPhone}</span>\n </div>\n )}\n {(person.lifecycleStage || linkedDate) && (\n <div className=\"flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground\">\n <span className=\"truncate\">{person.lifecycleStage ?? t('customers.people.card.defaultStage', 'customer')}</span>\n {linkedDate ? (\n <>\n <span aria-hidden>·</span>\n <span className=\"truncate\">{t('customers.people.card.linkedOn', 'Linked {{date}}', { date: linkedDate })}</span>\n </>\n ) : null}\n </div>\n )}\n </div>\n\n {(temperature || sourceTags.length > 0) && (\n <div className=\"mt-3 flex flex-col gap-3 border-t pt-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"min-w-0 flex-1 space-y-1\">\n {sourceTags.length > 0 ? (\n <>\n <p className=\"text-overline font-bold uppercase tracking-wide text-muted-foreground\">\n {t('customers.people.card.source', 'Source')}\n </p>\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5\">\n {sourceTags.map((sourceTag) => {\n const normalized = sourceTag.toLowerCase().replace(/\\s+/g, '_')\n return (\n <Badge\n key={sourceTag}\n variant=\"outline\"\n className={cn(\n 'max-w-full truncate px-2 py-0.5 text-xs font-semibold',\n sourceColorMap[normalized] ?? sourceColorMap[sourceTag.toLowerCase()] ?? 'border-border text-muted-foreground',\n )}\n >\n {formatFallbackLabel(sourceTag)}\n </Badge>\n )\n })}\n </div>\n </>\n ) : null}\n </div>\n {temperature ? (\n <div className=\"space-y-1 sm:ml-auto sm:text-right\">\n <div className=\"flex items-center gap-1 text-overline font-bold text-muted-foreground sm:justify-end\">\n <span>{t(temperature.labelKey, temperature.fallback)}</span>\n </div>\n <div className=\"flex items-center gap-1 sm:justify-end\">\n {Array.from({ length: 5 }).map((_, index) => (\n <span\n key={index}\n className={cn(\n 'inline-block size-2 rounded-full border border-border/70',\n index < temperature.filled ? temperature.dotClassName : 'bg-muted',\n )}\n />\n ))}\n </div>\n </div>\n ) : null}\n </div>\n )}\n\n <div className=\"mt-3 flex flex-col gap-2 border-t pt-3 sm:flex-row sm:flex-wrap\">\n <Button\n asChild\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-full text-xs font-semibold sm:min-w-[9rem] sm:flex-1\"\n >\n <Link href={`/backend/customers/people-v2/${person.id}`}>\n <ArrowUpRight className=\"mr-1 size-3\" />\n {t('customers.people.card.open', 'Open person')}\n </Link>\n </Button>\n {onUnlink && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-full border-destructive/30 text-xs font-semibold text-destructive hover:bg-destructive/10 sm:min-w-[7rem] sm:flex-none\"\n onClick={() => onUnlink(person.id)}\n >\n {t('customers.people.card.unlink', 'Unlink')}\n </Button>\n )}\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAwEU,SAgFI,UAhFJ,KAIE,YAJF;AAtEV,YAAY,WAAW;AACvB,OAAO,UAAU;AACjB,SAAS,MAAM,OAAO,MAAM,gBAAgB,cAAc,cAAc;AACxE,SAAS,UA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