@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.
Files changed (687) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/generated/entities/action_log/index.js +8 -0
  3. package/dist/generated/entities/action_log/index.js.map +2 -2
  4. package/dist/generated/entities/customer_company_billing/index.js +23 -0
  5. package/dist/generated/entities/customer_company_billing/index.js.map +7 -0
  6. package/dist/generated/entities/customer_deal/index.js +8 -0
  7. package/dist/generated/entities/customer_deal/index.js.map +2 -2
  8. package/dist/generated/entities/customer_deal_stage_transition/index.js +31 -0
  9. package/dist/generated/entities/customer_deal_stage_transition/index.js.map +7 -0
  10. package/dist/generated/entities/customer_dictionary_kind_setting/index.js +21 -0
  11. package/dist/generated/entities/customer_dictionary_kind_setting/index.js.map +7 -0
  12. package/dist/generated/entities/customer_entity/index.js +8 -0
  13. package/dist/generated/entities/customer_entity/index.js.map +2 -2
  14. package/dist/generated/entities/customer_entity_role/index.js +23 -0
  15. package/dist/generated/entities/customer_entity_role/index.js.map +7 -0
  16. package/dist/generated/entities/customer_interaction/index.js +23 -1
  17. package/dist/generated/entities/customer_interaction/index.js.map +2 -2
  18. package/dist/generated/entities/customer_label/index.js +19 -0
  19. package/dist/generated/entities/customer_label/index.js.map +7 -0
  20. package/dist/generated/entities/customer_label_assignment/index.js +17 -0
  21. package/dist/generated/entities/customer_label_assignment/index.js.map +7 -0
  22. package/dist/generated/entities/customer_person_company_link/index.js +21 -0
  23. package/dist/generated/entities/customer_person_company_link/index.js.map +7 -0
  24. package/dist/generated/entities/customer_person_company_role/index.js +17 -0
  25. package/dist/generated/entities/customer_person_company_role/index.js.map +7 -0
  26. package/dist/generated/entities/dictionary_entry/index.js +4 -0
  27. package/dist/generated/entities/dictionary_entry/index.js.map +2 -2
  28. package/dist/generated/entities.ids.generated.js +9 -1
  29. package/dist/generated/entities.ids.generated.js.map +2 -2
  30. package/dist/generated/entity-fields-registry.js +116 -1
  31. package/dist/generated/entity-fields-registry.js.map +2 -2
  32. package/dist/modules/attachments/api/route.js +46 -8
  33. package/dist/modules/attachments/api/route.js.map +2 -2
  34. package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js +208 -0
  35. package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js.map +7 -0
  36. package/dist/modules/audit_logs/api/audit-logs/actions/route.js +52 -6
  37. package/dist/modules/audit_logs/api/audit-logs/actions/route.js.map +2 -2
  38. package/dist/modules/audit_logs/cli.js +62 -0
  39. package/dist/modules/audit_logs/cli.js.map +7 -0
  40. package/dist/modules/audit_logs/data/entities.js +21 -1
  41. package/dist/modules/audit_logs/data/entities.js.map +2 -2
  42. package/dist/modules/audit_logs/data/validators.js +9 -1
  43. package/dist/modules/audit_logs/data/validators.js.map +2 -2
  44. package/dist/modules/audit_logs/lib/changeRows.js +34 -0
  45. package/dist/modules/audit_logs/lib/changeRows.js.map +7 -0
  46. package/dist/modules/audit_logs/lib/display-helpers.js +2 -20
  47. package/dist/modules/audit_logs/lib/display-helpers.js.map +3 -3
  48. package/dist/modules/audit_logs/lib/projections.js +58 -0
  49. package/dist/modules/audit_logs/lib/projections.js.map +7 -0
  50. package/dist/modules/audit_logs/migrations/Migration20260412160533.js +21 -0
  51. package/dist/modules/audit_logs/migrations/Migration20260412160533.js.map +7 -0
  52. package/dist/modules/audit_logs/services/actionLogService.js +313 -79
  53. package/dist/modules/audit_logs/services/actionLogService.js.map +2 -2
  54. package/dist/modules/customers/acl.js +3 -1
  55. package/dist/modules/customers/acl.js.map +2 -2
  56. package/dist/modules/customers/api/activities/route.js +4 -0
  57. package/dist/modules/customers/api/activities/route.js.map +2 -2
  58. package/dist/modules/customers/api/assignable-staff/route.js +208 -0
  59. package/dist/modules/customers/api/assignable-staff/route.js.map +7 -0
  60. package/dist/modules/customers/api/companies/[id]/people/route.js +205 -0
  61. package/dist/modules/customers/api/companies/[id]/people/route.js.map +7 -0
  62. package/dist/modules/customers/api/companies/[id]/roles/route.js +22 -0
  63. package/dist/modules/customers/api/companies/[id]/roles/route.js.map +7 -0
  64. package/dist/modules/customers/api/companies/[id]/route.js +374 -32
  65. package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
  66. package/dist/modules/customers/api/companies/route.js +82 -7
  67. package/dist/modules/customers/api/companies/route.js.map +2 -2
  68. package/dist/modules/customers/api/deals/[id]/companies/route.js +172 -0
  69. package/dist/modules/customers/api/deals/[id]/companies/route.js.map +7 -0
  70. package/dist/modules/customers/api/deals/[id]/people/route.js +156 -0
  71. package/dist/modules/customers/api/deals/[id]/people/route.js.map +7 -0
  72. package/dist/modules/customers/api/deals/[id]/route.js +459 -53
  73. package/dist/modules/customers/api/deals/[id]/route.js.map +2 -2
  74. package/dist/modules/customers/api/deals/[id]/stats/route.js +195 -0
  75. package/dist/modules/customers/api/deals/[id]/stats/route.js.map +7 -0
  76. package/dist/modules/customers/api/deals/route.js +20 -10
  77. package/dist/modules/customers/api/deals/route.js.map +3 -3
  78. package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js +105 -4
  79. package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js.map +2 -2
  80. package/dist/modules/customers/api/dictionaries/[kind]/route.js +118 -42
  81. package/dist/modules/customers/api/dictionaries/[kind]/route.js.map +2 -2
  82. package/dist/modules/customers/api/dictionaries/context.js +30 -6
  83. package/dist/modules/customers/api/dictionaries/context.js.map +2 -2
  84. package/dist/modules/customers/api/dictionaries/kind-settings/route.js +207 -0
  85. package/dist/modules/customers/api/dictionaries/kind-settings/route.js.map +7 -0
  86. package/dist/modules/customers/api/entity-roles-factory.js +471 -0
  87. package/dist/modules/customers/api/entity-roles-factory.js.map +7 -0
  88. package/dist/modules/customers/api/interactions/conflicts/route.js +158 -0
  89. package/dist/modules/customers/api/interactions/conflicts/route.js.map +7 -0
  90. package/dist/modules/customers/api/interactions/counts/route.js +92 -0
  91. package/dist/modules/customers/api/interactions/counts/route.js.map +7 -0
  92. package/dist/modules/customers/api/interactions/route.js +83 -4
  93. package/dist/modules/customers/api/interactions/route.js.map +2 -2
  94. package/dist/modules/customers/api/labels/assign/route.js +189 -0
  95. package/dist/modules/customers/api/labels/assign/route.js.map +7 -0
  96. package/dist/modules/customers/api/labels/auth.js +17 -0
  97. package/dist/modules/customers/api/labels/auth.js.map +7 -0
  98. package/dist/modules/customers/api/labels/route.js +281 -0
  99. package/dist/modules/customers/api/labels/route.js.map +7 -0
  100. package/dist/modules/customers/api/labels/table-errors.js +38 -0
  101. package/dist/modules/customers/api/labels/table-errors.js.map +7 -0
  102. package/dist/modules/customers/api/labels/unassign/route.js +184 -0
  103. package/dist/modules/customers/api/labels/unassign/route.js.map +7 -0
  104. package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js +292 -0
  105. package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js.map +7 -0
  106. package/dist/modules/customers/api/people/[id]/companies/context.js +66 -0
  107. package/dist/modules/customers/api/people/[id]/companies/context.js.map +7 -0
  108. package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +334 -0
  109. package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +7 -0
  110. package/dist/modules/customers/api/people/[id]/companies/route.js +205 -0
  111. package/dist/modules/customers/api/people/[id]/companies/route.js.map +7 -0
  112. package/dist/modules/customers/api/people/[id]/roles/route.js +22 -0
  113. package/dist/modules/customers/api/people/[id]/roles/route.js.map +7 -0
  114. package/dist/modules/customers/api/people/[id]/route.js +134 -21
  115. package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
  116. package/dist/modules/customers/api/people/route.js +122 -23
  117. package/dist/modules/customers/api/people/route.js.map +2 -2
  118. package/dist/modules/customers/api/todos/route.js +4 -0
  119. package/dist/modules/customers/api/todos/route.js.map +2 -2
  120. package/dist/modules/customers/api/utils.js +22 -0
  121. package/dist/modules/customers/api/utils.js.map +2 -2
  122. package/dist/modules/customers/backend/config/customers/page.js +2 -6
  123. package/dist/modules/customers/backend/config/customers/page.js.map +2 -2
  124. package/dist/modules/customers/backend/customers/companies/page.js +37 -26
  125. package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
  126. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +265 -262
  127. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +3 -3
  128. package/dist/modules/customers/backend/customers/deals/[id]/hooks/formatters.js +23 -0
  129. package/dist/modules/customers/backend/customers/deals/[id]/hooks/formatters.js.map +7 -0
  130. package/dist/modules/customers/backend/customers/deals/[id]/hooks/types.js +1 -0
  131. package/dist/modules/customers/backend/customers/deals/[id]/hooks/types.js.map +7 -0
  132. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js +43 -0
  133. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js.map +7 -0
  134. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js +264 -0
  135. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js.map +7 -0
  136. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js +88 -0
  137. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js.map +7 -0
  138. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealData.js +41 -0
  139. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealData.js.map +7 -0
  140. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealFormHandlers.js +66 -0
  141. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealFormHandlers.js.map +7 -0
  142. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealInjectedTabs.js +39 -0
  143. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealInjectedTabs.js.map +7 -0
  144. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealMutationContext.js +49 -0
  145. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealMutationContext.js.map +7 -0
  146. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealPipeline.js +43 -0
  147. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealPipeline.js.map +7 -0
  148. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useScheduleDialog.js +28 -0
  149. package/dist/modules/customers/backend/customers/deals/[id]/hooks/useScheduleDialog.js.map +7 -0
  150. package/dist/modules/customers/backend/customers/deals/[id]/page.js +556 -503
  151. package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +3 -3
  152. package/dist/modules/customers/backend/customers/deals/page.js +66 -21
  153. package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
  154. package/dist/modules/customers/backend/customers/people/page.js +36 -28
  155. package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
  156. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +318 -203
  157. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +3 -3
  158. package/dist/modules/customers/cli.js +105 -13
  159. package/dist/modules/customers/cli.js.map +2 -2
  160. package/dist/modules/customers/commands/activities.js +6 -0
  161. package/dist/modules/customers/commands/activities.js.map +2 -2
  162. package/dist/modules/customers/commands/deals.js +315 -107
  163. package/dist/modules/customers/commands/deals.js.map +2 -2
  164. package/dist/modules/customers/commands/dictionaries.js +166 -32
  165. package/dist/modules/customers/commands/dictionaries.js.map +2 -2
  166. package/dist/modules/customers/commands/dictionaryKindSettings.js +208 -0
  167. package/dist/modules/customers/commands/dictionaryKindSettings.js.map +7 -0
  168. package/dist/modules/customers/commands/entity-roles.js +415 -0
  169. package/dist/modules/customers/commands/entity-roles.js.map +7 -0
  170. package/dist/modules/customers/commands/index.js +4 -0
  171. package/dist/modules/customers/commands/index.js.map +2 -2
  172. package/dist/modules/customers/commands/interactions.js +108 -21
  173. package/dist/modules/customers/commands/interactions.js.map +2 -2
  174. package/dist/modules/customers/commands/labels.js +539 -0
  175. package/dist/modules/customers/commands/labels.js.map +7 -0
  176. package/dist/modules/customers/commands/people.js +560 -463
  177. package/dist/modules/customers/commands/people.js.map +3 -3
  178. package/dist/modules/customers/commands/personCompanyLinks.js +568 -0
  179. package/dist/modules/customers/commands/personCompanyLinks.js.map +7 -0
  180. package/dist/modules/customers/commands/shared.js +12 -4
  181. package/dist/modules/customers/commands/shared.js.map +2 -2
  182. package/dist/modules/customers/commands/todos.js +10 -1
  183. package/dist/modules/customers/commands/todos.js.map +2 -2
  184. package/dist/modules/customers/components/AddressEditor.js +1 -1
  185. package/dist/modules/customers/components/AddressEditor.js.map +2 -2
  186. package/dist/modules/customers/components/CustomersConfigurationSections.js +31 -0
  187. package/dist/modules/customers/components/CustomersConfigurationSections.js.map +7 -0
  188. package/dist/modules/customers/components/DictionarySettings.js +37 -2
  189. package/dist/modules/customers/components/DictionarySettings.js.map +2 -2
  190. package/dist/modules/customers/components/detail/ActiveDealCard.js +121 -0
  191. package/dist/modules/customers/components/detail/ActiveDealCard.js.map +7 -0
  192. package/dist/modules/customers/components/detail/ActivitiesSection.js +222 -331
  193. package/dist/modules/customers/components/detail/ActivitiesSection.js.map +3 -3
  194. package/dist/modules/customers/components/detail/ActivityAiActions.js +36 -0
  195. package/dist/modules/customers/components/detail/ActivityAiActions.js.map +7 -0
  196. package/dist/modules/customers/components/detail/ActivityCard.js +126 -0
  197. package/dist/modules/customers/components/detail/ActivityCard.js.map +7 -0
  198. package/dist/modules/customers/components/detail/ActivityHistorySection.js +340 -0
  199. package/dist/modules/customers/components/detail/ActivityHistorySection.js.map +7 -0
  200. package/dist/modules/customers/components/detail/ActivityLogTab.js +56 -0
  201. package/dist/modules/customers/components/detail/ActivityLogTab.js.map +7 -0
  202. package/dist/modules/customers/components/detail/ActivityTimeline.js +108 -0
  203. package/dist/modules/customers/components/detail/ActivityTimeline.js.map +7 -0
  204. package/dist/modules/customers/components/detail/ActivityTimelineFilters.js +139 -0
  205. package/dist/modules/customers/components/detail/ActivityTimelineFilters.js.map +7 -0
  206. package/dist/modules/customers/components/detail/ActivityTypeSelector.js +42 -0
  207. package/dist/modules/customers/components/detail/ActivityTypeSelector.js.map +7 -0
  208. package/dist/modules/customers/components/detail/AiActionChips.js +38 -0
  209. package/dist/modules/customers/components/detail/AiActionChips.js.map +7 -0
  210. package/dist/modules/customers/components/detail/AssignRoleDialog.js +534 -0
  211. package/dist/modules/customers/components/detail/AssignRoleDialog.js.map +7 -0
  212. package/dist/modules/customers/components/detail/ChangelogEntryRow.js +79 -0
  213. package/dist/modules/customers/components/detail/ChangelogEntryRow.js.map +7 -0
  214. package/dist/modules/customers/components/detail/ChangelogFilters.js +176 -0
  215. package/dist/modules/customers/components/detail/ChangelogFilters.js.map +7 -0
  216. package/dist/modules/customers/components/detail/ChangelogKpiCards.js +88 -0
  217. package/dist/modules/customers/components/detail/ChangelogKpiCards.js.map +7 -0
  218. package/dist/modules/customers/components/detail/ChangelogTab.js +470 -0
  219. package/dist/modules/customers/components/detail/ChangelogTab.js.map +7 -0
  220. package/dist/modules/customers/components/detail/ComingSoonPlaceholder.js +16 -0
  221. package/dist/modules/customers/components/detail/ComingSoonPlaceholder.js.map +7 -0
  222. package/dist/modules/customers/components/detail/CompanyCard.js +283 -0
  223. package/dist/modules/customers/components/detail/CompanyCard.js.map +7 -0
  224. package/dist/modules/customers/components/detail/CompanyDashboardTab.js +133 -0
  225. package/dist/modules/customers/components/detail/CompanyDashboardTab.js.map +7 -0
  226. package/dist/modules/customers/components/detail/CompanyDetailHeader.js +191 -0
  227. package/dist/modules/customers/components/detail/CompanyDetailHeader.js.map +7 -0
  228. package/dist/modules/customers/components/detail/CompanyDetailTabs.js +123 -0
  229. package/dist/modules/customers/components/detail/CompanyDetailTabs.js.map +7 -0
  230. package/dist/modules/customers/components/detail/CompanyKpiBar.js +174 -0
  231. package/dist/modules/customers/components/detail/CompanyKpiBar.js.map +7 -0
  232. package/dist/modules/customers/components/detail/CompanyPeopleSection.js +514 -230
  233. package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
  234. package/dist/modules/customers/components/detail/CompanyTagsDialog.js +22 -0
  235. package/dist/modules/customers/components/detail/CompanyTagsDialog.js.map +7 -0
  236. package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js +159 -0
  237. package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js.map +7 -0
  238. package/dist/modules/customers/components/detail/CreatePersonDialog.js +135 -0
  239. package/dist/modules/customers/components/detail/CreatePersonDialog.js.map +7 -0
  240. package/dist/modules/customers/components/detail/DealClosureActionBar.js +59 -0
  241. package/dist/modules/customers/components/detail/DealClosureActionBar.js.map +7 -0
  242. package/dist/modules/customers/components/detail/DealDetailHeader.js +237 -0
  243. package/dist/modules/customers/components/detail/DealDetailHeader.js.map +7 -0
  244. package/dist/modules/customers/components/detail/DealDetailTabs.js +109 -0
  245. package/dist/modules/customers/components/detail/DealDetailTabs.js.map +7 -0
  246. package/dist/modules/customers/components/detail/DealForm.js +219 -92
  247. package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
  248. package/dist/modules/customers/components/detail/DealLinkedEntitiesTab.js +295 -0
  249. package/dist/modules/customers/components/detail/DealLinkedEntitiesTab.js.map +7 -0
  250. package/dist/modules/customers/components/detail/DealLostSummaryDialog.js +107 -0
  251. package/dist/modules/customers/components/detail/DealLostSummaryDialog.js.map +7 -0
  252. package/dist/modules/customers/components/detail/DealWonPopup.js +113 -0
  253. package/dist/modules/customers/components/detail/DealWonPopup.js.map +7 -0
  254. package/dist/modules/customers/components/detail/DealsSection.js +206 -193
  255. package/dist/modules/customers/components/detail/DealsSection.js.map +2 -2
  256. package/dist/modules/customers/components/detail/DecisionMakersFooter.js +39 -0
  257. package/dist/modules/customers/components/detail/DecisionMakersFooter.js.map +7 -0
  258. package/dist/modules/customers/components/detail/EntityTagsDialog.js +1096 -0
  259. package/dist/modules/customers/components/detail/EntityTagsDialog.js.map +7 -0
  260. package/dist/modules/customers/components/detail/InlineActivityComposer.js +197 -0
  261. package/dist/modules/customers/components/detail/InlineActivityComposer.js.map +7 -0
  262. package/dist/modules/customers/components/detail/ManageTagsDialog.js +1091 -0
  263. package/dist/modules/customers/components/detail/ManageTagsDialog.js.map +7 -0
  264. package/dist/modules/customers/components/detail/MiniWeekCalendar.js +272 -0
  265. package/dist/modules/customers/components/detail/MiniWeekCalendar.js.map +7 -0
  266. package/dist/modules/customers/components/detail/MobilePersonDetail.js +106 -0
  267. package/dist/modules/customers/components/detail/MobilePersonDetail.js.map +7 -0
  268. package/dist/modules/customers/components/detail/NextStepCard.js +72 -0
  269. package/dist/modules/customers/components/detail/NextStepCard.js.map +7 -0
  270. package/dist/modules/customers/components/detail/PersonCard.js +192 -0
  271. package/dist/modules/customers/components/detail/PersonCard.js.map +7 -0
  272. package/dist/modules/customers/components/detail/PersonCompaniesSection.js +345 -0
  273. package/dist/modules/customers/components/detail/PersonCompaniesSection.js.map +7 -0
  274. package/dist/modules/customers/components/detail/PersonDetailHeader.js +220 -0
  275. package/dist/modules/customers/components/detail/PersonDetailHeader.js.map +7 -0
  276. package/dist/modules/customers/components/detail/PersonDetailTabs.js +122 -0
  277. package/dist/modules/customers/components/detail/PersonDetailTabs.js.map +7 -0
  278. package/dist/modules/customers/components/detail/PersonTagsDialog.js +24 -0
  279. package/dist/modules/customers/components/detail/PersonTagsDialog.js.map +7 -0
  280. package/dist/modules/customers/components/detail/PipelineStepper.js +191 -0
  281. package/dist/modules/customers/components/detail/PipelineStepper.js.map +7 -0
  282. package/dist/modules/customers/components/detail/PlannedActivitiesSection.js +222 -0
  283. package/dist/modules/customers/components/detail/PlannedActivitiesSection.js.map +7 -0
  284. package/dist/modules/customers/components/detail/RelationshipHealthCard.js +49 -0
  285. package/dist/modules/customers/components/detail/RelationshipHealthCard.js.map +7 -0
  286. package/dist/modules/customers/components/detail/RoleAssignmentRow.js +189 -0
  287. package/dist/modules/customers/components/detail/RoleAssignmentRow.js.map +7 -0
  288. package/dist/modules/customers/components/detail/RolesSection.js +234 -0
  289. package/dist/modules/customers/components/detail/RolesSection.js.map +7 -0
  290. package/dist/modules/customers/components/detail/ScheduleActivityDialog.js +410 -0
  291. package/dist/modules/customers/components/detail/ScheduleActivityDialog.js.map +7 -0
  292. package/dist/modules/customers/components/detail/aiActionCatalog.js +41 -0
  293. package/dist/modules/customers/components/detail/aiActionCatalog.js.map +7 -0
  294. package/dist/modules/customers/components/detail/assignableStaff.js +48 -0
  295. package/dist/modules/customers/components/detail/assignableStaff.js.map +7 -0
  296. package/dist/modules/customers/components/detail/dashboard/ActiveDealWidget.js +48 -0
  297. package/dist/modules/customers/components/detail/dashboard/ActiveDealWidget.js.map +7 -0
  298. package/dist/modules/customers/components/detail/dashboard/OpenTasksWidget.js +86 -0
  299. package/dist/modules/customers/components/detail/dashboard/OpenTasksWidget.js.map +7 -0
  300. package/dist/modules/customers/components/detail/dashboard/RecentActivityWidget.js +53 -0
  301. package/dist/modules/customers/components/detail/dashboard/RecentActivityWidget.js.map +7 -0
  302. package/dist/modules/customers/components/detail/dashboard/RelationshipHealthWidget.js +30 -0
  303. package/dist/modules/customers/components/detail/dashboard/RelationshipHealthWidget.js.map +7 -0
  304. package/dist/modules/customers/components/detail/dashboard/UpcomingMeetingsWidget.js +43 -0
  305. package/dist/modules/customers/components/detail/dashboard/UpcomingMeetingsWidget.js.map +7 -0
  306. package/dist/modules/customers/components/detail/dashboard/helpers.js +71 -0
  307. package/dist/modules/customers/components/detail/dashboard/helpers.js.map +7 -0
  308. package/dist/modules/customers/components/detail/healthScoreUtils.js +69 -0
  309. package/dist/modules/customers/components/detail/healthScoreUtils.js.map +7 -0
  310. package/dist/modules/customers/components/detail/hooks/useCurrencyDictionary.js +5 -5
  311. package/dist/modules/customers/components/detail/hooks/useCurrencyDictionary.js.map +2 -2
  312. package/dist/modules/customers/components/detail/hooks/useCustomerDictionary.js +9 -8
  313. package/dist/modules/customers/components/detail/hooks/useCustomerDictionary.js.map +3 -3
  314. package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js +65 -0
  315. package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js.map +7 -0
  316. package/dist/modules/customers/components/detail/notesAdapter.js +70 -30
  317. package/dist/modules/customers/components/detail/notesAdapter.js.map +2 -2
  318. package/dist/modules/customers/components/detail/pipelineStageUtils.js +26 -0
  319. package/dist/modules/customers/components/detail/pipelineStageUtils.js.map +7 -0
  320. package/dist/modules/customers/components/detail/schedule/DateTimeFields.js +144 -0
  321. package/dist/modules/customers/components/detail/schedule/DateTimeFields.js.map +7 -0
  322. package/dist/modules/customers/components/detail/schedule/FooterFields.js +60 -0
  323. package/dist/modules/customers/components/detail/schedule/FooterFields.js.map +7 -0
  324. package/dist/modules/customers/components/detail/schedule/LinkedEntitiesField.js +216 -0
  325. package/dist/modules/customers/components/detail/schedule/LinkedEntitiesField.js.map +7 -0
  326. package/dist/modules/customers/components/detail/schedule/LocationField.js +34 -0
  327. package/dist/modules/customers/components/detail/schedule/LocationField.js.map +7 -0
  328. package/dist/modules/customers/components/detail/schedule/ParticipantsField.js +226 -0
  329. package/dist/modules/customers/components/detail/schedule/ParticipantsField.js.map +7 -0
  330. package/dist/modules/customers/components/detail/schedule/fieldConfig.js +69 -0
  331. package/dist/modules/customers/components/detail/schedule/fieldConfig.js.map +7 -0
  332. package/dist/modules/customers/components/detail/schedule/index.js +21 -0
  333. package/dist/modules/customers/components/detail/schedule/index.js.map +7 -0
  334. package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js +172 -0
  335. package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js.map +7 -0
  336. package/dist/modules/customers/components/detail/utils.js +23 -0
  337. package/dist/modules/customers/components/detail/utils.js.map +2 -2
  338. package/dist/modules/customers/components/formConfig.js +144 -22
  339. package/dist/modules/customers/components/formConfig.js.map +2 -2
  340. package/dist/modules/customers/components/linking/LinkEntityDialog.js +661 -0
  341. package/dist/modules/customers/components/linking/LinkEntityDialog.js.map +7 -0
  342. package/dist/modules/customers/components/linking/adapters/companyAdapter.js +252 -0
  343. package/dist/modules/customers/components/linking/adapters/companyAdapter.js.map +7 -0
  344. package/dist/modules/customers/components/linking/adapters/dealAdapter.js +384 -0
  345. package/dist/modules/customers/components/linking/adapters/dealAdapter.js.map +7 -0
  346. package/dist/modules/customers/components/linking/adapters/personAdapter.js +324 -0
  347. package/dist/modules/customers/components/linking/adapters/personAdapter.js.map +7 -0
  348. package/dist/modules/customers/components/list/CollectionPreviewCell.js +53 -0
  349. package/dist/modules/customers/components/list/CollectionPreviewCell.js.map +7 -0
  350. package/dist/modules/customers/data/entities.js +407 -1
  351. package/dist/modules/customers/data/entities.js.map +2 -2
  352. package/dist/modules/customers/data/validators.js +139 -21
  353. package/dist/modules/customers/data/validators.js.map +2 -2
  354. package/dist/modules/customers/events.js +19 -1
  355. package/dist/modules/customers/events.js.map +2 -2
  356. package/dist/modules/customers/lib/customerRoleTypes.js +19 -0
  357. package/dist/modules/customers/lib/customerRoleTypes.js.map +7 -0
  358. package/dist/modules/customers/lib/dealClosureNotification.js +39 -0
  359. package/dist/modules/customers/lib/dealClosureNotification.js.map +7 -0
  360. package/dist/modules/customers/lib/dealStageTransitionTable.js +29 -0
  361. package/dist/modules/customers/lib/dealStageTransitionTable.js.map +7 -0
  362. package/dist/modules/customers/lib/dictionaries.js +25 -0
  363. package/dist/modules/customers/lib/dictionaries.js.map +2 -2
  364. package/dist/modules/customers/lib/interactionReadModel.js +10 -0
  365. package/dist/modules/customers/lib/interactionReadModel.js.map +2 -2
  366. package/dist/modules/customers/lib/personCompanies.js +235 -0
  367. package/dist/modules/customers/lib/personCompanies.js.map +7 -0
  368. package/dist/modules/customers/lib/personCompanyLinkTable.js +42 -0
  369. package/dist/modules/customers/lib/personCompanyLinkTable.js.map +7 -0
  370. package/dist/modules/customers/lib/roleTypeUsage.js +104 -0
  371. package/dist/modules/customers/lib/roleTypeUsage.js.map +7 -0
  372. package/dist/modules/customers/migrations/Migration20260406214502.js +18 -0
  373. package/dist/modules/customers/migrations/Migration20260406214502.js.map +7 -0
  374. package/dist/modules/customers/migrations/Migration20260408135736.js +17 -0
  375. package/dist/modules/customers/migrations/Migration20260408135736.js.map +7 -0
  376. package/dist/modules/customers/migrations/Migration20260408225345.js +21 -0
  377. package/dist/modules/customers/migrations/Migration20260408225345.js.map +7 -0
  378. package/dist/modules/customers/migrations/Migration20260411075533.js +27 -0
  379. package/dist/modules/customers/migrations/Migration20260411075533.js.map +7 -0
  380. package/dist/modules/customers/migrations/Migration20260411103551.js +13 -0
  381. package/dist/modules/customers/migrations/Migration20260411103551.js.map +7 -0
  382. package/dist/modules/customers/migrations/Migration20260411130944.js +26 -0
  383. package/dist/modules/customers/migrations/Migration20260411130944.js.map +7 -0
  384. package/dist/modules/customers/migrations/Migration20260415095203.js +13 -0
  385. package/dist/modules/customers/migrations/Migration20260415095203.js.map +7 -0
  386. package/dist/modules/customers/migrations/Migration20260415135056.js +20 -0
  387. package/dist/modules/customers/migrations/Migration20260415135056.js.map +7 -0
  388. package/dist/modules/customers/migrations/Migration20260417140000.js +15 -0
  389. package/dist/modules/customers/migrations/Migration20260417140000.js.map +7 -0
  390. package/dist/modules/customers/migrations/Migration20260417160000.js +17 -0
  391. package/dist/modules/customers/migrations/Migration20260417160000.js.map +7 -0
  392. package/dist/modules/customers/migrations/Migration20260417235407.js +13 -0
  393. package/dist/modules/customers/migrations/Migration20260417235407.js.map +7 -0
  394. package/dist/modules/customers/setup.js +16 -1
  395. package/dist/modules/customers/setup.js.map +2 -2
  396. package/dist/modules/customers/subscribers/deal-closure-notification.js +16 -0
  397. package/dist/modules/customers/subscribers/deal-closure-notification.js.map +7 -0
  398. package/dist/modules/customers/subscribers/deal-lost-notification.js +16 -0
  399. package/dist/modules/customers/subscribers/deal-lost-notification.js.map +7 -0
  400. package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js +2 -0
  401. package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js.map +2 -2
  402. package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js +154 -0
  403. package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js.map +7 -0
  404. package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +6 -2
  405. package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
  406. package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js +154 -0
  407. package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js.map +7 -0
  408. package/dist/modules/dictionaries/api/context.js +8 -1
  409. package/dist/modules/dictionaries/api/context.js.map +2 -2
  410. package/dist/modules/dictionaries/api/openapi.js +18 -1
  411. package/dist/modules/dictionaries/api/openapi.js.map +2 -2
  412. package/dist/modules/dictionaries/commands/entry-operations.js +388 -0
  413. package/dist/modules/dictionaries/commands/entry-operations.js.map +7 -0
  414. package/dist/modules/dictionaries/commands/factory.js +24 -3
  415. package/dist/modules/dictionaries/commands/factory.js.map +2 -2
  416. package/dist/modules/dictionaries/commands/index.js +1 -0
  417. package/dist/modules/dictionaries/commands/index.js.map +2 -2
  418. package/dist/modules/dictionaries/components/DictionaryTable.js +6 -3
  419. package/dist/modules/dictionaries/components/DictionaryTable.js.map +2 -2
  420. package/dist/modules/dictionaries/data/entities.js +11 -1
  421. package/dist/modules/dictionaries/data/entities.js.map +2 -2
  422. package/dist/modules/dictionaries/data/validators.js +28 -2
  423. package/dist/modules/dictionaries/data/validators.js.map +2 -2
  424. package/dist/modules/dictionaries/events.js +18 -0
  425. package/dist/modules/dictionaries/events.js.map +7 -0
  426. package/dist/modules/dictionaries/lib/clientEntries.js +43 -0
  427. package/dist/modules/dictionaries/lib/clientEntries.js.map +7 -0
  428. package/dist/modules/dictionaries/migrations/Migration20260410171544.js +45 -0
  429. package/dist/modules/dictionaries/migrations/Migration20260410171544.js.map +7 -0
  430. package/dist/modules/inbox_ops/api/proposals/[id]/route.js +4 -1
  431. package/dist/modules/inbox_ops/api/proposals/[id]/route.js.map +2 -2
  432. package/dist/modules/query_index/lib/engine.js +1 -1
  433. package/dist/modules/query_index/lib/engine.js.map +2 -2
  434. package/dist/modules/sales/components/documents/AddressesSection.js +82 -42
  435. package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
  436. package/dist/modules/sales/lib/dictionaries.js +16 -0
  437. package/dist/modules/sales/lib/dictionaries.js.map +2 -2
  438. package/dist/modules/sales/widgets/injection-table.js +5 -1
  439. package/dist/modules/sales/widgets/injection-table.js.map +2 -2
  440. package/generated/entities/action_log/index.ts +4 -0
  441. package/generated/entities/customer_company_billing/index.ts +10 -0
  442. package/generated/entities/customer_deal/index.ts +4 -0
  443. package/generated/entities/customer_deal_stage_transition/index.ts +14 -0
  444. package/generated/entities/customer_dictionary_kind_setting/index.ts +9 -0
  445. package/generated/entities/customer_entity/index.ts +4 -0
  446. package/generated/entities/customer_entity_role/index.ts +10 -0
  447. package/generated/entities/customer_interaction/index.ts +11 -0
  448. package/generated/entities/customer_label/index.ts +8 -0
  449. package/generated/entities/customer_label_assignment/index.ts +7 -0
  450. package/generated/entities/customer_person_company_link/index.ts +9 -0
  451. package/generated/entities/customer_person_company_role/index.ts +7 -0
  452. package/generated/entities/dictionary_entry/index.ts +2 -0
  453. package/generated/entities.ids.generated.ts +9 -1
  454. package/generated/entity-fields-registry.ts +116 -1
  455. package/package.json +3 -3
  456. package/src/modules/attachments/api/route.ts +48 -6
  457. package/src/modules/attachments/i18n/de.json +4 -0
  458. package/src/modules/attachments/i18n/en.json +4 -0
  459. package/src/modules/attachments/i18n/es.json +4 -0
  460. package/src/modules/attachments/i18n/pl.json +4 -0
  461. package/src/modules/audit_logs/api/audit-logs/actions/export/route.ts +260 -0
  462. package/src/modules/audit_logs/api/audit-logs/actions/route.ts +81 -6
  463. package/src/modules/audit_logs/cli.ts +79 -0
  464. package/src/modules/audit_logs/data/entities.ts +17 -0
  465. package/src/modules/audit_logs/data/validators.ts +9 -1
  466. package/src/modules/audit_logs/lib/changeRows.ts +47 -0
  467. package/src/modules/audit_logs/lib/display-helpers.tsx +4 -30
  468. package/src/modules/audit_logs/lib/projections.ts +110 -0
  469. package/src/modules/audit_logs/migrations/.snapshot-open-mercato.json +325 -2
  470. package/src/modules/audit_logs/migrations/Migration20260412160533.ts +21 -0
  471. package/src/modules/audit_logs/services/actionLogService.ts +455 -85
  472. package/src/modules/catalog/i18n/de.json +1 -0
  473. package/src/modules/catalog/i18n/en.json +1 -0
  474. package/src/modules/catalog/i18n/es.json +1 -0
  475. package/src/modules/catalog/i18n/pl.json +1 -0
  476. package/src/modules/customer_accounts/i18n/de.json +2 -0
  477. package/src/modules/customer_accounts/i18n/en.json +2 -0
  478. package/src/modules/customer_accounts/i18n/es.json +2 -0
  479. package/src/modules/customer_accounts/i18n/pl.json +2 -0
  480. package/src/modules/customers/acl.ts +2 -0
  481. package/src/modules/customers/api/activities/route.ts +4 -0
  482. package/src/modules/customers/api/assignable-staff/route.ts +250 -0
  483. package/src/modules/customers/api/companies/[id]/people/route.ts +244 -0
  484. package/src/modules/customers/api/companies/[id]/roles/route.ts +15 -0
  485. package/src/modules/customers/api/companies/[id]/route.ts +458 -40
  486. package/src/modules/customers/api/companies/route.ts +93 -15
  487. package/src/modules/customers/api/deals/[id]/companies/route.ts +203 -0
  488. package/src/modules/customers/api/deals/[id]/people/route.ts +182 -0
  489. package/src/modules/customers/api/deals/[id]/route.ts +554 -57
  490. package/src/modules/customers/api/deals/[id]/stats/route.ts +221 -0
  491. package/src/modules/customers/api/deals/route.ts +35 -46
  492. package/src/modules/customers/api/dictionaries/[kind]/[id]/route.ts +105 -3
  493. package/src/modules/customers/api/dictionaries/[kind]/route.ts +143 -44
  494. package/src/modules/customers/api/dictionaries/context.ts +45 -16
  495. package/src/modules/customers/api/dictionaries/kind-settings/route.ts +232 -0
  496. package/src/modules/customers/api/entity-roles-factory.ts +520 -0
  497. package/src/modules/customers/api/interactions/conflicts/route.ts +196 -0
  498. package/src/modules/customers/api/interactions/counts/route.ts +112 -0
  499. package/src/modules/customers/api/interactions/route.ts +95 -2
  500. package/src/modules/customers/api/labels/assign/route.ts +202 -0
  501. package/src/modules/customers/api/labels/auth.ts +19 -0
  502. package/src/modules/customers/api/labels/route.ts +310 -0
  503. package/src/modules/customers/api/labels/table-errors.ts +36 -0
  504. package/src/modules/customers/api/labels/unassign/route.ts +197 -0
  505. package/src/modules/customers/api/people/[id]/companies/[linkId]/route.ts +331 -0
  506. package/src/modules/customers/api/people/[id]/companies/context.ts +70 -0
  507. package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +384 -0
  508. package/src/modules/customers/api/people/[id]/companies/route.ts +215 -0
  509. package/src/modules/customers/api/people/[id]/roles/route.ts +15 -0
  510. package/src/modules/customers/api/people/[id]/route.ts +153 -26
  511. package/src/modules/customers/api/people/route.ts +134 -31
  512. package/src/modules/customers/api/todos/route.ts +4 -0
  513. package/src/modules/customers/api/utils.ts +36 -0
  514. package/src/modules/customers/backend/config/customers/page.tsx +2 -6
  515. package/src/modules/customers/backend/customers/companies/page.tsx +36 -26
  516. package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +277 -262
  517. package/src/modules/customers/backend/customers/deals/[id]/hooks/formatters.ts +19 -0
  518. package/src/modules/customers/backend/customers/deals/[id]/hooks/types.ts +104 -0
  519. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.ts +60 -0
  520. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.ts +362 -0
  521. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.ts +113 -0
  522. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealData.ts +52 -0
  523. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealFormHandlers.ts +86 -0
  524. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealInjectedTabs.tsx +60 -0
  525. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealMutationContext.ts +76 -0
  526. package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealPipeline.ts +56 -0
  527. package/src/modules/customers/backend/customers/deals/[id]/hooks/useScheduleDialog.ts +38 -0
  528. package/src/modules/customers/backend/customers/deals/[id]/page.tsx +587 -624
  529. package/src/modules/customers/backend/customers/deals/page.tsx +71 -28
  530. package/src/modules/customers/backend/customers/people/page.tsx +35 -29
  531. package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +343 -209
  532. package/src/modules/customers/cli.ts +107 -12
  533. package/src/modules/customers/commands/activities.ts +13 -0
  534. package/src/modules/customers/commands/deals.ts +386 -114
  535. package/src/modules/customers/commands/dictionaries.ts +175 -32
  536. package/src/modules/customers/commands/dictionaryKindSettings.ts +268 -0
  537. package/src/modules/customers/commands/entity-roles.ts +494 -0
  538. package/src/modules/customers/commands/index.ts +4 -0
  539. package/src/modules/customers/commands/interactions.ts +125 -21
  540. package/src/modules/customers/commands/labels.ts +626 -0
  541. package/src/modules/customers/commands/people.ts +373 -259
  542. package/src/modules/customers/commands/personCompanyLinks.ts +654 -0
  543. package/src/modules/customers/commands/shared.ts +16 -15
  544. package/src/modules/customers/commands/todos.ts +17 -1
  545. package/src/modules/customers/components/AddressEditor.tsx +1 -1
  546. package/src/modules/customers/components/CustomersConfigurationSections.tsx +36 -0
  547. package/src/modules/customers/components/DictionarySettings.tsx +43 -2
  548. package/src/modules/customers/components/detail/ActiveDealCard.tsx +175 -0
  549. package/src/modules/customers/components/detail/ActivitiesSection.tsx +267 -361
  550. package/src/modules/customers/components/detail/ActivityAiActions.tsx +49 -0
  551. package/src/modules/customers/components/detail/ActivityCard.tsx +154 -0
  552. package/src/modules/customers/components/detail/ActivityHistorySection.tsx +412 -0
  553. package/src/modules/customers/components/detail/ActivityLogTab.tsx +67 -0
  554. package/src/modules/customers/components/detail/ActivityTimeline.tsx +158 -0
  555. package/src/modules/customers/components/detail/ActivityTimelineFilters.tsx +163 -0
  556. package/src/modules/customers/components/detail/ActivityTypeSelector.tsx +53 -0
  557. package/src/modules/customers/components/detail/AiActionChips.tsx +48 -0
  558. package/src/modules/customers/components/detail/AssignRoleDialog.tsx +672 -0
  559. package/src/modules/customers/components/detail/ChangelogEntryRow.tsx +132 -0
  560. package/src/modules/customers/components/detail/ChangelogFilters.tsx +193 -0
  561. package/src/modules/customers/components/detail/ChangelogKpiCards.tsx +107 -0
  562. package/src/modules/customers/components/detail/ChangelogTab.tsx +629 -0
  563. package/src/modules/customers/components/detail/ComingSoonPlaceholder.tsx +21 -0
  564. package/src/modules/customers/components/detail/CompanyCard.tsx +419 -0
  565. package/src/modules/customers/components/detail/CompanyDashboardTab.tsx +161 -0
  566. package/src/modules/customers/components/detail/CompanyDetailHeader.tsx +243 -0
  567. package/src/modules/customers/components/detail/CompanyDetailTabs.tsx +172 -0
  568. package/src/modules/customers/components/detail/CompanyKpiBar.tsx +206 -0
  569. package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +582 -288
  570. package/src/modules/customers/components/detail/CompanyTagsDialog.tsx +23 -0
  571. package/src/modules/customers/components/detail/ConfirmDealLostDialog.tsx +210 -0
  572. package/src/modules/customers/components/detail/CreatePersonDialog.tsx +178 -0
  573. package/src/modules/customers/components/detail/DealClosureActionBar.tsx +63 -0
  574. package/src/modules/customers/components/detail/DealDetailHeader.tsx +335 -0
  575. package/src/modules/customers/components/detail/DealDetailTabs.tsx +154 -0
  576. package/src/modules/customers/components/detail/DealForm.tsx +253 -101
  577. package/src/modules/customers/components/detail/DealLinkedEntitiesTab.tsx +349 -0
  578. package/src/modules/customers/components/detail/DealLostSummaryDialog.tsx +156 -0
  579. package/src/modules/customers/components/detail/DealWonPopup.tsx +164 -0
  580. package/src/modules/customers/components/detail/DealsSection.tsx +276 -221
  581. package/src/modules/customers/components/detail/DecisionMakersFooter.tsx +56 -0
  582. package/src/modules/customers/components/detail/EntityTagsDialog.tsx +1372 -0
  583. package/src/modules/customers/components/detail/InlineActivityComposer.tsx +239 -0
  584. package/src/modules/customers/components/detail/ManageTagsDialog.tsx +1331 -0
  585. package/src/modules/customers/components/detail/MiniWeekCalendar.tsx +338 -0
  586. package/src/modules/customers/components/detail/MobilePersonDetail.tsx +124 -0
  587. package/src/modules/customers/components/detail/NextStepCard.tsx +104 -0
  588. package/src/modules/customers/components/detail/PersonCard.tsx +238 -0
  589. package/src/modules/customers/components/detail/PersonCompaniesSection.tsx +426 -0
  590. package/src/modules/customers/components/detail/PersonDetailHeader.tsx +294 -0
  591. package/src/modules/customers/components/detail/PersonDetailTabs.tsx +172 -0
  592. package/src/modules/customers/components/detail/PersonTagsDialog.tsx +26 -0
  593. package/src/modules/customers/components/detail/PipelineStepper.tsx +245 -0
  594. package/src/modules/customers/components/detail/PlannedActivitiesSection.tsx +255 -0
  595. package/src/modules/customers/components/detail/RelationshipHealthCard.tsx +63 -0
  596. package/src/modules/customers/components/detail/RoleAssignmentRow.tsx +248 -0
  597. package/src/modules/customers/components/detail/RolesSection.tsx +311 -0
  598. package/src/modules/customers/components/detail/ScheduleActivityDialog.tsx +481 -0
  599. package/src/modules/customers/components/detail/aiActionCatalog.ts +77 -0
  600. package/src/modules/customers/components/detail/assignableStaff.ts +124 -0
  601. package/src/modules/customers/components/detail/dashboard/ActiveDealWidget.tsx +63 -0
  602. package/src/modules/customers/components/detail/dashboard/OpenTasksWidget.tsx +114 -0
  603. package/src/modules/customers/components/detail/dashboard/RecentActivityWidget.tsx +69 -0
  604. package/src/modules/customers/components/detail/dashboard/RelationshipHealthWidget.tsx +40 -0
  605. package/src/modules/customers/components/detail/dashboard/UpcomingMeetingsWidget.tsx +64 -0
  606. package/src/modules/customers/components/detail/dashboard/helpers.ts +78 -0
  607. package/src/modules/customers/components/detail/healthScoreUtils.ts +91 -0
  608. package/src/modules/customers/components/detail/hooks/useCurrencyDictionary.ts +8 -8
  609. package/src/modules/customers/components/detail/hooks/useCustomerDictionary.ts +10 -6
  610. package/src/modules/customers/components/detail/hooks/useInteractionMutations.ts +91 -0
  611. package/src/modules/customers/components/detail/notesAdapter.ts +91 -30
  612. package/src/modules/customers/components/detail/pipelineStageUtils.ts +29 -0
  613. package/src/modules/customers/components/detail/schedule/DateTimeFields.tsx +187 -0
  614. package/src/modules/customers/components/detail/schedule/FooterFields.tsx +79 -0
  615. package/src/modules/customers/components/detail/schedule/LinkedEntitiesField.tsx +277 -0
  616. package/src/modules/customers/components/detail/schedule/LocationField.tsx +42 -0
  617. package/src/modules/customers/components/detail/schedule/ParticipantsField.tsx +255 -0
  618. package/src/modules/customers/components/detail/schedule/fieldConfig.ts +70 -0
  619. package/src/modules/customers/components/detail/schedule/index.ts +9 -0
  620. package/src/modules/customers/components/detail/schedule/useScheduleFormState.ts +221 -0
  621. package/src/modules/customers/components/detail/types.ts +16 -0
  622. package/src/modules/customers/components/detail/utils.ts +25 -0
  623. package/src/modules/customers/components/formConfig.tsx +223 -28
  624. package/src/modules/customers/components/linking/LinkEntityDialog.tsx +920 -0
  625. package/src/modules/customers/components/linking/adapters/companyAdapter.tsx +398 -0
  626. package/src/modules/customers/components/linking/adapters/dealAdapter.tsx +578 -0
  627. package/src/modules/customers/components/linking/adapters/personAdapter.tsx +512 -0
  628. package/src/modules/customers/components/list/CollectionPreviewCell.tsx +66 -0
  629. package/src/modules/customers/data/entities.ts +353 -1
  630. package/src/modules/customers/data/validators.ts +170 -19
  631. package/src/modules/customers/events.ts +22 -0
  632. package/src/modules/customers/i18n/de.json +841 -2
  633. package/src/modules/customers/i18n/en.json +841 -2
  634. package/src/modules/customers/i18n/es.json +840 -1
  635. package/src/modules/customers/i18n/pl.json +841 -2
  636. package/src/modules/customers/lib/customerRoleTypes.ts +24 -0
  637. package/src/modules/customers/lib/dealClosureNotification.ts +64 -0
  638. package/src/modules/customers/lib/dealStageTransitionTable.ts +32 -0
  639. package/src/modules/customers/lib/dictionaries.ts +26 -10
  640. package/src/modules/customers/lib/interactionReadModel.ts +10 -0
  641. package/src/modules/customers/lib/personCompanies.ts +317 -0
  642. package/src/modules/customers/lib/personCompanyLinkTable.ts +58 -0
  643. package/src/modules/customers/lib/roleTypeUsage.ts +146 -0
  644. package/src/modules/customers/migrations/.snapshot-open-mercato.json +2747 -798
  645. package/src/modules/customers/migrations/Migration20260406214502.ts +19 -0
  646. package/src/modules/customers/migrations/Migration20260408135736.ts +15 -0
  647. package/src/modules/customers/migrations/Migration20260408225345.ts +23 -0
  648. package/src/modules/customers/migrations/Migration20260411075533.ts +30 -0
  649. package/src/modules/customers/migrations/Migration20260411103551.ts +13 -0
  650. package/src/modules/customers/migrations/Migration20260411130944.ts +30 -0
  651. package/src/modules/customers/migrations/Migration20260415095203.ts +13 -0
  652. package/src/modules/customers/migrations/Migration20260415135056.ts +22 -0
  653. package/src/modules/customers/migrations/Migration20260417140000.ts +15 -0
  654. package/src/modules/customers/migrations/Migration20260417160000.ts +17 -0
  655. package/src/modules/customers/migrations/Migration20260417235407.ts +13 -0
  656. package/src/modules/customers/setup.ts +15 -0
  657. package/src/modules/customers/subscribers/deal-closure-notification.ts +22 -0
  658. package/src/modules/customers/subscribers/deal-lost-notification.ts +22 -0
  659. package/src/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.ts +2 -0
  660. package/src/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.ts +162 -0
  661. package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +6 -2
  662. package/src/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.ts +162 -0
  663. package/src/modules/dictionaries/api/context.ts +9 -0
  664. package/src/modules/dictionaries/api/openapi.ts +17 -0
  665. package/src/modules/dictionaries/commands/entry-operations.ts +457 -0
  666. package/src/modules/dictionaries/commands/factory.ts +31 -3
  667. package/src/modules/dictionaries/commands/index.ts +1 -0
  668. package/src/modules/dictionaries/components/DictionaryTable.tsx +15 -6
  669. package/src/modules/dictionaries/data/entities.ts +9 -0
  670. package/src/modules/dictionaries/data/validators.ts +34 -0
  671. package/src/modules/dictionaries/events.ts +20 -0
  672. package/src/modules/dictionaries/i18n/de.json +2 -0
  673. package/src/modules/dictionaries/i18n/en.json +2 -0
  674. package/src/modules/dictionaries/i18n/es.json +2 -0
  675. package/src/modules/dictionaries/i18n/pl.json +2 -0
  676. package/src/modules/dictionaries/lib/clientEntries.ts +66 -0
  677. package/src/modules/dictionaries/migrations/.snapshot-open-mercato.json +185 -3
  678. package/src/modules/dictionaries/migrations/Migration20260410171544.ts +49 -0
  679. package/src/modules/inbox_ops/api/proposals/[id]/route.ts +4 -1
  680. package/src/modules/query_index/lib/engine.ts +9 -1
  681. package/src/modules/sales/components/documents/AddressesSection.tsx +92 -42
  682. package/src/modules/sales/i18n/de.json +28 -0
  683. package/src/modules/sales/i18n/en.json +28 -0
  684. package/src/modules/sales/i18n/es.json +28 -0
  685. package/src/modules/sales/i18n/pl.json +28 -0
  686. package/src/modules/sales/lib/dictionaries.ts +18 -0
  687. 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,QA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IAC5B;AACA,WAAO,GAAG,OAAO,KAAK,OAAO,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;AACnB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB,sBAAsB,2BAA2B;AAOvE,SAAS,uBAAuB,EAAE,cAAc,OAAO,GAAgC;AAC5F,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,MAAM,QAAQ,MAAM,mBAAmB,YAAY,GAAG,CAAC,YAAY,CAAC;AAEnF,SACE,qBAAC,SAAI,WAAU,gDACb;AAAA,yBAAC,SAAI,WAAU,qCACb;AAAA,2BAAC,QAAG,WAAU,iEACZ;AAAA,4BAAC,SAAM,WAAW,GAAG,UAAU,oBAAoB,OAAO,OAAO,CAAC,GAAG;AAAA,QACpE,EAAE,2CAA2C,qBAAqB;AAAA,SACrE;AAAA,MACC,UACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,SAAS;AAAA,UACT,WAAU;AAAA,UACV,cAAY,EAAE,0CAA0C,WAAW;AAAA,UAEnE,8BAAC,UAAO,WAAU,YAAW;AAAA;AAAA,MAC/B;AAAA,OAEJ;AAAA,IACA,oBAAC,SAAI,WAAU,yCACb,+BAAC,SAAI,WAAU,yBACb;AAAA,2BAAC,SAAI,WAAU,oDACb;AAAA,4BAAC,UAAK,WAAW,GAAG,sBAAsB,oBAAoB,OAAO,OAAO,CAAC,GAAI,iBAAO,OAAM;AAAA,QAC9F,oBAAC,UAAK,WAAU,iCAAgC,kBAAI;AAAA,SACtD;AAAA,MACA,oBAAC,SACC,8BAAC,SAAM,WAAW,GAAG,WAAW,qBAAqB,OAAO,OAAO,CAAC,GACjE,YAAE,qCAAqC,OAAO,KAAK,IAAI,OAAO,KAAK,GACtE,GACF;AAAA,MACC,OAAO,oBAAoB,QAC1B,qBAAC,OAAE,WAAU,iCACV;AAAA,UAAE,iDAAiD,cAAc;AAAA,QAAE;AAAA,QAAG,OAAO,oBAAoB,IAC9F,EAAE,0BAA0B,OAAO,IACnC,EAAE,4BAA4B,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,YAAY,WAAW;AACvB,SAAS,MAAM,OAAO,SAAS;AAC/B,SAAS,YAAY;AACrB,SAAS,sBAAsB;AAC/B,SAAS,aAAa;AACtB,SAAS,oBAA2C;AACpD,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AACjC,SAAS,mCAAmC;AAC5C,SAAS,mBAAmB;AA0B5B,SAAS,iBAAiB,OAA2B,GAA2C;AAC9F,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,OAAO,IAAI,KAAK,KAAK;AAC3B,MAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,EAAG,QAAO;AACzC,QAAM,SAAS,KAAK,IAAI,IAAI,KAAK,QAAQ;AACzC,QAAM,WAAW,KAAK,MAAM,SAAS,KAAU;AAC/C,MAAI,YAAY,EAAG,QAAO,EAAE,iCAAiC,gBAAgB;AAC7E,MAA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