@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,222 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Phone, Mail, Users, StickyNote, Clock, AlertCircle, CalendarClock, Check, MoreHorizontal, Plus } from "lucide-react";
|
|
4
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
5
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
6
|
+
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@open-mercato/ui/primitives/popover";
|
|
8
|
+
const TYPE_ICONS = {
|
|
9
|
+
call: Phone,
|
|
10
|
+
email: Mail,
|
|
11
|
+
meeting: Users,
|
|
12
|
+
note: StickyNote
|
|
13
|
+
};
|
|
14
|
+
function PlannedActivitiesSection({ activities, onComplete, onSchedule, onEdit, onCancel }) {
|
|
15
|
+
const t = useT();
|
|
16
|
+
if (activities.length === 0) return null;
|
|
17
|
+
const now = /* @__PURE__ */ new Date();
|
|
18
|
+
const classified = activities.map((activity) => {
|
|
19
|
+
const scheduledDate = activity.scheduledAt ? new Date(activity.scheduledAt) : null;
|
|
20
|
+
const isOverdue = scheduledDate ? scheduledDate < now : false;
|
|
21
|
+
return { ...activity, isOverdue };
|
|
22
|
+
});
|
|
23
|
+
const overdue = classified.filter((a) => a.isOverdue);
|
|
24
|
+
const upcoming = classified.filter((a) => !a.isOverdue);
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b", children: [
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
28
|
+
/* @__PURE__ */ jsx(CalendarClock, { className: "size-4 text-muted-foreground" }),
|
|
29
|
+
t("customers.timeline.planned.title", "Planned activities"),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground", children: activities.length }),
|
|
31
|
+
overdue.length > 0 && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-xs font-medium text-destructive", children: [
|
|
32
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "size-3" }),
|
|
33
|
+
overdue.length,
|
|
34
|
+
" ",
|
|
35
|
+
t("customers.timeline.planned.overdueCount", "overdue")
|
|
36
|
+
] })
|
|
37
|
+
] }),
|
|
38
|
+
onSchedule && /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "h-7 text-xs", onClick: onSchedule, children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Plus, { className: "mr-1 size-3" }),
|
|
40
|
+
t("customers.timeline.planned.schedule", "Schedule")
|
|
41
|
+
] })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "divide-y", children: [
|
|
44
|
+
overdue.map((activity) => {
|
|
45
|
+
const TypeIcon = TYPE_ICONS[activity.interactionType];
|
|
46
|
+
return /* @__PURE__ */ jsxs(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
className: "flex items-center gap-3 border-l-2 border-l-destructive px-4 py-3 cursor-pointer hover:bg-accent/50 transition-colors",
|
|
50
|
+
onClick: () => onEdit?.(activity),
|
|
51
|
+
role: "button",
|
|
52
|
+
tabIndex: 0,
|
|
53
|
+
onKeyDown: (e) => {
|
|
54
|
+
if (e.key === "Enter") onEdit?.(activity);
|
|
55
|
+
},
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center size-8 rounded-full bg-destructive/10 shrink-0", children: TypeIcon ? /* @__PURE__ */ jsx(TypeIcon, { className: "size-4 text-destructive" }) : /* @__PURE__ */ jsx(AlertCircle, { className: "size-4 text-destructive" }) }),
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium block truncate", children: activity.title ?? activity.body ?? activity.interactionType }),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex items-center gap-1 font-medium text-destructive", children: t("customers.timeline.planned.overdue", "Overdue") }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { children: activity.scheduledAt ? formatRelativeOverdue(activity.scheduledAt, t) : "" }),
|
|
63
|
+
activity.authorName && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
64
|
+
/* @__PURE__ */ jsx("span", { children: "\xB7" }),
|
|
65
|
+
/* @__PURE__ */ jsx("span", { children: activity.authorName })
|
|
66
|
+
] })
|
|
67
|
+
] })
|
|
68
|
+
] }),
|
|
69
|
+
onComplete && /* @__PURE__ */ jsxs(
|
|
70
|
+
Button,
|
|
71
|
+
{
|
|
72
|
+
type: "button",
|
|
73
|
+
variant: "outline",
|
|
74
|
+
size: "sm",
|
|
75
|
+
className: "h-7 shrink-0 text-xs",
|
|
76
|
+
onClick: (event) => {
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
onComplete(activity.id);
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx(Check, { className: "mr-1 size-3" }),
|
|
82
|
+
t("customers.timeline.planned.markDone", "Mark done")
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ jsxs(Popover, { children: [
|
|
87
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { type: "button", variant: "ghost", size: "xs", "aria-label": t("customers.timeline.more", "More"), onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-3.5" }) }) }),
|
|
88
|
+
/* @__PURE__ */ jsxs(PopoverContent, { align: "end", className: "w-40 p-1", children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
Button,
|
|
91
|
+
{
|
|
92
|
+
type: "button",
|
|
93
|
+
variant: "ghost",
|
|
94
|
+
size: "sm",
|
|
95
|
+
className: "w-full justify-start text-xs",
|
|
96
|
+
onClick: (event) => {
|
|
97
|
+
event.stopPropagation();
|
|
98
|
+
onEdit?.(activity);
|
|
99
|
+
},
|
|
100
|
+
children: t("customers.timeline.planned.reschedule", "Reschedule")
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
Button,
|
|
105
|
+
{
|
|
106
|
+
type: "button",
|
|
107
|
+
variant: "ghost",
|
|
108
|
+
size: "sm",
|
|
109
|
+
className: "w-full justify-start text-xs text-destructive hover:text-destructive",
|
|
110
|
+
onClick: (event) => {
|
|
111
|
+
event.stopPropagation();
|
|
112
|
+
onCancel?.(activity.id);
|
|
113
|
+
},
|
|
114
|
+
children: t("customers.timeline.planned.cancel", "Cancel")
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] })
|
|
118
|
+
] })
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
activity.id
|
|
122
|
+
);
|
|
123
|
+
}),
|
|
124
|
+
upcoming.map((activity) => {
|
|
125
|
+
const TypeIcon = TYPE_ICONS[activity.interactionType];
|
|
126
|
+
return /* @__PURE__ */ jsxs(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: "flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent/50 transition-colors",
|
|
130
|
+
onClick: () => onEdit?.(activity),
|
|
131
|
+
role: "button",
|
|
132
|
+
tabIndex: 0,
|
|
133
|
+
onKeyDown: (e) => {
|
|
134
|
+
if (e.key === "Enter") onEdit?.(activity);
|
|
135
|
+
},
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center size-8 rounded-full bg-muted shrink-0", children: TypeIcon ? /* @__PURE__ */ jsx(TypeIcon, { className: "size-4 text-muted-foreground" }) : /* @__PURE__ */ jsx(Clock, { className: "size-4 text-muted-foreground" }) }),
|
|
138
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
139
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium block truncate", children: activity.title ?? activity.body ?? activity.interactionType }),
|
|
140
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
141
|
+
/* @__PURE__ */ jsx("span", { children: activity.scheduledAt ? formatScheduledDate(activity.scheduledAt) : "" }),
|
|
142
|
+
activity.authorName && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ jsx("span", { children: "\xB7" }),
|
|
144
|
+
/* @__PURE__ */ jsx("span", { children: activity.authorName })
|
|
145
|
+
] })
|
|
146
|
+
] })
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ jsxs(Popover, { children: [
|
|
149
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { type: "button", variant: "ghost", size: "xs", "aria-label": t("customers.timeline.more", "More"), onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-3.5" }) }) }),
|
|
150
|
+
/* @__PURE__ */ jsxs(PopoverContent, { align: "end", className: "w-40 p-1", children: [
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
Button,
|
|
153
|
+
{
|
|
154
|
+
type: "button",
|
|
155
|
+
variant: "ghost",
|
|
156
|
+
size: "sm",
|
|
157
|
+
className: "w-full justify-start text-xs",
|
|
158
|
+
onClick: (event) => {
|
|
159
|
+
event.stopPropagation();
|
|
160
|
+
onEdit?.(activity);
|
|
161
|
+
},
|
|
162
|
+
children: t("customers.timeline.planned.reschedule", "Reschedule")
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ jsx(
|
|
166
|
+
Button,
|
|
167
|
+
{
|
|
168
|
+
type: "button",
|
|
169
|
+
variant: "ghost",
|
|
170
|
+
size: "sm",
|
|
171
|
+
className: "w-full justify-start text-xs text-destructive hover:text-destructive",
|
|
172
|
+
onClick: (event) => {
|
|
173
|
+
event.stopPropagation();
|
|
174
|
+
onCancel?.(activity.id);
|
|
175
|
+
},
|
|
176
|
+
children: t("customers.timeline.planned.cancel", "Cancel")
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
] })
|
|
180
|
+
] })
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
activity.id
|
|
184
|
+
);
|
|
185
|
+
})
|
|
186
|
+
] })
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
function formatRelativeOverdue(isoString, t) {
|
|
190
|
+
try {
|
|
191
|
+
const date = new Date(isoString);
|
|
192
|
+
const now = /* @__PURE__ */ new Date();
|
|
193
|
+
const diffMs = now.getTime() - date.getTime();
|
|
194
|
+
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
195
|
+
if (diffDays <= 0) return t("customers.timeline.planned.overdueToday", "due today");
|
|
196
|
+
if (diffDays === 1) return t("customers.timeline.planned.overdueSince", "since yesterday");
|
|
197
|
+
return t("customers.timeline.planned.overdueDays", "overdue {{days}} days", { days: diffDays });
|
|
198
|
+
} catch {
|
|
199
|
+
return "";
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function formatScheduledDate(isoString) {
|
|
203
|
+
try {
|
|
204
|
+
const date = new Date(isoString);
|
|
205
|
+
const now = /* @__PURE__ */ new Date();
|
|
206
|
+
const tomorrow = new Date(now);
|
|
207
|
+
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
208
|
+
const dayName = date.toLocaleDateString(void 0, { weekday: "short" });
|
|
209
|
+
const dateStr = date.toLocaleDateString(void 0, { day: "numeric", month: "short" });
|
|
210
|
+
const timeStr = date.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" });
|
|
211
|
+
if (date.toDateString() === tomorrow.toDateString()) {
|
|
212
|
+
return `Tomorrow ${timeStr}`;
|
|
213
|
+
}
|
|
214
|
+
return `${dayName}, ${dateStr} \xB7 ${timeStr}`;
|
|
215
|
+
} catch {
|
|
216
|
+
return isoString;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
export {
|
|
220
|
+
PlannedActivitiesSection
|
|
221
|
+
};
|
|
222
|
+
//# sourceMappingURL=PlannedActivitiesSection.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/PlannedActivitiesSection.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport * as React from 'react'\nimport { Phone, Mail, Users, StickyNote, Clock, AlertCircle, CalendarClock, Check, MoreHorizontal, Plus } from 'lucide-react'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { useT, type TranslateFn } 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 { Popover, PopoverContent, PopoverTrigger } from '@open-mercato/ui/primitives/popover'\nimport type { InteractionSummary } from './types'\n\nconst TYPE_ICONS: Record<string, React.ComponentType<{ className?: string }>> = {\n call: Phone,\n email: Mail,\n meeting: Users,\n note: StickyNote,\n}\n\ninterface PlannedActivitiesSectionProps {\n activities: InteractionSummary[]\n onComplete?: (id: string) => void\n onSchedule?: () => void\n onEdit?: (activity: InteractionSummary) => void\n onCancel?: (id: string) => void\n}\n\nexport function PlannedActivitiesSection({ activities, onComplete, onSchedule, onEdit, onCancel }: PlannedActivitiesSectionProps) {\n const t = useT()\n\n if (activities.length === 0) return null\n\n const now = new Date()\n\n const classified = activities.map((activity) => {\n const scheduledDate = activity.scheduledAt ? new Date(activity.scheduledAt) : null\n const isOverdue = scheduledDate ? scheduledDate < now : false\n return { ...activity, isOverdue }\n })\n\n const overdue = classified.filter((a) => a.isOverdue)\n const upcoming = classified.filter((a) => !a.isOverdue)\n\n return (\n <div className=\"rounded-lg border bg-card\">\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b\">\n <div className=\"flex items-center gap-2 text-sm font-medium\">\n <CalendarClock className=\"size-4 text-muted-foreground\" />\n {t('customers.timeline.planned.title', 'Planned activities')}\n <span className=\"rounded-full bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground\">\n {activities.length}\n </span>\n {overdue.length > 0 && (\n <span className=\"flex items-center gap-1 text-xs font-medium text-destructive\">\n <AlertCircle className=\"size-3\" />\n {overdue.length} {t('customers.timeline.planned.overdueCount', 'overdue')}\n </span>\n )}\n </div>\n {onSchedule && (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-7 text-xs\" onClick={onSchedule}>\n <Plus className=\"mr-1 size-3\" />\n {t('customers.timeline.planned.schedule', 'Schedule')}\n </Button>\n )}\n </div>\n\n {/* Items */}\n <div className=\"divide-y\">\n {overdue.map((activity) => {\n const TypeIcon = TYPE_ICONS[activity.interactionType]\n return (\n <div\n key={activity.id}\n className=\"flex items-center gap-3 border-l-2 border-l-destructive px-4 py-3 cursor-pointer hover:bg-accent/50 transition-colors\"\n onClick={() => onEdit?.(activity)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => { if (e.key === 'Enter') onEdit?.(activity) }}\n >\n <div className=\"flex items-center justify-center size-8 rounded-full bg-destructive/10 shrink-0\">\n {TypeIcon ? <TypeIcon className=\"size-4 text-destructive\" /> : <AlertCircle className=\"size-4 text-destructive\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <span className=\"text-sm font-medium block truncate\">\n {activity.title ?? activity.body ?? activity.interactionType}\n </span>\n <div className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n <span className=\"inline-flex items-center gap-1 font-medium text-destructive\">\n {t('customers.timeline.planned.overdue', 'Overdue')}\n </span>\n <span>\n {activity.scheduledAt ? formatRelativeOverdue(activity.scheduledAt, t) : ''}\n </span>\n {activity.authorName && (\n <>\n <span>\u00B7</span>\n <span>{activity.authorName}</span>\n </>\n )}\n </div>\n </div>\n {onComplete && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-7 shrink-0 text-xs\"\n onClick={(event) => {\n event.stopPropagation()\n onComplete(activity.id)\n }}\n >\n <Check className=\"mr-1 size-3\" />\n {t('customers.timeline.planned.markDone', 'Mark done')}\n </Button>\n )}\n <Popover>\n <PopoverTrigger asChild>\n <IconButton type=\"button\" variant=\"ghost\" size=\"xs\" aria-label={t('customers.timeline.more', 'More')} onClick={(e) => e.stopPropagation()}>\n <MoreHorizontal className=\"size-3.5\" />\n </IconButton>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-40 p-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"w-full justify-start text-xs\"\n onClick={(event) => {\n event.stopPropagation()\n onEdit?.(activity)\n }}\n >\n {t('customers.timeline.planned.reschedule', 'Reschedule')}\n </Button>\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={(event) => {\n event.stopPropagation()\n onCancel?.(activity.id)\n }}\n >\n {t('customers.timeline.planned.cancel', 'Cancel')}\n </Button>\n </PopoverContent>\n </Popover>\n </div>\n )\n })}\n\n {upcoming.map((activity) => {\n const TypeIcon = TYPE_ICONS[activity.interactionType]\n return (\n <div\n key={activity.id}\n className=\"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent/50 transition-colors\"\n onClick={() => onEdit?.(activity)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => { if (e.key === 'Enter') onEdit?.(activity) }}\n >\n <div className=\"flex items-center justify-center size-8 rounded-full bg-muted shrink-0\">\n {TypeIcon ? <TypeIcon className=\"size-4 text-muted-foreground\" /> : <Clock className=\"size-4 text-muted-foreground\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <span className=\"text-sm font-medium block truncate\">\n {activity.title ?? activity.body ?? activity.interactionType}\n </span>\n <div className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n <span>{activity.scheduledAt ? formatScheduledDate(activity.scheduledAt) : ''}</span>\n {activity.authorName && (\n <>\n <span>\u00B7</span>\n <span>{activity.authorName}</span>\n </>\n )}\n </div>\n </div>\n <Popover>\n <PopoverTrigger asChild>\n <IconButton type=\"button\" variant=\"ghost\" size=\"xs\" aria-label={t('customers.timeline.more', 'More')} onClick={(e) => e.stopPropagation()}>\n <MoreHorizontal className=\"size-3.5\" />\n </IconButton>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-40 p-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"w-full justify-start text-xs\"\n onClick={(event) => {\n event.stopPropagation()\n onEdit?.(activity)\n }}\n >\n {t('customers.timeline.planned.reschedule', 'Reschedule')}\n </Button>\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={(event) => {\n event.stopPropagation()\n onCancel?.(activity.id)\n }}\n >\n {t('customers.timeline.planned.cancel', 'Cancel')}\n </Button>\n </PopoverContent>\n </Popover>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nfunction formatRelativeOverdue(isoString: string, t: TranslateFn): string {\n try {\n const date = new Date(isoString)\n const now = new Date()\n const diffMs = now.getTime() - date.getTime()\n const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24))\n if (diffDays <= 0) return t('customers.timeline.planned.overdueToday', 'due today')\n if (diffDays === 1) return t('customers.timeline.planned.overdueSince', 'since yesterday')\n return t('customers.timeline.planned.overdueDays', 'overdue {{days}} days', { days: diffDays })\n } catch {\n return ''\n }\n}\n\nfunction formatScheduledDate(isoString: string): string {\n try {\n const date = new Date(isoString)\n const now = new Date()\n const tomorrow = new Date(now)\n tomorrow.setDate(tomorrow.getDate() + 1)\n\n const dayName = date.toLocaleDateString(undefined, { weekday: 'short' })\n const dateStr = date.toLocaleDateString(undefined, { day: 'numeric', month: 'short' })\n const timeStr = date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' })\n\n if (date.toDateString() === tomorrow.toDateString()) {\n return `Tomorrow ${timeStr}`\n }\n return `${dayName}, ${dateStr} \u00B7 ${timeStr}`\n } catch {\n return isoString\n }\n}\n"],
|
|
5
|
+
"mappings": ";AA8CU,SAgDU,UAhDV,KAME,YANF;AA5CV,SAAS,OAAO,MAAM,OAAO,YAAY,OAAO,aAAa,eAAe,OAAO,gBAAgB,YAAY;AAE/G,SAAS,YAA8B;AACvC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,SAAS,gBAAgB,sBAAsB;AAGxD,MAAM,aAA0E;AAAA,EAC9E,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR;AAUO,SAAS,yBAAyB,EAAE,YAAY,YAAY,YAAY,QAAQ,SAAS,GAAkC;AAChI,QAAM,IAAI,KAAK;AAEf,MAAI,WAAW,WAAW,EAAG,QAAO;AAEpC,QAAM,MAAM,oBAAI,KAAK;AAErB,QAAM,aAAa,WAAW,IAAI,CAAC,aAAa;AAC9C,UAAM,gBAAgB,SAAS,cAAc,IAAI,KAAK,SAAS,WAAW,IAAI;AAC9E,UAAM,YAAY,gBAAgB,gBAAgB,MAAM;AACxD,WAAO,EAAE,GAAG,UAAU,UAAU;AAAA,EAClC,CAAC;AAED,QAAM,UAAU,WAAW,OAAO,CAAC,MAAM,EAAE,SAAS;AACpD,QAAM,WAAW,WAAW,OAAO,CAAC,MAAM,CAAC,EAAE,SAAS;AAEtD,SACE,qBAAC,SAAI,WAAU,6BAEb;AAAA,yBAAC,SAAI,WAAU,wDACb;AAAA,2BAAC,SAAI,WAAU,+CACb;AAAA,4BAAC,iBAAc,WAAU,gCAA+B;AAAA,QACvD,EAAE,oCAAoC,oBAAoB;AAAA,QAC3D,oBAAC,UAAK,WAAU,iFACb,qBAAW,QACd;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SAAM,OAAO;AAAA,EAC5C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Heart, 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 { Badge } from "@open-mercato/ui/primitives/badge";
|
|
8
|
+
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
9
|
+
import { computeHealthScore, HEALTH_BADGE_CLASSES, HEALTH_ICON_CLASSES } from "./healthScoreUtils.js";
|
|
10
|
+
function RelationshipHealthCard({ interactions, onHide }) {
|
|
11
|
+
const t = useT();
|
|
12
|
+
const health = React.useMemo(() => computeHealthScore(interactions), [interactions]);
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", { className: "group relative rounded-lg border bg-card p-5", children: [
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("h3", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Heart, { className: cn("size-4", HEALTH_ICON_CLASSES[health.variant]) }),
|
|
17
|
+
t("customers.companies.detail.health.title", "Relationship health")
|
|
18
|
+
] }),
|
|
19
|
+
onHide && /* @__PURE__ */ jsx(
|
|
20
|
+
IconButton,
|
|
21
|
+
{
|
|
22
|
+
type: "button",
|
|
23
|
+
variant: "ghost",
|
|
24
|
+
size: "xs",
|
|
25
|
+
onClick: onHide,
|
|
26
|
+
className: "opacity-0 transition-opacity group-hover:opacity-60",
|
|
27
|
+
"aria-label": t("customers.companies.dashboard.hideTile", "Hide tile"),
|
|
28
|
+
children: /* @__PURE__ */ jsx(EyeOff, { className: "size-3.5" })
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2 text-center", children: [
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: "relative inline-flex items-center justify-center", children: [
|
|
34
|
+
/* @__PURE__ */ jsx("span", { className: cn("text-4xl font-bold", HEALTH_ICON_CLASSES[health.variant]), children: health.score }),
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "/100" })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Badge, { className: cn("text-xs", HEALTH_BADGE_CLASSES[health.variant]), children: t(`customers.companies.detail.health.${health.label}`, health.label) }) }),
|
|
38
|
+
health.lastContactDays !== null && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
39
|
+
t("customers.companies.detail.health.lastContact", "Last contact"),
|
|
40
|
+
": ",
|
|
41
|
+
health.lastContactDays === 0 ? t("customers.health.today", "today") : t("customers.health.daysAgo", "{days} days ago", { days: health.lastContactDays })
|
|
42
|
+
] })
|
|
43
|
+
] }) })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
RelationshipHealthCard
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=RelationshipHealthCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/RelationshipHealthCard.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Heart, EyeOff } 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 { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport type { InteractionSummary } from '../formConfig'\nimport { computeHealthScore, HEALTH_BADGE_CLASSES, HEALTH_ICON_CLASSES } from './healthScoreUtils'\n\ntype RelationshipHealthCardProps = {\n interactions: InteractionSummary[]\n onHide?: () => void\n}\n\nexport function RelationshipHealthCard({ interactions, onHide }: RelationshipHealthCardProps) {\n const t = useT()\n const health = React.useMemo(() => computeHealthScore(interactions), [interactions])\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 <Heart className={cn('size-4', HEALTH_ICON_CLASSES[health.variant])} />\n {t('customers.companies.detail.health.title', 'Relationship health')}\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 <div className=\"mt-4 flex items-center justify-center\">\n <div className=\"space-y-2 text-center\">\n <div className=\"relative inline-flex items-center justify-center\">\n <span className={cn('text-4xl font-bold', HEALTH_ICON_CLASSES[health.variant])}>{health.score}</span>\n <span className=\"text-sm text-muted-foreground\">/100</span>\n </div>\n <div>\n <Badge className={cn('text-xs', HEALTH_BADGE_CLASSES[health.variant])}>\n {t(`customers.companies.detail.health.${health.label}`, health.label)}\n </Badge>\n </div>\n {health.lastContactDays !== null && (\n <p className=\"text-xs text-muted-foreground\">\n {t('customers.companies.detail.health.lastContact', 'Last contact')}: {health.lastContactDays === 0\n ? t('customers.health.today', 'today')\n : t('customers.health.daysAgo', '{days} days ago', { days: health.lastContactDays })}\n </p>\n )}\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAuBQ,SACE,KADF;AArBR,YAAY,WAAW;AACvB,SAAS,OAAO,cAAc;AAC9B,SAAS,UAAU;A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A4B,mBAAmB,EAAE,MAAM,OAAO,gBAAgB,CAAC;AAAA,SACvF;AAAA,OAEJ,GACF;AAAA,KACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Mail, Phone, X } from "lucide-react";
|
|
5
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
6
|
+
import { apiCallOrThrow } from "@open-mercato/ui/backend/utils/apiCall";
|
|
7
|
+
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
8
|
+
import { LookupSelect } from "@open-mercato/ui/backend/inputs/LookupSelect";
|
|
9
|
+
import { IconButton } from "@open-mercato/ui/primitives/icon-button";
|
|
10
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
11
|
+
import { Badge } from "@open-mercato/ui/primitives/badge";
|
|
12
|
+
import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
|
|
13
|
+
import { fetchAssignableStaffMembers } from "./assignableStaff.js";
|
|
14
|
+
import { getInitials } from "./utils.js";
|
|
15
|
+
function formatAssignedAt(value, t) {
|
|
16
|
+
if (!value) return null;
|
|
17
|
+
const date = new Date(value);
|
|
18
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
19
|
+
const diffMs = Date.now() - date.getTime();
|
|
20
|
+
const diffDays = Math.floor(diffMs / 864e5);
|
|
21
|
+
if (diffDays <= 0) return t("customers.roles.assignedToday", "Assigned today");
|
|
22
|
+
if (diffDays === 1) return t("customers.roles.assignedYesterday", "Assigned yesterday");
|
|
23
|
+
return t("customers.roles.assignedDaysAgo", "Assigned {{count}} days ago", { count: diffDays });
|
|
24
|
+
}
|
|
25
|
+
function RoleAssignmentRow({
|
|
26
|
+
role,
|
|
27
|
+
roleTypeLabel,
|
|
28
|
+
runMutationWithContext,
|
|
29
|
+
entityType,
|
|
30
|
+
entityId,
|
|
31
|
+
onRemoved,
|
|
32
|
+
onUpdated
|
|
33
|
+
}) {
|
|
34
|
+
const t = useT();
|
|
35
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog();
|
|
36
|
+
const [removing, setRemoving] = React.useState(false);
|
|
37
|
+
const [changingUser, setChangingUser] = React.useState(false);
|
|
38
|
+
const searchUsers = React.useCallback(async (query) => {
|
|
39
|
+
try {
|
|
40
|
+
const members = await fetchAssignableStaffMembers(query, { pageSize: 20 });
|
|
41
|
+
return members.map((member) => ({
|
|
42
|
+
id: member.userId,
|
|
43
|
+
title: member.displayName,
|
|
44
|
+
subtitle: member.displayName && member.email ? member.email : null
|
|
45
|
+
}));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error("customers.roles.searchUsers failed", error);
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
51
|
+
const handleUserChange = React.useCallback(async (userId) => {
|
|
52
|
+
if (!userId || userId === role.userId) return;
|
|
53
|
+
const basePath = entityType === "company" ? "companies" : "people";
|
|
54
|
+
try {
|
|
55
|
+
await runMutationWithContext(
|
|
56
|
+
() => apiCallOrThrow(`/api/customers/${basePath}/${entityId}/roles?roleId=${role.id}`, {
|
|
57
|
+
method: "PUT",
|
|
58
|
+
headers: { "content-type": "application/json" },
|
|
59
|
+
body: JSON.stringify({ userId })
|
|
60
|
+
}),
|
|
61
|
+
{ roleId: role.id, userId }
|
|
62
|
+
);
|
|
63
|
+
setChangingUser(false);
|
|
64
|
+
onUpdated();
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error("customers.roles.update failed", error);
|
|
67
|
+
flash(t("customers.roles.updateFailed", "Failed to update role assignment."), "error");
|
|
68
|
+
setChangingUser(false);
|
|
69
|
+
}
|
|
70
|
+
}, [entityId, entityType, onUpdated, role.id, role.userId, runMutationWithContext, t]);
|
|
71
|
+
const handleRemove = React.useCallback(async () => {
|
|
72
|
+
const confirmed = await confirm({
|
|
73
|
+
title: t("customers.roles.removeConfirm", "Remove this role assignment?"),
|
|
74
|
+
variant: "default"
|
|
75
|
+
});
|
|
76
|
+
if (!confirmed) return;
|
|
77
|
+
setRemoving(true);
|
|
78
|
+
const basePath = entityType === "company" ? "companies" : "people";
|
|
79
|
+
try {
|
|
80
|
+
await runMutationWithContext(
|
|
81
|
+
() => apiCallOrThrow(`/api/customers/${basePath}/${entityId}/roles?roleId=${role.id}`, {
|
|
82
|
+
method: "DELETE"
|
|
83
|
+
}),
|
|
84
|
+
{ roleId: role.id }
|
|
85
|
+
);
|
|
86
|
+
onRemoved();
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error("customers.roles.remove failed", error);
|
|
89
|
+
flash(t("customers.roles.removeFailed", "Failed to remove role assignment."), "error");
|
|
90
|
+
} finally {
|
|
91
|
+
setRemoving(false);
|
|
92
|
+
}
|
|
93
|
+
}, [confirm, entityId, entityType, onRemoved, role.id, runMutationWithContext, t]);
|
|
94
|
+
const currentUserOptions = React.useMemo(
|
|
95
|
+
() => role.userId ? [{
|
|
96
|
+
id: role.userId,
|
|
97
|
+
title: role.userName ?? role.userEmail ?? role.userId,
|
|
98
|
+
subtitle: role.userName && role.userEmail ? role.userEmail : null
|
|
99
|
+
}] : [],
|
|
100
|
+
[role.userEmail, role.userId, role.userName]
|
|
101
|
+
);
|
|
102
|
+
const initials = React.useMemo(() => {
|
|
103
|
+
const name = role.userName ?? role.userEmail ?? "";
|
|
104
|
+
return getInitials(name || "?");
|
|
105
|
+
}, [role.userEmail, role.userName]);
|
|
106
|
+
const displayName = role.userName ?? role.userEmail ?? role.userId;
|
|
107
|
+
const assignedLabel = formatAssignedAt(role.createdAt, t);
|
|
108
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
109
|
+
ConfirmDialogElement,
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-full min-w-0 flex-col overflow-hidden rounded-xl border bg-card p-4 shadow-sm", children: [
|
|
111
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [
|
|
112
|
+
/* @__PURE__ */ jsx(Badge, { variant: "outline", className: "max-w-full break-words rounded-full px-2 py-0 text-left text-xs font-semibold", children: roleTypeLabel }),
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
IconButton,
|
|
115
|
+
{
|
|
116
|
+
type: "button",
|
|
117
|
+
variant: "ghost",
|
|
118
|
+
size: "sm",
|
|
119
|
+
onClick: handleRemove,
|
|
120
|
+
disabled: removing,
|
|
121
|
+
"aria-label": t("customers.roles.remove", "Remove role"),
|
|
122
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start", children: [
|
|
127
|
+
/* @__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: initials }),
|
|
128
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
129
|
+
/* @__PURE__ */ jsx("div", { className: "break-all text-sm font-semibold leading-5 text-foreground", children: displayName }),
|
|
130
|
+
role.userEmail ? /* @__PURE__ */ jsx("div", { className: "mt-1 break-all text-xs text-muted-foreground", children: role.userEmail }) : null,
|
|
131
|
+
assignedLabel ? /* @__PURE__ */ jsx("div", { className: "mt-2 text-overline uppercase tracking-[0.08em] text-muted-foreground", children: assignedLabel }) : null
|
|
132
|
+
] })
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
135
|
+
role.userEmail ? /* @__PURE__ */ jsx(IconButton, { asChild: true, variant: "outline", size: "sm", className: "shrink-0", children: /* @__PURE__ */ jsx("a", { href: `mailto:${role.userEmail}`, "aria-label": t("customers.roles.email", "Send email"), children: /* @__PURE__ */ jsx(Mail, { className: "size-4" }) }) }) : /* @__PURE__ */ jsx(
|
|
136
|
+
IconButton,
|
|
137
|
+
{
|
|
138
|
+
type: "button",
|
|
139
|
+
variant: "outline",
|
|
140
|
+
size: "sm",
|
|
141
|
+
className: "shrink-0",
|
|
142
|
+
disabled: true,
|
|
143
|
+
"aria-label": t("customers.roles.emailUnavailable", "Email unavailable"),
|
|
144
|
+
children: /* @__PURE__ */ jsx(Mail, { className: "size-4" })
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
role.userPhone ? /* @__PURE__ */ jsx(IconButton, { asChild: true, variant: "outline", size: "sm", className: "shrink-0", children: /* @__PURE__ */ jsx("a", { href: `tel:${role.userPhone}`, "aria-label": t("customers.roles.call", "Call"), children: /* @__PURE__ */ jsx(Phone, { className: "size-4" }) }) }) : /* @__PURE__ */ jsx(
|
|
148
|
+
IconButton,
|
|
149
|
+
{
|
|
150
|
+
type: "button",
|
|
151
|
+
variant: "outline",
|
|
152
|
+
size: "sm",
|
|
153
|
+
className: "shrink-0",
|
|
154
|
+
disabled: true,
|
|
155
|
+
"aria-label": t("customers.roles.phoneUnavailable", "Phone unavailable"),
|
|
156
|
+
children: /* @__PURE__ */ jsx(Phone, { className: "size-4" })
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ jsx(
|
|
160
|
+
Button,
|
|
161
|
+
{
|
|
162
|
+
type: "button",
|
|
163
|
+
variant: "ghost",
|
|
164
|
+
size: "sm",
|
|
165
|
+
className: "h-auto w-full justify-start px-2 py-1 text-xs sm:ml-auto sm:w-auto",
|
|
166
|
+
onClick: () => setChangingUser((current) => !current),
|
|
167
|
+
children: t("customers.roles.changeUser", "Change user")
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] }),
|
|
171
|
+
changingUser ? /* @__PURE__ */ jsx("div", { className: "mt-4 border-t pt-4", children: /* @__PURE__ */ jsx(
|
|
172
|
+
LookupSelect,
|
|
173
|
+
{
|
|
174
|
+
value: role.userId,
|
|
175
|
+
onChange: async (userId) => {
|
|
176
|
+
await handleUserChange(userId);
|
|
177
|
+
},
|
|
178
|
+
fetchItems: searchUsers,
|
|
179
|
+
options: currentUserOptions,
|
|
180
|
+
placeholder: t("customers.roles.searchPlaceholder", "Search team member...")
|
|
181
|
+
}
|
|
182
|
+
) }) : null
|
|
183
|
+
] })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
export {
|
|
187
|
+
RoleAssignmentRow
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=RoleAssignmentRow.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/customers/components/detail/RoleAssignmentRow.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Mail, Phone, X } from 'lucide-react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { apiCallOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { LookupSelect, type LookupSelectItem } from '@open-mercato/ui/backend/inputs/LookupSelect'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { fetchAssignableStaffMembers } from './assignableStaff'\nimport { getInitials } from './utils'\n\nexport interface RoleAssignment {\n id: string\n roleType: string\n userId: string\n userName?: string | null\n userEmail?: string | null\n userPhone?: string | null\n createdAt?: string\n updatedAt?: string\n}\n\ninterface RoleAssignmentRowProps {\n role: RoleAssignment\n roleTypeLabel: string\n runMutationWithContext: <T,>(\n operation: () => Promise<T>,\n mutationPayload?: Record<string, unknown>,\n ) => Promise<T>\n entityType: 'company' | 'person'\n entityId: string\n onRemoved: () => void\n onUpdated: () => void\n}\n\nfunction formatAssignedAt(value: string | undefined, t: ReturnType<typeof useT>): string | null {\n if (!value) return null\n const date = new Date(value)\n if (Number.isNaN(date.getTime())) return null\n const diffMs = Date.now() - date.getTime()\n const diffDays = Math.floor(diffMs / 86_400_000)\n if (diffDays <= 0) return t('customers.roles.assignedToday', 'Assigned today')\n if (diffDays === 1) return t('customers.roles.assignedYesterday', 'Assigned yesterday')\n return t('customers.roles.assignedDaysAgo', 'Assigned {{count}} days ago', { count: diffDays })\n}\n\nexport function RoleAssignmentRow({\n role,\n roleTypeLabel,\n runMutationWithContext,\n entityType,\n entityId,\n onRemoved,\n onUpdated,\n}: RoleAssignmentRowProps) {\n const t = useT()\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n const [removing, setRemoving] = React.useState(false)\n const [changingUser, setChangingUser] = React.useState(false)\n\n const searchUsers = React.useCallback(async (query: string): Promise<LookupSelectItem[]> => {\n try {\n const members = await fetchAssignableStaffMembers(query, { pageSize: 20 })\n return members.map((member) => ({\n id: member.userId,\n title: member.displayName,\n subtitle: member.displayName && member.email ? member.email : null,\n }))\n } catch (error) {\n console.error('customers.roles.searchUsers failed', error)\n return []\n }\n }, [])\n\n const handleUserChange = React.useCallback(async (userId: string | null) => {\n if (!userId || userId === role.userId) return\n const basePath = entityType === 'company' ? 'companies' : 'people'\n try {\n await runMutationWithContext(\n () =>\n apiCallOrThrow(`/api/customers/${basePath}/${entityId}/roles?roleId=${role.id}`, {\n method: 'PUT',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ userId }),\n }),\n { roleId: role.id, userId },\n )\n setChangingUser(false)\n onUpdated()\n } catch (error) {\n console.error('customers.roles.update failed', error)\n flash(t('customers.roles.updateFailed', 'Failed to update role assignment.'), 'error')\n setChangingUser(false)\n }\n }, [entityId, entityType, onUpdated, role.id, role.userId, runMutationWithContext, t])\n\n const handleRemove = React.useCallback(async () => {\n const confirmed = await confirm({\n title: t('customers.roles.removeConfirm', 'Remove this role assignment?'),\n variant: 'default',\n })\n if (!confirmed) return\n\n setRemoving(true)\n const basePath = entityType === 'company' ? 'companies' : 'people'\n try {\n await runMutationWithContext(\n () =>\n apiCallOrThrow(`/api/customers/${basePath}/${entityId}/roles?roleId=${role.id}`, {\n method: 'DELETE',\n }),\n { roleId: role.id },\n )\n onRemoved()\n } catch (error) {\n console.error('customers.roles.remove failed', error)\n flash(t('customers.roles.removeFailed', 'Failed to remove role assignment.'), 'error')\n } finally {\n setRemoving(false)\n }\n }, [confirm, entityId, entityType, onRemoved, role.id, runMutationWithContext, t])\n\n const currentUserOptions = React.useMemo<LookupSelectItem[]>(\n () =>\n role.userId\n ? [{\n id: role.userId,\n title: role.userName ?? role.userEmail ?? role.userId,\n subtitle: role.userName && role.userEmail ? role.userEmail : null,\n }]\n : [],\n [role.userEmail, role.userId, role.userName],\n )\n\n const initials = React.useMemo(() => {\n const name = role.userName ?? role.userEmail ?? ''\n return getInitials(name || '?')\n }, [role.userEmail, role.userName])\n\n const displayName = role.userName ?? role.userEmail ?? role.userId\n const assignedLabel = formatAssignedAt(role.createdAt, t)\n\n return (\n <>\n {ConfirmDialogElement}\n <div className=\"flex h-full min-w-0 flex-col overflow-hidden rounded-xl border bg-card p-4 shadow-sm\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <Badge variant=\"outline\" className=\"max-w-full break-words rounded-full px-2 py-0 text-left text-xs font-semibold\">\n {roleTypeLabel}\n </Badge>\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleRemove}\n disabled={removing}\n aria-label={t('customers.roles.remove', 'Remove role')}\n >\n <X className=\"size-4\" />\n </IconButton>\n </div>\n\n <div className=\"mt-4 flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start\">\n <div className=\"flex size-11 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-bold text-muted-foreground\">\n {initials}\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"break-all text-sm font-semibold leading-5 text-foreground\">{displayName}</div>\n {role.userEmail ? (\n <div className=\"mt-1 break-all text-xs text-muted-foreground\">{role.userEmail}</div>\n ) : null}\n {assignedLabel ? (\n <div className=\"mt-2 text-overline uppercase tracking-[0.08em] text-muted-foreground\">\n {assignedLabel}\n </div>\n ) : null}\n </div>\n </div>\n\n <div className=\"mt-4 flex flex-wrap items-center gap-2\">\n {role.userEmail ? (\n <IconButton asChild variant=\"outline\" size=\"sm\" className=\"shrink-0\">\n <a href={`mailto:${role.userEmail}`} aria-label={t('customers.roles.email', 'Send email')}>\n <Mail className=\"size-4\" />\n </a>\n </IconButton>\n ) : (\n <IconButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"shrink-0\"\n disabled\n aria-label={t('customers.roles.emailUnavailable', 'Email unavailable')}\n >\n <Mail className=\"size-4\" />\n </IconButton>\n )}\n {role.userPhone ? (\n <IconButton asChild variant=\"outline\" size=\"sm\" className=\"shrink-0\">\n <a href={`tel:${role.userPhone}`} aria-label={t('customers.roles.call', 'Call')}>\n <Phone className=\"size-4\" />\n </a>\n </IconButton>\n ) : (\n <IconButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"shrink-0\"\n disabled\n aria-label={t('customers.roles.phoneUnavailable', 'Phone unavailable')}\n >\n <Phone className=\"size-4\" />\n </IconButton>\n )}\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-auto w-full justify-start px-2 py-1 text-xs sm:ml-auto sm:w-auto\"\n onClick={() => setChangingUser((current) => !current)}\n >\n {t('customers.roles.changeUser', 'Change user')}\n </Button>\n </div>\n\n {changingUser ? (\n <div className=\"mt-4 border-t pt-4\">\n <LookupSelect\n value={role.userId}\n onChange={async (userId) => {\n await handleUserChange(userId)\n }}\n fetchItems={searchUsers}\n options={currentUserOptions}\n placeholder={t('customers.roles.searchPlaceholder', 'Search team member...')}\n />\n </div>\n ) : null}\n </div>\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAmJI,mBAIM,KADF,YAHJ;AAjJJ,YA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