@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
@@ -246,6 +246,54 @@
246
246
  "enumItems": [],
247
247
  "mappedType": "text"
248
248
  },
249
+ "closure_outcome": {
250
+ "name": "closure_outcome",
251
+ "type": "text",
252
+ "unsigned": false,
253
+ "autoincrement": false,
254
+ "primary": false,
255
+ "nullable": true,
256
+ "unique": false,
257
+ "length": null,
258
+ "precision": null,
259
+ "scale": null,
260
+ "default": null,
261
+ "comment": null,
262
+ "enumItems": [],
263
+ "mappedType": "text"
264
+ },
265
+ "loss_reason_id": {
266
+ "name": "loss_reason_id",
267
+ "type": "uuid",
268
+ "unsigned": false,
269
+ "autoincrement": false,
270
+ "primary": false,
271
+ "nullable": true,
272
+ "unique": false,
273
+ "length": null,
274
+ "precision": null,
275
+ "scale": null,
276
+ "default": null,
277
+ "comment": null,
278
+ "enumItems": [],
279
+ "mappedType": "uuid"
280
+ },
281
+ "loss_notes": {
282
+ "name": "loss_notes",
283
+ "type": "text",
284
+ "unsigned": false,
285
+ "autoincrement": false,
286
+ "primary": false,
287
+ "nullable": true,
288
+ "unique": false,
289
+ "length": null,
290
+ "precision": null,
291
+ "scale": null,
292
+ "default": null,
293
+ "comment": null,
294
+ "enumItems": [],
295
+ "mappedType": "text"
296
+ },
249
297
  "created_at": {
250
298
  "name": "created_at",
251
299
  "type": "timestamptz",
@@ -298,6 +346,19 @@
298
346
  "name": "customer_deals",
299
347
  "schema": "public",
300
348
  "indexes": [
349
+ {
350
+ "keyName": "customer_deals_closure_stats_idx",
351
+ "columnNames": [
352
+ "organization_id",
353
+ "tenant_id",
354
+ "closure_outcome",
355
+ "updated_at"
356
+ ],
357
+ "composite": true,
358
+ "constraint": false,
359
+ "primary": false,
360
+ "unique": false
361
+ },
301
362
  {
302
363
  "keyName": "customer_deals_org_tenant_idx",
303
364
  "columnNames": [
@@ -374,9 +435,9 @@
374
435
  "enumItems": [],
375
436
  "mappedType": "uuid"
376
437
  },
377
- "kind": {
378
- "name": "kind",
379
- "type": "text",
438
+ "pipeline_id": {
439
+ "name": "pipeline_id",
440
+ "type": "uuid",
380
441
  "unsigned": false,
381
442
  "autoincrement": false,
382
443
  "primary": false,
@@ -388,11 +449,11 @@
388
449
  "default": null,
389
450
  "comment": null,
390
451
  "enumItems": [],
391
- "mappedType": "text"
452
+ "mappedType": "uuid"
392
453
  },
393
- "value": {
394
- "name": "value",
395
- "type": "text",
454
+ "stage_id": {
455
+ "name": "stage_id",
456
+ "type": "uuid",
396
457
  "unsigned": false,
397
458
  "autoincrement": false,
398
459
  "primary": false,
@@ -404,10 +465,10 @@
404
465
  "default": null,
405
466
  "comment": null,
406
467
  "enumItems": [],
407
- "mappedType": "text"
468
+ "mappedType": "uuid"
408
469
  },
409
- "normalized_value": {
410
- "name": "normalized_value",
470
+ "stage_label": {
471
+ "name": "stage_label",
411
472
  "type": "text",
412
473
  "unsigned": false,
413
474
  "autoincrement": false,
@@ -422,9 +483,9 @@
422
483
  "enumItems": [],
423
484
  "mappedType": "text"
424
485
  },
425
- "label": {
426
- "name": "label",
427
- "type": "text",
486
+ "stage_order": {
487
+ "name": "stage_order",
488
+ "type": "int",
428
489
  "unsigned": false,
429
490
  "autoincrement": false,
430
491
  "primary": false,
@@ -436,27 +497,27 @@
436
497
  "default": null,
437
498
  "comment": null,
438
499
  "enumItems": [],
439
- "mappedType": "text"
500
+ "mappedType": "integer"
440
501
  },
441
- "color": {
442
- "name": "color",
443
- "type": "text",
502
+ "transitioned_at": {
503
+ "name": "transitioned_at",
504
+ "type": "timestamptz",
444
505
  "unsigned": false,
445
506
  "autoincrement": false,
446
507
  "primary": false,
447
- "nullable": true,
508
+ "nullable": false,
448
509
  "unique": false,
449
- "length": null,
510
+ "length": 6,
450
511
  "precision": null,
451
512
  "scale": null,
452
513
  "default": null,
453
514
  "comment": null,
454
515
  "enumItems": [],
455
- "mappedType": "text"
516
+ "mappedType": "datetime"
456
517
  },
457
- "icon": {
458
- "name": "icon",
459
- "type": "text",
518
+ "transitioned_by_user_id": {
519
+ "name": "transitioned_by_user_id",
520
+ "type": "uuid",
460
521
  "unsigned": false,
461
522
  "autoincrement": false,
462
523
  "primary": false,
@@ -468,7 +529,23 @@
468
529
  "default": null,
469
530
  "comment": null,
470
531
  "enumItems": [],
471
- "mappedType": "text"
532
+ "mappedType": "uuid"
533
+ },
534
+ "is_active": {
535
+ "name": "is_active",
536
+ "type": "boolean",
537
+ "unsigned": false,
538
+ "autoincrement": false,
539
+ "primary": false,
540
+ "nullable": false,
541
+ "unique": false,
542
+ "length": null,
543
+ "precision": null,
544
+ "scale": null,
545
+ "default": "true",
546
+ "comment": null,
547
+ "enumItems": [],
548
+ "mappedType": "boolean"
472
549
  },
473
550
  "created_at": {
474
551
  "name": "created_at",
@@ -501,17 +578,48 @@
501
578
  "comment": null,
502
579
  "enumItems": [],
503
580
  "mappedType": "datetime"
581
+ },
582
+ "deleted_at": {
583
+ "name": "deleted_at",
584
+ "type": "timestamptz",
585
+ "unsigned": false,
586
+ "autoincrement": false,
587
+ "primary": false,
588
+ "nullable": true,
589
+ "unique": false,
590
+ "length": 6,
591
+ "precision": null,
592
+ "scale": null,
593
+ "default": null,
594
+ "comment": null,
595
+ "enumItems": [],
596
+ "mappedType": "datetime"
597
+ },
598
+ "deal_id": {
599
+ "name": "deal_id",
600
+ "type": "uuid",
601
+ "unsigned": false,
602
+ "autoincrement": false,
603
+ "primary": false,
604
+ "nullable": false,
605
+ "unique": false,
606
+ "length": null,
607
+ "precision": null,
608
+ "scale": null,
609
+ "default": null,
610
+ "comment": null,
611
+ "enumItems": [],
612
+ "mappedType": "uuid"
504
613
  }
505
614
  },
506
- "name": "customer_dictionary_entries",
615
+ "name": "customer_deal_stage_transitions",
507
616
  "schema": "public",
508
617
  "indexes": [
509
618
  {
510
- "keyName": "customer_dictionary_entries_scope_idx",
619
+ "keyName": "customer_deal_stage_transitions_org_tenant_idx",
511
620
  "columnNames": [
512
621
  "organization_id",
513
- "tenant_id",
514
- "kind"
622
+ "tenant_id"
515
623
  ],
516
624
  "composite": true,
517
625
  "constraint": false,
@@ -519,12 +627,20 @@
519
627
  "unique": false
520
628
  },
521
629
  {
522
- "keyName": "customer_dictionary_entries_unique",
630
+ "keyName": "customer_deal_stage_transitions_deal_idx",
523
631
  "columnNames": [
524
- "organization_id",
525
- "tenant_id",
526
- "kind",
527
- "normalized_value"
632
+ "deal_id"
633
+ ],
634
+ "composite": false,
635
+ "constraint": false,
636
+ "primary": false,
637
+ "unique": false
638
+ },
639
+ {
640
+ "keyName": "customer_deal_stage_transitions_deal_stage_uq",
641
+ "columnNames": [
642
+ "deal_id",
643
+ "stage_id"
528
644
  ],
529
645
  "composite": true,
530
646
  "constraint": true,
@@ -532,7 +648,7 @@
532
648
  "unique": true
533
649
  },
534
650
  {
535
- "keyName": "customer_dictionary_entries_pkey",
651
+ "keyName": "customer_deal_stage_transitions_pkey",
536
652
  "columnNames": [
537
653
  "id"
538
654
  ],
@@ -543,7 +659,20 @@
543
659
  }
544
660
  ],
545
661
  "checks": [],
546
- "foreignKeys": {},
662
+ "foreignKeys": {
663
+ "customer_deal_stage_transitions_deal_id_foreign": {
664
+ "constraintName": "customer_deal_stage_transitions_deal_id_foreign",
665
+ "columnNames": [
666
+ "deal_id"
667
+ ],
668
+ "localTableName": "public.customer_deal_stage_transitions",
669
+ "referencedColumnNames": [
670
+ "id"
671
+ ],
672
+ "referencedTableName": "public.customer_deals",
673
+ "updateRule": "cascade"
674
+ }
675
+ },
547
676
  "nativeEnums": {}
548
677
  },
549
678
  {
@@ -612,8 +741,8 @@
612
741
  "enumItems": [],
613
742
  "mappedType": "text"
614
743
  },
615
- "display_name": {
616
- "name": "display_name",
744
+ "value": {
745
+ "name": "value",
617
746
  "type": "text",
618
747
  "unsigned": false,
619
748
  "autoincrement": false,
@@ -628,45 +757,13 @@
628
757
  "enumItems": [],
629
758
  "mappedType": "text"
630
759
  },
631
- "description": {
632
- "name": "description",
633
- "type": "text",
634
- "unsigned": false,
635
- "autoincrement": false,
636
- "primary": false,
637
- "nullable": true,
638
- "unique": false,
639
- "length": null,
640
- "precision": null,
641
- "scale": null,
642
- "default": null,
643
- "comment": null,
644
- "enumItems": [],
645
- "mappedType": "text"
646
- },
647
- "owner_user_id": {
648
- "name": "owner_user_id",
649
- "type": "uuid",
650
- "unsigned": false,
651
- "autoincrement": false,
652
- "primary": false,
653
- "nullable": true,
654
- "unique": false,
655
- "length": null,
656
- "precision": null,
657
- "scale": null,
658
- "default": null,
659
- "comment": null,
660
- "enumItems": [],
661
- "mappedType": "uuid"
662
- },
663
- "primary_email": {
664
- "name": "primary_email",
760
+ "normalized_value": {
761
+ "name": "normalized_value",
665
762
  "type": "text",
666
763
  "unsigned": false,
667
764
  "autoincrement": false,
668
765
  "primary": false,
669
- "nullable": true,
766
+ "nullable": false,
670
767
  "unique": false,
671
768
  "length": null,
672
769
  "precision": null,
@@ -676,13 +773,13 @@
676
773
  "enumItems": [],
677
774
  "mappedType": "text"
678
775
  },
679
- "primary_phone": {
680
- "name": "primary_phone",
776
+ "label": {
777
+ "name": "label",
681
778
  "type": "text",
682
779
  "unsigned": false,
683
780
  "autoincrement": false,
684
781
  "primary": false,
685
- "nullable": true,
782
+ "nullable": false,
686
783
  "unique": false,
687
784
  "length": null,
688
785
  "precision": null,
@@ -692,8 +789,8 @@
692
789
  "enumItems": [],
693
790
  "mappedType": "text"
694
791
  },
695
- "status": {
696
- "name": "status",
792
+ "color": {
793
+ "name": "color",
697
794
  "type": "text",
698
795
  "unsigned": false,
699
796
  "autoincrement": false,
@@ -708,8 +805,8 @@
708
805
  "enumItems": [],
709
806
  "mappedType": "text"
710
807
  },
711
- "lifecycle_stage": {
712
- "name": "lifecycle_stage",
808
+ "icon": {
809
+ "name": "icon",
713
810
  "type": "text",
714
811
  "unsigned": false,
715
812
  "autoincrement": false,
@@ -724,29 +821,29 @@
724
821
  "enumItems": [],
725
822
  "mappedType": "text"
726
823
  },
727
- "source": {
728
- "name": "source",
729
- "type": "text",
824
+ "created_at": {
825
+ "name": "created_at",
826
+ "type": "timestamptz",
730
827
  "unsigned": false,
731
828
  "autoincrement": false,
732
829
  "primary": false,
733
- "nullable": true,
830
+ "nullable": false,
734
831
  "unique": false,
735
- "length": null,
832
+ "length": 6,
736
833
  "precision": null,
737
834
  "scale": null,
738
835
  "default": null,
739
836
  "comment": null,
740
837
  "enumItems": [],
741
- "mappedType": "text"
838
+ "mappedType": "datetime"
742
839
  },
743
- "next_interaction_at": {
744
- "name": "next_interaction_at",
840
+ "updated_at": {
841
+ "name": "updated_at",
745
842
  "type": "timestamptz",
746
843
  "unsigned": false,
747
844
  "autoincrement": false,
748
845
  "primary": false,
749
- "nullable": true,
846
+ "nullable": false,
750
847
  "unique": false,
751
848
  "length": 6,
752
849
  "precision": null,
@@ -755,30 +852,92 @@
755
852
  "comment": null,
756
853
  "enumItems": [],
757
854
  "mappedType": "datetime"
758
- },
759
- "next_interaction_name": {
760
- "name": "next_interaction_name",
761
- "type": "text",
762
- "unsigned": false,
763
- "autoincrement": false,
764
- "primary": false,
765
- "nullable": true,
766
- "unique": false,
767
- "length": null,
768
- "precision": null,
855
+ }
856
+ },
857
+ "name": "customer_dictionary_entries",
858
+ "schema": "public",
859
+ "indexes": [
860
+ {
861
+ "keyName": "customer_dictionary_entries_scope_idx",
862
+ "columnNames": [
863
+ "organization_id",
864
+ "tenant_id",
865
+ "kind"
866
+ ],
867
+ "composite": true,
868
+ "constraint": false,
869
+ "primary": false,
870
+ "unique": false
871
+ },
872
+ {
873
+ "keyName": "customer_dictionary_entries_unique",
874
+ "columnNames": [
875
+ "organization_id",
876
+ "tenant_id",
877
+ "kind",
878
+ "normalized_value"
879
+ ],
880
+ "composite": true,
881
+ "constraint": true,
882
+ "primary": false,
883
+ "unique": true
884
+ },
885
+ {
886
+ "keyName": "customer_dictionary_entries_pkey",
887
+ "columnNames": [
888
+ "id"
889
+ ],
890
+ "composite": false,
891
+ "constraint": true,
892
+ "primary": true,
893
+ "unique": true
894
+ }
895
+ ],
896
+ "checks": [],
897
+ "foreignKeys": {},
898
+ "nativeEnums": {}
899
+ },
900
+ {
901
+ "columns": {
902
+ "id": {
903
+ "name": "id",
904
+ "type": "uuid",
905
+ "unsigned": false,
906
+ "autoincrement": false,
907
+ "primary": true,
908
+ "nullable": false,
909
+ "unique": false,
910
+ "length": null,
911
+ "precision": null,
912
+ "scale": null,
913
+ "default": "gen_random_uuid()",
914
+ "comment": null,
915
+ "enumItems": [],
916
+ "mappedType": "uuid"
917
+ },
918
+ "organization_id": {
919
+ "name": "organization_id",
920
+ "type": "uuid",
921
+ "unsigned": false,
922
+ "autoincrement": false,
923
+ "primary": false,
924
+ "nullable": false,
925
+ "unique": false,
926
+ "length": null,
927
+ "precision": null,
769
928
  "scale": null,
770
929
  "default": null,
771
930
  "comment": null,
772
931
  "enumItems": [],
773
- "mappedType": "text"
932
+ "mappedType": "uuid"
774
933
  },
775
- "next_interaction_ref_id": {
776
- "name": "next_interaction_ref_id",
777
- "type": "text",
934
+ "tenant_id": {
935
+ "name": "tenant_id",
936
+ "type": "uuid",
778
937
  "unsigned": false,
779
938
  "autoincrement": false,
780
939
  "primary": false,
781
- "nullable": true,
940
+ "nullable": false,
782
941
  "unique": false,
783
942
  "length": null,
784
943
  "precision": null,
@@ -786,15 +945,15 @@
786
945
  "default": null,
787
946
  "comment": null,
788
947
  "enumItems": [],
789
- "mappedType": "text"
948
+ "mappedType": "uuid"
790
949
  },
791
- "next_interaction_icon": {
792
- "name": "next_interaction_icon",
950
+ "kind": {
951
+ "name": "kind",
793
952
  "type": "text",
794
953
  "unsigned": false,
795
954
  "autoincrement": false,
796
955
  "primary": false,
797
- "nullable": true,
956
+ "nullable": false,
798
957
  "unique": false,
799
958
  "length": null,
800
959
  "precision": null,
@@ -804,24 +963,24 @@
804
963
  "enumItems": [],
805
964
  "mappedType": "text"
806
965
  },
807
- "next_interaction_color": {
808
- "name": "next_interaction_color",
966
+ "selection_mode": {
967
+ "name": "selection_mode",
809
968
  "type": "text",
810
969
  "unsigned": false,
811
970
  "autoincrement": false,
812
971
  "primary": false,
813
- "nullable": true,
972
+ "nullable": false,
814
973
  "unique": false,
815
974
  "length": null,
816
975
  "precision": null,
817
976
  "scale": null,
818
- "default": null,
977
+ "default": "'single'",
819
978
  "comment": null,
820
979
  "enumItems": [],
821
980
  "mappedType": "text"
822
981
  },
823
- "is_active": {
824
- "name": "is_active",
982
+ "visible_in_tags": {
983
+ "name": "visible_in_tags",
825
984
  "type": "boolean",
826
985
  "unsigned": false,
827
986
  "autoincrement": false,
@@ -836,24 +995,24 @@
836
995
  "enumItems": [],
837
996
  "mappedType": "boolean"
838
997
  },
839
- "created_at": {
840
- "name": "created_at",
841
- "type": "timestamptz",
998
+ "sort_order": {
999
+ "name": "sort_order",
1000
+ "type": "int",
842
1001
  "unsigned": false,
843
1002
  "autoincrement": false,
844
1003
  "primary": false,
845
1004
  "nullable": false,
846
1005
  "unique": false,
847
- "length": 6,
1006
+ "length": null,
848
1007
  "precision": null,
849
1008
  "scale": null,
850
- "default": null,
1009
+ "default": "0",
851
1010
  "comment": null,
852
1011
  "enumItems": [],
853
- "mappedType": "datetime"
1012
+ "mappedType": "integer"
854
1013
  },
855
- "updated_at": {
856
- "name": "updated_at",
1014
+ "created_at": {
1015
+ "name": "created_at",
857
1016
  "type": "timestamptz",
858
1017
  "unsigned": false,
859
1018
  "autoincrement": false,
@@ -868,13 +1027,13 @@
868
1027
  "enumItems": [],
869
1028
  "mappedType": "datetime"
870
1029
  },
871
- "deleted_at": {
872
- "name": "deleted_at",
1030
+ "updated_at": {
1031
+ "name": "updated_at",
873
1032
  "type": "timestamptz",
874
1033
  "unsigned": false,
875
1034
  "autoincrement": false,
876
1035
  "primary": false,
877
- "nullable": true,
1036
+ "nullable": false,
878
1037
  "unique": false,
879
1038
  "length": 6,
880
1039
  "precision": null,
@@ -885,59 +1044,34 @@
885
1044
  "mappedType": "datetime"
886
1045
  }
887
1046
  },
888
- "name": "customer_entities",
1047
+ "name": "customer_dictionary_kind_settings",
889
1048
  "schema": "public",
890
1049
  "indexes": [
891
1050
  {
892
- "keyName": "idx_ce_tenant_person_id",
893
- "columnNames": [],
894
- "composite": false,
895
- "constraint": false,
896
- "primary": false,
897
- "unique": false,
898
- "expression": "create index \"idx_ce_tenant_person_id\" on \"customer_entities\" (\"tenant_id\", \"id\") where deleted_at is null and kind = 'person'"
899
- },
900
- {
901
- "keyName": "idx_ce_tenant_company_id",
902
- "columnNames": [],
903
- "composite": false,
904
- "constraint": false,
905
- "primary": false,
906
- "unique": false,
907
- "expression": "create index \"idx_ce_tenant_company_id\" on \"customer_entities\" (\"tenant_id\", \"id\") where deleted_at is null and kind = 'company'"
908
- },
909
- {
910
- "keyName": "idx_ce_tenant_org_company_id",
911
- "columnNames": [],
912
- "composite": false,
913
- "constraint": false,
914
- "primary": false,
915
- "unique": false,
916
- "expression": "create index \"idx_ce_tenant_org_company_id\" on \"customer_entities\" (\"tenant_id\", \"organization_id\", \"id\") where deleted_at is null and kind = 'company'"
917
- },
918
- {
919
- "keyName": "idx_ce_tenant_org_person_id",
920
- "columnNames": [],
921
- "composite": false,
1051
+ "keyName": "customer_dict_kind_settings_scope_idx",
1052
+ "columnNames": [
1053
+ "organization_id",
1054
+ "tenant_id"
1055
+ ],
1056
+ "composite": true,
922
1057
  "constraint": false,
923
1058
  "primary": false,
924
- "unique": false,
925
- "expression": "create index \"idx_ce_tenant_org_person_id\" on \"customer_entities\" (\"tenant_id\", \"organization_id\", \"id\") where deleted_at is null and kind = 'person'"
1059
+ "unique": false
926
1060
  },
927
1061
  {
928
- "keyName": "customer_entities_org_tenant_kind_idx",
1062
+ "keyName": "customer_dict_kind_settings_unique",
929
1063
  "columnNames": [
930
1064
  "organization_id",
931
1065
  "tenant_id",
932
1066
  "kind"
933
1067
  ],
934
1068
  "composite": true,
935
- "constraint": false,
1069
+ "constraint": true,
936
1070
  "primary": false,
937
- "unique": false
1071
+ "unique": true
938
1072
  },
939
1073
  {
940
- "keyName": "customer_entities_pkey",
1074
+ "keyName": "customer_dictionary_kind_settings_pkey",
941
1075
  "columnNames": [
942
1076
  "id"
943
1077
  ],
@@ -969,13 +1103,13 @@
969
1103
  "enumItems": [],
970
1104
  "mappedType": "uuid"
971
1105
  },
972
- "role": {
973
- "name": "role",
974
- "type": "text",
1106
+ "organization_id": {
1107
+ "name": "organization_id",
1108
+ "type": "uuid",
975
1109
  "unsigned": false,
976
1110
  "autoincrement": false,
977
1111
  "primary": false,
978
- "nullable": true,
1112
+ "nullable": false,
979
1113
  "unique": false,
980
1114
  "length": null,
981
1115
  "precision": null,
@@ -983,27 +1117,27 @@
983
1117
  "default": null,
984
1118
  "comment": null,
985
1119
  "enumItems": [],
986
- "mappedType": "text"
1120
+ "mappedType": "uuid"
987
1121
  },
988
- "created_at": {
989
- "name": "created_at",
990
- "type": "timestamptz",
1122
+ "tenant_id": {
1123
+ "name": "tenant_id",
1124
+ "type": "uuid",
991
1125
  "unsigned": false,
992
1126
  "autoincrement": false,
993
1127
  "primary": false,
994
1128
  "nullable": false,
995
1129
  "unique": false,
996
- "length": 6,
1130
+ "length": null,
997
1131
  "precision": null,
998
1132
  "scale": null,
999
1133
  "default": null,
1000
1134
  "comment": null,
1001
1135
  "enumItems": [],
1002
- "mappedType": "datetime"
1136
+ "mappedType": "uuid"
1003
1137
  },
1004
- "deal_id": {
1005
- "name": "deal_id",
1006
- "type": "uuid",
1138
+ "kind": {
1139
+ "name": "kind",
1140
+ "type": "text",
1007
1141
  "unsigned": false,
1008
1142
  "autoincrement": false,
1009
1143
  "primary": false,
@@ -1015,11 +1149,11 @@
1015
1149
  "default": null,
1016
1150
  "comment": null,
1017
1151
  "enumItems": [],
1018
- "mappedType": "uuid"
1152
+ "mappedType": "text"
1019
1153
  },
1020
- "person_entity_id": {
1021
- "name": "person_entity_id",
1022
- "type": "uuid",
1154
+ "display_name": {
1155
+ "name": "display_name",
1156
+ "type": "text",
1023
1157
  "unsigned": false,
1024
1158
  "autoincrement": false,
1025
1159
  "primary": false,
@@ -1031,49 +1165,1750 @@
1031
1165
  "default": null,
1032
1166
  "comment": null,
1033
1167
  "enumItems": [],
1034
- "mappedType": "uuid"
1035
- }
1036
- },
1037
- "name": "customer_deal_people",
1038
- "schema": "public",
1039
- "indexes": [
1040
- {
1041
- "keyName": "customer_deal_people_person_idx",
1042
- "columnNames": [
1043
- "person_entity_id"
1044
- ],
1045
- "composite": false,
1046
- "constraint": false,
1047
- "primary": false,
1048
- "unique": false
1168
+ "mappedType": "text"
1049
1169
  },
1050
- {
1051
- "keyName": "customer_deal_people_deal_idx",
1052
- "columnNames": [
1053
- "deal_id"
1054
- ],
1055
- "composite": false,
1056
- "constraint": false,
1170
+ "description": {
1171
+ "name": "description",
1172
+ "type": "text",
1173
+ "unsigned": false,
1174
+ "autoincrement": false,
1057
1175
  "primary": false,
1058
- "unique": false
1176
+ "nullable": true,
1177
+ "unique": false,
1178
+ "length": null,
1179
+ "precision": null,
1180
+ "scale": null,
1181
+ "default": null,
1182
+ "comment": null,
1183
+ "enumItems": [],
1184
+ "mappedType": "text"
1059
1185
  },
1060
- {
1061
- "keyName": "customer_deal_people_unique",
1062
- "columnNames": [
1063
- "deal_id",
1064
- "person_entity_id"
1065
- ],
1066
- "composite": true,
1067
- "constraint": true,
1186
+ "owner_user_id": {
1187
+ "name": "owner_user_id",
1188
+ "type": "uuid",
1189
+ "unsigned": false,
1190
+ "autoincrement": false,
1068
1191
  "primary": false,
1069
- "unique": true
1070
- },
1071
- {
1072
- "keyName": "customer_deal_people_pkey",
1073
- "columnNames": [
1074
- "id"
1075
- ],
1076
- "composite": false,
1192
+ "nullable": true,
1193
+ "unique": false,
1194
+ "length": null,
1195
+ "precision": null,
1196
+ "scale": null,
1197
+ "default": null,
1198
+ "comment": null,
1199
+ "enumItems": [],
1200
+ "mappedType": "uuid"
1201
+ },
1202
+ "primary_email": {
1203
+ "name": "primary_email",
1204
+ "type": "text",
1205
+ "unsigned": false,
1206
+ "autoincrement": false,
1207
+ "primary": false,
1208
+ "nullable": true,
1209
+ "unique": false,
1210
+ "length": null,
1211
+ "precision": null,
1212
+ "scale": null,
1213
+ "default": null,
1214
+ "comment": null,
1215
+ "enumItems": [],
1216
+ "mappedType": "text"
1217
+ },
1218
+ "primary_phone": {
1219
+ "name": "primary_phone",
1220
+ "type": "text",
1221
+ "unsigned": false,
1222
+ "autoincrement": false,
1223
+ "primary": false,
1224
+ "nullable": true,
1225
+ "unique": false,
1226
+ "length": null,
1227
+ "precision": null,
1228
+ "scale": null,
1229
+ "default": null,
1230
+ "comment": null,
1231
+ "enumItems": [],
1232
+ "mappedType": "text"
1233
+ },
1234
+ "status": {
1235
+ "name": "status",
1236
+ "type": "text",
1237
+ "unsigned": false,
1238
+ "autoincrement": false,
1239
+ "primary": false,
1240
+ "nullable": true,
1241
+ "unique": false,
1242
+ "length": null,
1243
+ "precision": null,
1244
+ "scale": null,
1245
+ "default": null,
1246
+ "comment": null,
1247
+ "enumItems": [],
1248
+ "mappedType": "text"
1249
+ },
1250
+ "lifecycle_stage": {
1251
+ "name": "lifecycle_stage",
1252
+ "type": "text",
1253
+ "unsigned": false,
1254
+ "autoincrement": false,
1255
+ "primary": false,
1256
+ "nullable": true,
1257
+ "unique": false,
1258
+ "length": null,
1259
+ "precision": null,
1260
+ "scale": null,
1261
+ "default": null,
1262
+ "comment": null,
1263
+ "enumItems": [],
1264
+ "mappedType": "text"
1265
+ },
1266
+ "source": {
1267
+ "name": "source",
1268
+ "type": "text",
1269
+ "unsigned": false,
1270
+ "autoincrement": false,
1271
+ "primary": false,
1272
+ "nullable": true,
1273
+ "unique": false,
1274
+ "length": null,
1275
+ "precision": null,
1276
+ "scale": null,
1277
+ "default": null,
1278
+ "comment": null,
1279
+ "enumItems": [],
1280
+ "mappedType": "text"
1281
+ },
1282
+ "temperature": {
1283
+ "name": "temperature",
1284
+ "type": "text",
1285
+ "unsigned": false,
1286
+ "autoincrement": false,
1287
+ "primary": false,
1288
+ "nullable": true,
1289
+ "unique": false,
1290
+ "length": null,
1291
+ "precision": null,
1292
+ "scale": null,
1293
+ "default": null,
1294
+ "comment": null,
1295
+ "enumItems": [],
1296
+ "mappedType": "text"
1297
+ },
1298
+ "renewal_quarter": {
1299
+ "name": "renewal_quarter",
1300
+ "type": "text",
1301
+ "unsigned": false,
1302
+ "autoincrement": false,
1303
+ "primary": false,
1304
+ "nullable": true,
1305
+ "unique": false,
1306
+ "length": null,
1307
+ "precision": null,
1308
+ "scale": null,
1309
+ "default": null,
1310
+ "comment": null,
1311
+ "enumItems": [],
1312
+ "mappedType": "text"
1313
+ },
1314
+ "next_interaction_at": {
1315
+ "name": "next_interaction_at",
1316
+ "type": "timestamptz",
1317
+ "unsigned": false,
1318
+ "autoincrement": false,
1319
+ "primary": false,
1320
+ "nullable": true,
1321
+ "unique": false,
1322
+ "length": 6,
1323
+ "precision": null,
1324
+ "scale": null,
1325
+ "default": null,
1326
+ "comment": null,
1327
+ "enumItems": [],
1328
+ "mappedType": "datetime"
1329
+ },
1330
+ "next_interaction_name": {
1331
+ "name": "next_interaction_name",
1332
+ "type": "text",
1333
+ "unsigned": false,
1334
+ "autoincrement": false,
1335
+ "primary": false,
1336
+ "nullable": true,
1337
+ "unique": false,
1338
+ "length": null,
1339
+ "precision": null,
1340
+ "scale": null,
1341
+ "default": null,
1342
+ "comment": null,
1343
+ "enumItems": [],
1344
+ "mappedType": "text"
1345
+ },
1346
+ "next_interaction_ref_id": {
1347
+ "name": "next_interaction_ref_id",
1348
+ "type": "text",
1349
+ "unsigned": false,
1350
+ "autoincrement": false,
1351
+ "primary": false,
1352
+ "nullable": true,
1353
+ "unique": false,
1354
+ "length": null,
1355
+ "precision": null,
1356
+ "scale": null,
1357
+ "default": null,
1358
+ "comment": null,
1359
+ "enumItems": [],
1360
+ "mappedType": "text"
1361
+ },
1362
+ "next_interaction_icon": {
1363
+ "name": "next_interaction_icon",
1364
+ "type": "text",
1365
+ "unsigned": false,
1366
+ "autoincrement": false,
1367
+ "primary": false,
1368
+ "nullable": true,
1369
+ "unique": false,
1370
+ "length": null,
1371
+ "precision": null,
1372
+ "scale": null,
1373
+ "default": null,
1374
+ "comment": null,
1375
+ "enumItems": [],
1376
+ "mappedType": "text"
1377
+ },
1378
+ "next_interaction_color": {
1379
+ "name": "next_interaction_color",
1380
+ "type": "text",
1381
+ "unsigned": false,
1382
+ "autoincrement": false,
1383
+ "primary": false,
1384
+ "nullable": true,
1385
+ "unique": false,
1386
+ "length": null,
1387
+ "precision": null,
1388
+ "scale": null,
1389
+ "default": null,
1390
+ "comment": null,
1391
+ "enumItems": [],
1392
+ "mappedType": "text"
1393
+ },
1394
+ "is_active": {
1395
+ "name": "is_active",
1396
+ "type": "boolean",
1397
+ "unsigned": false,
1398
+ "autoincrement": false,
1399
+ "primary": false,
1400
+ "nullable": false,
1401
+ "unique": false,
1402
+ "length": null,
1403
+ "precision": null,
1404
+ "scale": null,
1405
+ "default": "true",
1406
+ "comment": null,
1407
+ "enumItems": [],
1408
+ "mappedType": "boolean"
1409
+ },
1410
+ "created_at": {
1411
+ "name": "created_at",
1412
+ "type": "timestamptz",
1413
+ "unsigned": false,
1414
+ "autoincrement": false,
1415
+ "primary": false,
1416
+ "nullable": false,
1417
+ "unique": false,
1418
+ "length": 6,
1419
+ "precision": null,
1420
+ "scale": null,
1421
+ "default": null,
1422
+ "comment": null,
1423
+ "enumItems": [],
1424
+ "mappedType": "datetime"
1425
+ },
1426
+ "updated_at": {
1427
+ "name": "updated_at",
1428
+ "type": "timestamptz",
1429
+ "unsigned": false,
1430
+ "autoincrement": false,
1431
+ "primary": false,
1432
+ "nullable": false,
1433
+ "unique": false,
1434
+ "length": 6,
1435
+ "precision": null,
1436
+ "scale": null,
1437
+ "default": null,
1438
+ "comment": null,
1439
+ "enumItems": [],
1440
+ "mappedType": "datetime"
1441
+ },
1442
+ "deleted_at": {
1443
+ "name": "deleted_at",
1444
+ "type": "timestamptz",
1445
+ "unsigned": false,
1446
+ "autoincrement": false,
1447
+ "primary": false,
1448
+ "nullable": true,
1449
+ "unique": false,
1450
+ "length": 6,
1451
+ "precision": null,
1452
+ "scale": null,
1453
+ "default": null,
1454
+ "comment": null,
1455
+ "enumItems": [],
1456
+ "mappedType": "datetime"
1457
+ }
1458
+ },
1459
+ "name": "customer_entities",
1460
+ "schema": "public",
1461
+ "indexes": [
1462
+ {
1463
+ "keyName": "idx_ce_tenant_person_id",
1464
+ "columnNames": [],
1465
+ "composite": false,
1466
+ "constraint": false,
1467
+ "primary": false,
1468
+ "unique": false,
1469
+ "expression": "create index \"idx_ce_tenant_person_id\" on \"customer_entities\" (\"tenant_id\", \"id\") where deleted_at is null and kind = 'person'"
1470
+ },
1471
+ {
1472
+ "keyName": "idx_ce_tenant_company_id",
1473
+ "columnNames": [],
1474
+ "composite": false,
1475
+ "constraint": false,
1476
+ "primary": false,
1477
+ "unique": false,
1478
+ "expression": "create index \"idx_ce_tenant_company_id\" on \"customer_entities\" (\"tenant_id\", \"id\") where deleted_at is null and kind = 'company'"
1479
+ },
1480
+ {
1481
+ "keyName": "idx_ce_tenant_org_company_id",
1482
+ "columnNames": [],
1483
+ "composite": false,
1484
+ "constraint": false,
1485
+ "primary": false,
1486
+ "unique": false,
1487
+ "expression": "create index \"idx_ce_tenant_org_company_id\" on \"customer_entities\" (\"tenant_id\", \"organization_id\", \"id\") where deleted_at is null and kind = 'company'"
1488
+ },
1489
+ {
1490
+ "keyName": "idx_ce_tenant_org_person_id",
1491
+ "columnNames": [],
1492
+ "composite": false,
1493
+ "constraint": false,
1494
+ "primary": false,
1495
+ "unique": false,
1496
+ "expression": "create index \"idx_ce_tenant_org_person_id\" on \"customer_entities\" (\"tenant_id\", \"organization_id\", \"id\") where deleted_at is null and kind = 'person'"
1497
+ },
1498
+ {
1499
+ "keyName": "customer_entities_org_tenant_kind_idx",
1500
+ "columnNames": [
1501
+ "organization_id",
1502
+ "tenant_id",
1503
+ "kind"
1504
+ ],
1505
+ "composite": true,
1506
+ "constraint": false,
1507
+ "primary": false,
1508
+ "unique": false
1509
+ },
1510
+ {
1511
+ "keyName": "customer_entities_pkey",
1512
+ "columnNames": [
1513
+ "id"
1514
+ ],
1515
+ "composite": false,
1516
+ "constraint": true,
1517
+ "primary": true,
1518
+ "unique": true
1519
+ }
1520
+ ],
1521
+ "checks": [],
1522
+ "foreignKeys": {},
1523
+ "nativeEnums": {}
1524
+ },
1525
+ {
1526
+ "columns": {
1527
+ "id": {
1528
+ "name": "id",
1529
+ "type": "uuid",
1530
+ "unsigned": false,
1531
+ "autoincrement": false,
1532
+ "primary": true,
1533
+ "nullable": false,
1534
+ "unique": false,
1535
+ "length": null,
1536
+ "precision": null,
1537
+ "scale": null,
1538
+ "default": "gen_random_uuid()",
1539
+ "comment": null,
1540
+ "enumItems": [],
1541
+ "mappedType": "uuid"
1542
+ },
1543
+ "role": {
1544
+ "name": "role",
1545
+ "type": "text",
1546
+ "unsigned": false,
1547
+ "autoincrement": false,
1548
+ "primary": false,
1549
+ "nullable": true,
1550
+ "unique": false,
1551
+ "length": null,
1552
+ "precision": null,
1553
+ "scale": null,
1554
+ "default": null,
1555
+ "comment": null,
1556
+ "enumItems": [],
1557
+ "mappedType": "text"
1558
+ },
1559
+ "created_at": {
1560
+ "name": "created_at",
1561
+ "type": "timestamptz",
1562
+ "unsigned": false,
1563
+ "autoincrement": false,
1564
+ "primary": false,
1565
+ "nullable": false,
1566
+ "unique": false,
1567
+ "length": 6,
1568
+ "precision": null,
1569
+ "scale": null,
1570
+ "default": null,
1571
+ "comment": null,
1572
+ "enumItems": [],
1573
+ "mappedType": "datetime"
1574
+ },
1575
+ "deal_id": {
1576
+ "name": "deal_id",
1577
+ "type": "uuid",
1578
+ "unsigned": false,
1579
+ "autoincrement": false,
1580
+ "primary": false,
1581
+ "nullable": false,
1582
+ "unique": false,
1583
+ "length": null,
1584
+ "precision": null,
1585
+ "scale": null,
1586
+ "default": null,
1587
+ "comment": null,
1588
+ "enumItems": [],
1589
+ "mappedType": "uuid"
1590
+ },
1591
+ "person_entity_id": {
1592
+ "name": "person_entity_id",
1593
+ "type": "uuid",
1594
+ "unsigned": false,
1595
+ "autoincrement": false,
1596
+ "primary": false,
1597
+ "nullable": false,
1598
+ "unique": false,
1599
+ "length": null,
1600
+ "precision": null,
1601
+ "scale": null,
1602
+ "default": null,
1603
+ "comment": null,
1604
+ "enumItems": [],
1605
+ "mappedType": "uuid"
1606
+ }
1607
+ },
1608
+ "name": "customer_deal_people",
1609
+ "schema": "public",
1610
+ "indexes": [
1611
+ {
1612
+ "keyName": "customer_deal_people_person_idx",
1613
+ "columnNames": [
1614
+ "person_entity_id"
1615
+ ],
1616
+ "composite": false,
1617
+ "constraint": false,
1618
+ "primary": false,
1619
+ "unique": false
1620
+ },
1621
+ {
1622
+ "keyName": "customer_deal_people_deal_idx",
1623
+ "columnNames": [
1624
+ "deal_id"
1625
+ ],
1626
+ "composite": false,
1627
+ "constraint": false,
1628
+ "primary": false,
1629
+ "unique": false
1630
+ },
1631
+ {
1632
+ "keyName": "customer_deal_people_unique",
1633
+ "columnNames": [
1634
+ "deal_id",
1635
+ "person_entity_id"
1636
+ ],
1637
+ "composite": true,
1638
+ "constraint": true,
1639
+ "primary": false,
1640
+ "unique": true
1641
+ },
1642
+ {
1643
+ "keyName": "customer_deal_people_pkey",
1644
+ "columnNames": [
1645
+ "id"
1646
+ ],
1647
+ "composite": false,
1648
+ "constraint": true,
1649
+ "primary": true,
1650
+ "unique": true
1651
+ }
1652
+ ],
1653
+ "checks": [],
1654
+ "foreignKeys": {
1655
+ "customer_deal_people_deal_id_foreign": {
1656
+ "constraintName": "customer_deal_people_deal_id_foreign",
1657
+ "columnNames": [
1658
+ "deal_id"
1659
+ ],
1660
+ "localTableName": "public.customer_deal_people",
1661
+ "referencedColumnNames": [
1662
+ "id"
1663
+ ],
1664
+ "referencedTableName": "public.customer_deals",
1665
+ "updateRule": "cascade"
1666
+ },
1667
+ "customer_deal_people_person_entity_id_foreign": {
1668
+ "constraintName": "customer_deal_people_person_entity_id_foreign",
1669
+ "columnNames": [
1670
+ "person_entity_id"
1671
+ ],
1672
+ "localTableName": "public.customer_deal_people",
1673
+ "referencedColumnNames": [
1674
+ "id"
1675
+ ],
1676
+ "referencedTableName": "public.customer_entities",
1677
+ "updateRule": "cascade"
1678
+ }
1679
+ },
1680
+ "nativeEnums": {}
1681
+ },
1682
+ {
1683
+ "columns": {
1684
+ "id": {
1685
+ "name": "id",
1686
+ "type": "uuid",
1687
+ "unsigned": false,
1688
+ "autoincrement": false,
1689
+ "primary": true,
1690
+ "nullable": false,
1691
+ "unique": false,
1692
+ "length": null,
1693
+ "precision": null,
1694
+ "scale": null,
1695
+ "default": "gen_random_uuid()",
1696
+ "comment": null,
1697
+ "enumItems": [],
1698
+ "mappedType": "uuid"
1699
+ },
1700
+ "created_at": {
1701
+ "name": "created_at",
1702
+ "type": "timestamptz",
1703
+ "unsigned": false,
1704
+ "autoincrement": false,
1705
+ "primary": false,
1706
+ "nullable": false,
1707
+ "unique": false,
1708
+ "length": 6,
1709
+ "precision": null,
1710
+ "scale": null,
1711
+ "default": null,
1712
+ "comment": null,
1713
+ "enumItems": [],
1714
+ "mappedType": "datetime"
1715
+ },
1716
+ "deal_id": {
1717
+ "name": "deal_id",
1718
+ "type": "uuid",
1719
+ "unsigned": false,
1720
+ "autoincrement": false,
1721
+ "primary": false,
1722
+ "nullable": false,
1723
+ "unique": false,
1724
+ "length": null,
1725
+ "precision": null,
1726
+ "scale": null,
1727
+ "default": null,
1728
+ "comment": null,
1729
+ "enumItems": [],
1730
+ "mappedType": "uuid"
1731
+ },
1732
+ "company_entity_id": {
1733
+ "name": "company_entity_id",
1734
+ "type": "uuid",
1735
+ "unsigned": false,
1736
+ "autoincrement": false,
1737
+ "primary": false,
1738
+ "nullable": false,
1739
+ "unique": false,
1740
+ "length": null,
1741
+ "precision": null,
1742
+ "scale": null,
1743
+ "default": null,
1744
+ "comment": null,
1745
+ "enumItems": [],
1746
+ "mappedType": "uuid"
1747
+ }
1748
+ },
1749
+ "name": "customer_deal_companies",
1750
+ "schema": "public",
1751
+ "indexes": [
1752
+ {
1753
+ "keyName": "customer_deal_companies_company_idx",
1754
+ "columnNames": [
1755
+ "company_entity_id"
1756
+ ],
1757
+ "composite": false,
1758
+ "constraint": false,
1759
+ "primary": false,
1760
+ "unique": false
1761
+ },
1762
+ {
1763
+ "keyName": "customer_deal_companies_deal_idx",
1764
+ "columnNames": [
1765
+ "deal_id"
1766
+ ],
1767
+ "composite": false,
1768
+ "constraint": false,
1769
+ "primary": false,
1770
+ "unique": false
1771
+ },
1772
+ {
1773
+ "keyName": "customer_deal_companies_unique",
1774
+ "columnNames": [
1775
+ "deal_id",
1776
+ "company_entity_id"
1777
+ ],
1778
+ "composite": true,
1779
+ "constraint": true,
1780
+ "primary": false,
1781
+ "unique": true
1782
+ },
1783
+ {
1784
+ "keyName": "customer_deal_companies_pkey",
1785
+ "columnNames": [
1786
+ "id"
1787
+ ],
1788
+ "composite": false,
1789
+ "constraint": true,
1790
+ "primary": true,
1791
+ "unique": true
1792
+ }
1793
+ ],
1794
+ "checks": [],
1795
+ "foreignKeys": {
1796
+ "customer_deal_companies_deal_id_foreign": {
1797
+ "constraintName": "customer_deal_companies_deal_id_foreign",
1798
+ "columnNames": [
1799
+ "deal_id"
1800
+ ],
1801
+ "localTableName": "public.customer_deal_companies",
1802
+ "referencedColumnNames": [
1803
+ "id"
1804
+ ],
1805
+ "referencedTableName": "public.customer_deals",
1806
+ "updateRule": "cascade"
1807
+ },
1808
+ "customer_deal_companies_company_entity_id_foreign": {
1809
+ "constraintName": "customer_deal_companies_company_entity_id_foreign",
1810
+ "columnNames": [
1811
+ "company_entity_id"
1812
+ ],
1813
+ "localTableName": "public.customer_deal_companies",
1814
+ "referencedColumnNames": [
1815
+ "id"
1816
+ ],
1817
+ "referencedTableName": "public.customer_entities",
1818
+ "updateRule": "cascade"
1819
+ }
1820
+ },
1821
+ "nativeEnums": {}
1822
+ },
1823
+ {
1824
+ "columns": {
1825
+ "id": {
1826
+ "name": "id",
1827
+ "type": "uuid",
1828
+ "unsigned": false,
1829
+ "autoincrement": false,
1830
+ "primary": true,
1831
+ "nullable": false,
1832
+ "unique": false,
1833
+ "length": null,
1834
+ "precision": null,
1835
+ "scale": null,
1836
+ "default": "gen_random_uuid()",
1837
+ "comment": null,
1838
+ "enumItems": [],
1839
+ "mappedType": "uuid"
1840
+ },
1841
+ "organization_id": {
1842
+ "name": "organization_id",
1843
+ "type": "uuid",
1844
+ "unsigned": false,
1845
+ "autoincrement": false,
1846
+ "primary": false,
1847
+ "nullable": false,
1848
+ "unique": false,
1849
+ "length": null,
1850
+ "precision": null,
1851
+ "scale": null,
1852
+ "default": null,
1853
+ "comment": null,
1854
+ "enumItems": [],
1855
+ "mappedType": "uuid"
1856
+ },
1857
+ "tenant_id": {
1858
+ "name": "tenant_id",
1859
+ "type": "uuid",
1860
+ "unsigned": false,
1861
+ "autoincrement": false,
1862
+ "primary": false,
1863
+ "nullable": false,
1864
+ "unique": false,
1865
+ "length": null,
1866
+ "precision": null,
1867
+ "scale": null,
1868
+ "default": null,
1869
+ "comment": null,
1870
+ "enumItems": [],
1871
+ "mappedType": "uuid"
1872
+ },
1873
+ "legal_name": {
1874
+ "name": "legal_name",
1875
+ "type": "text",
1876
+ "unsigned": false,
1877
+ "autoincrement": false,
1878
+ "primary": false,
1879
+ "nullable": true,
1880
+ "unique": false,
1881
+ "length": null,
1882
+ "precision": null,
1883
+ "scale": null,
1884
+ "default": null,
1885
+ "comment": null,
1886
+ "enumItems": [],
1887
+ "mappedType": "text"
1888
+ },
1889
+ "brand_name": {
1890
+ "name": "brand_name",
1891
+ "type": "text",
1892
+ "unsigned": false,
1893
+ "autoincrement": false,
1894
+ "primary": false,
1895
+ "nullable": true,
1896
+ "unique": false,
1897
+ "length": null,
1898
+ "precision": null,
1899
+ "scale": null,
1900
+ "default": null,
1901
+ "comment": null,
1902
+ "enumItems": [],
1903
+ "mappedType": "text"
1904
+ },
1905
+ "domain": {
1906
+ "name": "domain",
1907
+ "type": "text",
1908
+ "unsigned": false,
1909
+ "autoincrement": false,
1910
+ "primary": false,
1911
+ "nullable": true,
1912
+ "unique": false,
1913
+ "length": null,
1914
+ "precision": null,
1915
+ "scale": null,
1916
+ "default": null,
1917
+ "comment": null,
1918
+ "enumItems": [],
1919
+ "mappedType": "text"
1920
+ },
1921
+ "website_url": {
1922
+ "name": "website_url",
1923
+ "type": "text",
1924
+ "unsigned": false,
1925
+ "autoincrement": false,
1926
+ "primary": false,
1927
+ "nullable": true,
1928
+ "unique": false,
1929
+ "length": null,
1930
+ "precision": null,
1931
+ "scale": null,
1932
+ "default": null,
1933
+ "comment": null,
1934
+ "enumItems": [],
1935
+ "mappedType": "text"
1936
+ },
1937
+ "industry": {
1938
+ "name": "industry",
1939
+ "type": "text",
1940
+ "unsigned": false,
1941
+ "autoincrement": false,
1942
+ "primary": false,
1943
+ "nullable": true,
1944
+ "unique": false,
1945
+ "length": null,
1946
+ "precision": null,
1947
+ "scale": null,
1948
+ "default": null,
1949
+ "comment": null,
1950
+ "enumItems": [],
1951
+ "mappedType": "text"
1952
+ },
1953
+ "size_bucket": {
1954
+ "name": "size_bucket",
1955
+ "type": "text",
1956
+ "unsigned": false,
1957
+ "autoincrement": false,
1958
+ "primary": false,
1959
+ "nullable": true,
1960
+ "unique": false,
1961
+ "length": null,
1962
+ "precision": null,
1963
+ "scale": null,
1964
+ "default": null,
1965
+ "comment": null,
1966
+ "enumItems": [],
1967
+ "mappedType": "text"
1968
+ },
1969
+ "annual_revenue": {
1970
+ "name": "annual_revenue",
1971
+ "type": "numeric(16,2)",
1972
+ "unsigned": false,
1973
+ "autoincrement": false,
1974
+ "primary": false,
1975
+ "nullable": true,
1976
+ "unique": false,
1977
+ "length": null,
1978
+ "precision": 16,
1979
+ "scale": 2,
1980
+ "default": null,
1981
+ "comment": null,
1982
+ "enumItems": [],
1983
+ "mappedType": "decimal"
1984
+ },
1985
+ "created_at": {
1986
+ "name": "created_at",
1987
+ "type": "timestamptz",
1988
+ "unsigned": false,
1989
+ "autoincrement": false,
1990
+ "primary": false,
1991
+ "nullable": false,
1992
+ "unique": false,
1993
+ "length": 6,
1994
+ "precision": null,
1995
+ "scale": null,
1996
+ "default": null,
1997
+ "comment": null,
1998
+ "enumItems": [],
1999
+ "mappedType": "datetime"
2000
+ },
2001
+ "updated_at": {
2002
+ "name": "updated_at",
2003
+ "type": "timestamptz",
2004
+ "unsigned": false,
2005
+ "autoincrement": false,
2006
+ "primary": false,
2007
+ "nullable": false,
2008
+ "unique": false,
2009
+ "length": 6,
2010
+ "precision": null,
2011
+ "scale": null,
2012
+ "default": null,
2013
+ "comment": null,
2014
+ "enumItems": [],
2015
+ "mappedType": "datetime"
2016
+ },
2017
+ "entity_id": {
2018
+ "name": "entity_id",
2019
+ "type": "uuid",
2020
+ "unsigned": false,
2021
+ "autoincrement": false,
2022
+ "primary": false,
2023
+ "nullable": false,
2024
+ "unique": false,
2025
+ "length": null,
2026
+ "precision": null,
2027
+ "scale": null,
2028
+ "default": null,
2029
+ "comment": null,
2030
+ "enumItems": [],
2031
+ "mappedType": "uuid"
2032
+ }
2033
+ },
2034
+ "name": "customer_companies",
2035
+ "schema": "public",
2036
+ "indexes": [
2037
+ {
2038
+ "columnNames": [
2039
+ "entity_id"
2040
+ ],
2041
+ "composite": false,
2042
+ "keyName": "customer_companies_entity_id_unique",
2043
+ "constraint": true,
2044
+ "primary": false,
2045
+ "unique": true
2046
+ },
2047
+ {
2048
+ "keyName": "idx_customer_companies_entity_id",
2049
+ "columnNames": [],
2050
+ "composite": false,
2051
+ "constraint": false,
2052
+ "primary": false,
2053
+ "unique": false,
2054
+ "expression": "create index \"idx_customer_companies_entity_id\" on \"customer_companies\" (\"entity_id\")"
2055
+ },
2056
+ {
2057
+ "keyName": "customer_companies_org_tenant_idx",
2058
+ "columnNames": [
2059
+ "organization_id",
2060
+ "tenant_id"
2061
+ ],
2062
+ "composite": true,
2063
+ "constraint": false,
2064
+ "primary": false,
2065
+ "unique": false
2066
+ },
2067
+ {
2068
+ "keyName": "customer_companies_pkey",
2069
+ "columnNames": [
2070
+ "id"
2071
+ ],
2072
+ "composite": false,
2073
+ "constraint": true,
2074
+ "primary": true,
2075
+ "unique": true
2076
+ }
2077
+ ],
2078
+ "checks": [],
2079
+ "foreignKeys": {
2080
+ "customer_companies_entity_id_foreign": {
2081
+ "constraintName": "customer_companies_entity_id_foreign",
2082
+ "columnNames": [
2083
+ "entity_id"
2084
+ ],
2085
+ "localTableName": "public.customer_companies",
2086
+ "referencedColumnNames": [
2087
+ "id"
2088
+ ],
2089
+ "referencedTableName": "public.customer_entities",
2090
+ "updateRule": "cascade"
2091
+ }
2092
+ },
2093
+ "nativeEnums": {}
2094
+ },
2095
+ {
2096
+ "columns": {
2097
+ "id": {
2098
+ "name": "id",
2099
+ "type": "uuid",
2100
+ "unsigned": false,
2101
+ "autoincrement": false,
2102
+ "primary": true,
2103
+ "nullable": false,
2104
+ "unique": false,
2105
+ "length": null,
2106
+ "precision": null,
2107
+ "scale": null,
2108
+ "default": "gen_random_uuid()",
2109
+ "comment": null,
2110
+ "enumItems": [],
2111
+ "mappedType": "uuid"
2112
+ },
2113
+ "organization_id": {
2114
+ "name": "organization_id",
2115
+ "type": "uuid",
2116
+ "unsigned": false,
2117
+ "autoincrement": false,
2118
+ "primary": false,
2119
+ "nullable": false,
2120
+ "unique": false,
2121
+ "length": null,
2122
+ "precision": null,
2123
+ "scale": null,
2124
+ "default": null,
2125
+ "comment": null,
2126
+ "enumItems": [],
2127
+ "mappedType": "uuid"
2128
+ },
2129
+ "tenant_id": {
2130
+ "name": "tenant_id",
2131
+ "type": "uuid",
2132
+ "unsigned": false,
2133
+ "autoincrement": false,
2134
+ "primary": false,
2135
+ "nullable": false,
2136
+ "unique": false,
2137
+ "length": null,
2138
+ "precision": null,
2139
+ "scale": null,
2140
+ "default": null,
2141
+ "comment": null,
2142
+ "enumItems": [],
2143
+ "mappedType": "uuid"
2144
+ },
2145
+ "entity_id": {
2146
+ "name": "entity_id",
2147
+ "type": "uuid",
2148
+ "unsigned": false,
2149
+ "autoincrement": false,
2150
+ "primary": false,
2151
+ "nullable": false,
2152
+ "unique": false,
2153
+ "length": null,
2154
+ "precision": null,
2155
+ "scale": null,
2156
+ "default": null,
2157
+ "comment": null,
2158
+ "enumItems": [],
2159
+ "mappedType": "uuid"
2160
+ },
2161
+ "bank_name": {
2162
+ "name": "bank_name",
2163
+ "type": "text",
2164
+ "unsigned": false,
2165
+ "autoincrement": false,
2166
+ "primary": false,
2167
+ "nullable": true,
2168
+ "unique": false,
2169
+ "length": null,
2170
+ "precision": null,
2171
+ "scale": null,
2172
+ "default": null,
2173
+ "comment": null,
2174
+ "enumItems": [],
2175
+ "mappedType": "text"
2176
+ },
2177
+ "bank_account_masked": {
2178
+ "name": "bank_account_masked",
2179
+ "type": "text",
2180
+ "unsigned": false,
2181
+ "autoincrement": false,
2182
+ "primary": false,
2183
+ "nullable": true,
2184
+ "unique": false,
2185
+ "length": null,
2186
+ "precision": null,
2187
+ "scale": null,
2188
+ "default": null,
2189
+ "comment": null,
2190
+ "enumItems": [],
2191
+ "mappedType": "text"
2192
+ },
2193
+ "payment_terms": {
2194
+ "name": "payment_terms",
2195
+ "type": "text",
2196
+ "unsigned": false,
2197
+ "autoincrement": false,
2198
+ "primary": false,
2199
+ "nullable": true,
2200
+ "unique": false,
2201
+ "length": null,
2202
+ "precision": null,
2203
+ "scale": null,
2204
+ "default": null,
2205
+ "comment": null,
2206
+ "enumItems": [],
2207
+ "mappedType": "text"
2208
+ },
2209
+ "preferred_currency": {
2210
+ "name": "preferred_currency",
2211
+ "type": "text",
2212
+ "unsigned": false,
2213
+ "autoincrement": false,
2214
+ "primary": false,
2215
+ "nullable": true,
2216
+ "unique": false,
2217
+ "length": null,
2218
+ "precision": null,
2219
+ "scale": null,
2220
+ "default": null,
2221
+ "comment": null,
2222
+ "enumItems": [],
2223
+ "mappedType": "text"
2224
+ },
2225
+ "created_at": {
2226
+ "name": "created_at",
2227
+ "type": "timestamptz",
2228
+ "unsigned": false,
2229
+ "autoincrement": false,
2230
+ "primary": false,
2231
+ "nullable": false,
2232
+ "unique": false,
2233
+ "length": 6,
2234
+ "precision": null,
2235
+ "scale": null,
2236
+ "default": null,
2237
+ "comment": null,
2238
+ "enumItems": [],
2239
+ "mappedType": "datetime"
2240
+ },
2241
+ "updated_at": {
2242
+ "name": "updated_at",
2243
+ "type": "timestamptz",
2244
+ "unsigned": false,
2245
+ "autoincrement": false,
2246
+ "primary": false,
2247
+ "nullable": false,
2248
+ "unique": false,
2249
+ "length": 6,
2250
+ "precision": null,
2251
+ "scale": null,
2252
+ "default": null,
2253
+ "comment": null,
2254
+ "enumItems": [],
2255
+ "mappedType": "datetime"
2256
+ }
2257
+ },
2258
+ "name": "customer_company_billing",
2259
+ "schema": "public",
2260
+ "indexes": [
2261
+ {
2262
+ "keyName": "customer_company_billing_scope_idx",
2263
+ "columnNames": [
2264
+ "organization_id",
2265
+ "tenant_id"
2266
+ ],
2267
+ "composite": true,
2268
+ "constraint": false,
2269
+ "primary": false,
2270
+ "unique": false
2271
+ },
2272
+ {
2273
+ "keyName": "customer_company_billing_entity_unique",
2274
+ "columnNames": [
2275
+ "entity_id"
2276
+ ],
2277
+ "composite": false,
2278
+ "constraint": true,
2279
+ "primary": false,
2280
+ "unique": true
2281
+ },
2282
+ {
2283
+ "keyName": "customer_company_billing_pkey",
2284
+ "columnNames": [
2285
+ "id"
2286
+ ],
2287
+ "composite": false,
2288
+ "constraint": true,
2289
+ "primary": true,
2290
+ "unique": true
2291
+ }
2292
+ ],
2293
+ "checks": [],
2294
+ "foreignKeys": {
2295
+ "customer_company_billing_entity_id_foreign": {
2296
+ "constraintName": "customer_company_billing_entity_id_foreign",
2297
+ "columnNames": [
2298
+ "entity_id"
2299
+ ],
2300
+ "localTableName": "public.customer_company_billing",
2301
+ "referencedColumnNames": [
2302
+ "id"
2303
+ ],
2304
+ "referencedTableName": "public.customer_entities",
2305
+ "updateRule": "cascade"
2306
+ }
2307
+ },
2308
+ "nativeEnums": {}
2309
+ },
2310
+ {
2311
+ "columns": {
2312
+ "id": {
2313
+ "name": "id",
2314
+ "type": "uuid",
2315
+ "unsigned": false,
2316
+ "autoincrement": false,
2317
+ "primary": true,
2318
+ "nullable": false,
2319
+ "unique": false,
2320
+ "length": null,
2321
+ "precision": null,
2322
+ "scale": null,
2323
+ "default": "gen_random_uuid()",
2324
+ "comment": null,
2325
+ "enumItems": [],
2326
+ "mappedType": "uuid"
2327
+ },
2328
+ "organization_id": {
2329
+ "name": "organization_id",
2330
+ "type": "uuid",
2331
+ "unsigned": false,
2332
+ "autoincrement": false,
2333
+ "primary": false,
2334
+ "nullable": false,
2335
+ "unique": false,
2336
+ "length": null,
2337
+ "precision": null,
2338
+ "scale": null,
2339
+ "default": null,
2340
+ "comment": null,
2341
+ "enumItems": [],
2342
+ "mappedType": "uuid"
2343
+ },
2344
+ "tenant_id": {
2345
+ "name": "tenant_id",
2346
+ "type": "uuid",
2347
+ "unsigned": false,
2348
+ "autoincrement": false,
2349
+ "primary": false,
2350
+ "nullable": false,
2351
+ "unique": false,
2352
+ "length": null,
2353
+ "precision": null,
2354
+ "scale": null,
2355
+ "default": null,
2356
+ "comment": null,
2357
+ "enumItems": [],
2358
+ "mappedType": "uuid"
2359
+ },
2360
+ "body": {
2361
+ "name": "body",
2362
+ "type": "text",
2363
+ "unsigned": false,
2364
+ "autoincrement": false,
2365
+ "primary": false,
2366
+ "nullable": false,
2367
+ "unique": false,
2368
+ "length": null,
2369
+ "precision": null,
2370
+ "scale": null,
2371
+ "default": null,
2372
+ "comment": null,
2373
+ "enumItems": [],
2374
+ "mappedType": "text"
2375
+ },
2376
+ "author_user_id": {
2377
+ "name": "author_user_id",
2378
+ "type": "uuid",
2379
+ "unsigned": false,
2380
+ "autoincrement": false,
2381
+ "primary": false,
2382
+ "nullable": true,
2383
+ "unique": false,
2384
+ "length": null,
2385
+ "precision": null,
2386
+ "scale": null,
2387
+ "default": null,
2388
+ "comment": null,
2389
+ "enumItems": [],
2390
+ "mappedType": "uuid"
2391
+ },
2392
+ "appearance_icon": {
2393
+ "name": "appearance_icon",
2394
+ "type": "text",
2395
+ "unsigned": false,
2396
+ "autoincrement": false,
2397
+ "primary": false,
2398
+ "nullable": true,
2399
+ "unique": false,
2400
+ "length": null,
2401
+ "precision": null,
2402
+ "scale": null,
2403
+ "default": null,
2404
+ "comment": null,
2405
+ "enumItems": [],
2406
+ "mappedType": "text"
2407
+ },
2408
+ "appearance_color": {
2409
+ "name": "appearance_color",
2410
+ "type": "text",
2411
+ "unsigned": false,
2412
+ "autoincrement": false,
2413
+ "primary": false,
2414
+ "nullable": true,
2415
+ "unique": false,
2416
+ "length": null,
2417
+ "precision": null,
2418
+ "scale": null,
2419
+ "default": null,
2420
+ "comment": null,
2421
+ "enumItems": [],
2422
+ "mappedType": "text"
2423
+ },
2424
+ "created_at": {
2425
+ "name": "created_at",
2426
+ "type": "timestamptz",
2427
+ "unsigned": false,
2428
+ "autoincrement": false,
2429
+ "primary": false,
2430
+ "nullable": false,
2431
+ "unique": false,
2432
+ "length": 6,
2433
+ "precision": null,
2434
+ "scale": null,
2435
+ "default": null,
2436
+ "comment": null,
2437
+ "enumItems": [],
2438
+ "mappedType": "datetime"
2439
+ },
2440
+ "updated_at": {
2441
+ "name": "updated_at",
2442
+ "type": "timestamptz",
2443
+ "unsigned": false,
2444
+ "autoincrement": false,
2445
+ "primary": false,
2446
+ "nullable": false,
2447
+ "unique": false,
2448
+ "length": 6,
2449
+ "precision": null,
2450
+ "scale": null,
2451
+ "default": null,
2452
+ "comment": null,
2453
+ "enumItems": [],
2454
+ "mappedType": "datetime"
2455
+ },
2456
+ "deleted_at": {
2457
+ "name": "deleted_at",
2458
+ "type": "timestamptz",
2459
+ "unsigned": false,
2460
+ "autoincrement": false,
2461
+ "primary": false,
2462
+ "nullable": true,
2463
+ "unique": false,
2464
+ "length": 6,
2465
+ "precision": null,
2466
+ "scale": null,
2467
+ "default": null,
2468
+ "comment": null,
2469
+ "enumItems": [],
2470
+ "mappedType": "datetime"
2471
+ },
2472
+ "entity_id": {
2473
+ "name": "entity_id",
2474
+ "type": "uuid",
2475
+ "unsigned": false,
2476
+ "autoincrement": false,
2477
+ "primary": false,
2478
+ "nullable": false,
2479
+ "unique": false,
2480
+ "length": null,
2481
+ "precision": null,
2482
+ "scale": null,
2483
+ "default": null,
2484
+ "comment": null,
2485
+ "enumItems": [],
2486
+ "mappedType": "uuid"
2487
+ },
2488
+ "deal_id": {
2489
+ "name": "deal_id",
2490
+ "type": "uuid",
2491
+ "unsigned": false,
2492
+ "autoincrement": false,
2493
+ "primary": false,
2494
+ "nullable": true,
2495
+ "unique": false,
2496
+ "length": null,
2497
+ "precision": null,
2498
+ "scale": null,
2499
+ "default": null,
2500
+ "comment": null,
2501
+ "enumItems": [],
2502
+ "mappedType": "uuid"
2503
+ }
2504
+ },
2505
+ "name": "customer_comments",
2506
+ "schema": "public",
2507
+ "indexes": [
2508
+ {
2509
+ "keyName": "customer_comments_entity_created_idx",
2510
+ "columnNames": [
2511
+ "entity_id",
2512
+ "created_at"
2513
+ ],
2514
+ "composite": true,
2515
+ "constraint": false,
2516
+ "primary": false,
2517
+ "unique": false
2518
+ },
2519
+ {
2520
+ "keyName": "customer_comments_entity_idx",
2521
+ "columnNames": [
2522
+ "entity_id"
2523
+ ],
2524
+ "composite": false,
2525
+ "constraint": false,
2526
+ "primary": false,
2527
+ "unique": false
2528
+ },
2529
+ {
2530
+ "keyName": "customer_comments_pkey",
2531
+ "columnNames": [
2532
+ "id"
2533
+ ],
2534
+ "composite": false,
2535
+ "constraint": true,
2536
+ "primary": true,
2537
+ "unique": true
2538
+ }
2539
+ ],
2540
+ "checks": [],
2541
+ "foreignKeys": {
2542
+ "customer_comments_entity_id_foreign": {
2543
+ "constraintName": "customer_comments_entity_id_foreign",
2544
+ "columnNames": [
2545
+ "entity_id"
2546
+ ],
2547
+ "localTableName": "public.customer_comments",
2548
+ "referencedColumnNames": [
2549
+ "id"
2550
+ ],
2551
+ "referencedTableName": "public.customer_entities",
2552
+ "updateRule": "cascade"
2553
+ },
2554
+ "customer_comments_deal_id_foreign": {
2555
+ "constraintName": "customer_comments_deal_id_foreign",
2556
+ "columnNames": [
2557
+ "deal_id"
2558
+ ],
2559
+ "localTableName": "public.customer_comments",
2560
+ "referencedColumnNames": [
2561
+ "id"
2562
+ ],
2563
+ "referencedTableName": "public.customer_deals",
2564
+ "deleteRule": "set null",
2565
+ "updateRule": "cascade"
2566
+ }
2567
+ },
2568
+ "nativeEnums": {}
2569
+ },
2570
+ {
2571
+ "columns": {
2572
+ "id": {
2573
+ "name": "id",
2574
+ "type": "uuid",
2575
+ "unsigned": false,
2576
+ "autoincrement": false,
2577
+ "primary": true,
2578
+ "nullable": false,
2579
+ "unique": false,
2580
+ "length": null,
2581
+ "precision": null,
2582
+ "scale": null,
2583
+ "default": "gen_random_uuid()",
2584
+ "comment": null,
2585
+ "enumItems": [],
2586
+ "mappedType": "uuid"
2587
+ },
2588
+ "organization_id": {
2589
+ "name": "organization_id",
2590
+ "type": "uuid",
2591
+ "unsigned": false,
2592
+ "autoincrement": false,
2593
+ "primary": false,
2594
+ "nullable": false,
2595
+ "unique": false,
2596
+ "length": null,
2597
+ "precision": null,
2598
+ "scale": null,
2599
+ "default": null,
2600
+ "comment": null,
2601
+ "enumItems": [],
2602
+ "mappedType": "uuid"
2603
+ },
2604
+ "tenant_id": {
2605
+ "name": "tenant_id",
2606
+ "type": "uuid",
2607
+ "unsigned": false,
2608
+ "autoincrement": false,
2609
+ "primary": false,
2610
+ "nullable": false,
2611
+ "unique": false,
2612
+ "length": null,
2613
+ "precision": null,
2614
+ "scale": null,
2615
+ "default": null,
2616
+ "comment": null,
2617
+ "enumItems": [],
2618
+ "mappedType": "uuid"
2619
+ },
2620
+ "name": {
2621
+ "name": "name",
2622
+ "type": "text",
2623
+ "unsigned": false,
2624
+ "autoincrement": false,
2625
+ "primary": false,
2626
+ "nullable": true,
2627
+ "unique": false,
2628
+ "length": null,
2629
+ "precision": null,
2630
+ "scale": null,
2631
+ "default": null,
2632
+ "comment": null,
2633
+ "enumItems": [],
2634
+ "mappedType": "text"
2635
+ },
2636
+ "purpose": {
2637
+ "name": "purpose",
2638
+ "type": "text",
2639
+ "unsigned": false,
2640
+ "autoincrement": false,
2641
+ "primary": false,
2642
+ "nullable": true,
2643
+ "unique": false,
2644
+ "length": null,
2645
+ "precision": null,
2646
+ "scale": null,
2647
+ "default": null,
2648
+ "comment": null,
2649
+ "enumItems": [],
2650
+ "mappedType": "text"
2651
+ },
2652
+ "company_name": {
2653
+ "name": "company_name",
2654
+ "type": "text",
2655
+ "unsigned": false,
2656
+ "autoincrement": false,
2657
+ "primary": false,
2658
+ "nullable": true,
2659
+ "unique": false,
2660
+ "length": null,
2661
+ "precision": null,
2662
+ "scale": null,
2663
+ "default": null,
2664
+ "comment": null,
2665
+ "enumItems": [],
2666
+ "mappedType": "text"
2667
+ },
2668
+ "address_line1": {
2669
+ "name": "address_line1",
2670
+ "type": "text",
2671
+ "unsigned": false,
2672
+ "autoincrement": false,
2673
+ "primary": false,
2674
+ "nullable": false,
2675
+ "unique": false,
2676
+ "length": null,
2677
+ "precision": null,
2678
+ "scale": null,
2679
+ "default": null,
2680
+ "comment": null,
2681
+ "enumItems": [],
2682
+ "mappedType": "text"
2683
+ },
2684
+ "address_line2": {
2685
+ "name": "address_line2",
2686
+ "type": "text",
2687
+ "unsigned": false,
2688
+ "autoincrement": false,
2689
+ "primary": false,
2690
+ "nullable": true,
2691
+ "unique": false,
2692
+ "length": null,
2693
+ "precision": null,
2694
+ "scale": null,
2695
+ "default": null,
2696
+ "comment": null,
2697
+ "enumItems": [],
2698
+ "mappedType": "text"
2699
+ },
2700
+ "city": {
2701
+ "name": "city",
2702
+ "type": "text",
2703
+ "unsigned": false,
2704
+ "autoincrement": false,
2705
+ "primary": false,
2706
+ "nullable": true,
2707
+ "unique": false,
2708
+ "length": null,
2709
+ "precision": null,
2710
+ "scale": null,
2711
+ "default": null,
2712
+ "comment": null,
2713
+ "enumItems": [],
2714
+ "mappedType": "text"
2715
+ },
2716
+ "region": {
2717
+ "name": "region",
2718
+ "type": "text",
2719
+ "unsigned": false,
2720
+ "autoincrement": false,
2721
+ "primary": false,
2722
+ "nullable": true,
2723
+ "unique": false,
2724
+ "length": null,
2725
+ "precision": null,
2726
+ "scale": null,
2727
+ "default": null,
2728
+ "comment": null,
2729
+ "enumItems": [],
2730
+ "mappedType": "text"
2731
+ },
2732
+ "postal_code": {
2733
+ "name": "postal_code",
2734
+ "type": "text",
2735
+ "unsigned": false,
2736
+ "autoincrement": false,
2737
+ "primary": false,
2738
+ "nullable": true,
2739
+ "unique": false,
2740
+ "length": null,
2741
+ "precision": null,
2742
+ "scale": null,
2743
+ "default": null,
2744
+ "comment": null,
2745
+ "enumItems": [],
2746
+ "mappedType": "text"
2747
+ },
2748
+ "country": {
2749
+ "name": "country",
2750
+ "type": "text",
2751
+ "unsigned": false,
2752
+ "autoincrement": false,
2753
+ "primary": false,
2754
+ "nullable": true,
2755
+ "unique": false,
2756
+ "length": null,
2757
+ "precision": null,
2758
+ "scale": null,
2759
+ "default": null,
2760
+ "comment": null,
2761
+ "enumItems": [],
2762
+ "mappedType": "text"
2763
+ },
2764
+ "building_number": {
2765
+ "name": "building_number",
2766
+ "type": "text",
2767
+ "unsigned": false,
2768
+ "autoincrement": false,
2769
+ "primary": false,
2770
+ "nullable": true,
2771
+ "unique": false,
2772
+ "length": null,
2773
+ "precision": null,
2774
+ "scale": null,
2775
+ "default": null,
2776
+ "comment": null,
2777
+ "enumItems": [],
2778
+ "mappedType": "text"
2779
+ },
2780
+ "flat_number": {
2781
+ "name": "flat_number",
2782
+ "type": "text",
2783
+ "unsigned": false,
2784
+ "autoincrement": false,
2785
+ "primary": false,
2786
+ "nullable": true,
2787
+ "unique": false,
2788
+ "length": null,
2789
+ "precision": null,
2790
+ "scale": null,
2791
+ "default": null,
2792
+ "comment": null,
2793
+ "enumItems": [],
2794
+ "mappedType": "text"
2795
+ },
2796
+ "latitude": {
2797
+ "name": "latitude",
2798
+ "type": "real",
2799
+ "unsigned": false,
2800
+ "autoincrement": false,
2801
+ "primary": false,
2802
+ "nullable": true,
2803
+ "unique": false,
2804
+ "length": null,
2805
+ "precision": null,
2806
+ "scale": null,
2807
+ "default": null,
2808
+ "comment": null,
2809
+ "enumItems": [],
2810
+ "mappedType": "float"
2811
+ },
2812
+ "longitude": {
2813
+ "name": "longitude",
2814
+ "type": "real",
2815
+ "unsigned": false,
2816
+ "autoincrement": false,
2817
+ "primary": false,
2818
+ "nullable": true,
2819
+ "unique": false,
2820
+ "length": null,
2821
+ "precision": null,
2822
+ "scale": null,
2823
+ "default": null,
2824
+ "comment": null,
2825
+ "enumItems": [],
2826
+ "mappedType": "float"
2827
+ },
2828
+ "is_primary": {
2829
+ "name": "is_primary",
2830
+ "type": "boolean",
2831
+ "unsigned": false,
2832
+ "autoincrement": false,
2833
+ "primary": false,
2834
+ "nullable": false,
2835
+ "unique": false,
2836
+ "length": null,
2837
+ "precision": null,
2838
+ "scale": null,
2839
+ "default": "false",
2840
+ "comment": null,
2841
+ "enumItems": [],
2842
+ "mappedType": "boolean"
2843
+ },
2844
+ "created_at": {
2845
+ "name": "created_at",
2846
+ "type": "timestamptz",
2847
+ "unsigned": false,
2848
+ "autoincrement": false,
2849
+ "primary": false,
2850
+ "nullable": false,
2851
+ "unique": false,
2852
+ "length": 6,
2853
+ "precision": null,
2854
+ "scale": null,
2855
+ "default": null,
2856
+ "comment": null,
2857
+ "enumItems": [],
2858
+ "mappedType": "datetime"
2859
+ },
2860
+ "updated_at": {
2861
+ "name": "updated_at",
2862
+ "type": "timestamptz",
2863
+ "unsigned": false,
2864
+ "autoincrement": false,
2865
+ "primary": false,
2866
+ "nullable": false,
2867
+ "unique": false,
2868
+ "length": 6,
2869
+ "precision": null,
2870
+ "scale": null,
2871
+ "default": null,
2872
+ "comment": null,
2873
+ "enumItems": [],
2874
+ "mappedType": "datetime"
2875
+ },
2876
+ "entity_id": {
2877
+ "name": "entity_id",
2878
+ "type": "uuid",
2879
+ "unsigned": false,
2880
+ "autoincrement": false,
2881
+ "primary": false,
2882
+ "nullable": false,
2883
+ "unique": false,
2884
+ "length": null,
2885
+ "precision": null,
2886
+ "scale": null,
2887
+ "default": null,
2888
+ "comment": null,
2889
+ "enumItems": [],
2890
+ "mappedType": "uuid"
2891
+ }
2892
+ },
2893
+ "name": "customer_addresses",
2894
+ "schema": "public",
2895
+ "indexes": [
2896
+ {
2897
+ "keyName": "customer_addresses_entity_idx",
2898
+ "columnNames": [
2899
+ "entity_id"
2900
+ ],
2901
+ "composite": false,
2902
+ "constraint": false,
2903
+ "primary": false,
2904
+ "unique": false
2905
+ },
2906
+ {
2907
+ "keyName": "customer_addresses_pkey",
2908
+ "columnNames": [
2909
+ "id"
2910
+ ],
2911
+ "composite": false,
1077
2912
  "constraint": true,
1078
2913
  "primary": true,
1079
2914
  "unique": true
@@ -1081,24 +2916,12 @@
1081
2916
  ],
1082
2917
  "checks": [],
1083
2918
  "foreignKeys": {
1084
- "customer_deal_people_deal_id_foreign": {
1085
- "constraintName": "customer_deal_people_deal_id_foreign",
1086
- "columnNames": [
1087
- "deal_id"
1088
- ],
1089
- "localTableName": "public.customer_deal_people",
1090
- "referencedColumnNames": [
1091
- "id"
1092
- ],
1093
- "referencedTableName": "public.customer_deals",
1094
- "updateRule": "cascade"
1095
- },
1096
- "customer_deal_people_person_entity_id_foreign": {
1097
- "constraintName": "customer_deal_people_person_entity_id_foreign",
2919
+ "customer_addresses_entity_id_foreign": {
2920
+ "constraintName": "customer_addresses_entity_id_foreign",
1098
2921
  "columnNames": [
1099
- "person_entity_id"
2922
+ "entity_id"
1100
2923
  ],
1101
- "localTableName": "public.customer_deal_people",
2924
+ "localTableName": "public.customer_addresses",
1102
2925
  "referencedColumnNames": [
1103
2926
  "id"
1104
2927
  ],
@@ -1115,16 +2938,160 @@
1115
2938
  "type": "uuid",
1116
2939
  "unsigned": false,
1117
2940
  "autoincrement": false,
1118
- "primary": true,
1119
- "nullable": false,
2941
+ "primary": true,
2942
+ "nullable": false,
2943
+ "unique": false,
2944
+ "length": null,
2945
+ "precision": null,
2946
+ "scale": null,
2947
+ "default": "gen_random_uuid()",
2948
+ "comment": null,
2949
+ "enumItems": [],
2950
+ "mappedType": "uuid"
2951
+ },
2952
+ "organization_id": {
2953
+ "name": "organization_id",
2954
+ "type": "uuid",
2955
+ "unsigned": false,
2956
+ "autoincrement": false,
2957
+ "primary": false,
2958
+ "nullable": false,
2959
+ "unique": false,
2960
+ "length": null,
2961
+ "precision": null,
2962
+ "scale": null,
2963
+ "default": null,
2964
+ "comment": null,
2965
+ "enumItems": [],
2966
+ "mappedType": "uuid"
2967
+ },
2968
+ "tenant_id": {
2969
+ "name": "tenant_id",
2970
+ "type": "uuid",
2971
+ "unsigned": false,
2972
+ "autoincrement": false,
2973
+ "primary": false,
2974
+ "nullable": false,
2975
+ "unique": false,
2976
+ "length": null,
2977
+ "precision": null,
2978
+ "scale": null,
2979
+ "default": null,
2980
+ "comment": null,
2981
+ "enumItems": [],
2982
+ "mappedType": "uuid"
2983
+ },
2984
+ "activity_type": {
2985
+ "name": "activity_type",
2986
+ "type": "text",
2987
+ "unsigned": false,
2988
+ "autoincrement": false,
2989
+ "primary": false,
2990
+ "nullable": false,
2991
+ "unique": false,
2992
+ "length": null,
2993
+ "precision": null,
2994
+ "scale": null,
2995
+ "default": null,
2996
+ "comment": null,
2997
+ "enumItems": [],
2998
+ "mappedType": "text"
2999
+ },
3000
+ "subject": {
3001
+ "name": "subject",
3002
+ "type": "text",
3003
+ "unsigned": false,
3004
+ "autoincrement": false,
3005
+ "primary": false,
3006
+ "nullable": true,
3007
+ "unique": false,
3008
+ "length": null,
3009
+ "precision": null,
3010
+ "scale": null,
3011
+ "default": null,
3012
+ "comment": null,
3013
+ "enumItems": [],
3014
+ "mappedType": "text"
3015
+ },
3016
+ "body": {
3017
+ "name": "body",
3018
+ "type": "text",
3019
+ "unsigned": false,
3020
+ "autoincrement": false,
3021
+ "primary": false,
3022
+ "nullable": true,
3023
+ "unique": false,
3024
+ "length": null,
3025
+ "precision": null,
3026
+ "scale": null,
3027
+ "default": null,
3028
+ "comment": null,
3029
+ "enumItems": [],
3030
+ "mappedType": "text"
3031
+ },
3032
+ "occurred_at": {
3033
+ "name": "occurred_at",
3034
+ "type": "timestamptz",
3035
+ "unsigned": false,
3036
+ "autoincrement": false,
3037
+ "primary": false,
3038
+ "nullable": true,
3039
+ "unique": false,
3040
+ "length": 6,
3041
+ "precision": null,
3042
+ "scale": null,
3043
+ "default": null,
3044
+ "comment": null,
3045
+ "enumItems": [],
3046
+ "mappedType": "datetime"
3047
+ },
3048
+ "author_user_id": {
3049
+ "name": "author_user_id",
3050
+ "type": "uuid",
3051
+ "unsigned": false,
3052
+ "autoincrement": false,
3053
+ "primary": false,
3054
+ "nullable": true,
3055
+ "unique": false,
3056
+ "length": null,
3057
+ "precision": null,
3058
+ "scale": null,
3059
+ "default": null,
3060
+ "comment": null,
3061
+ "enumItems": [],
3062
+ "mappedType": "uuid"
3063
+ },
3064
+ "appearance_icon": {
3065
+ "name": "appearance_icon",
3066
+ "type": "text",
3067
+ "unsigned": false,
3068
+ "autoincrement": false,
3069
+ "primary": false,
3070
+ "nullable": true,
3071
+ "unique": false,
3072
+ "length": null,
3073
+ "precision": null,
3074
+ "scale": null,
3075
+ "default": null,
3076
+ "comment": null,
3077
+ "enumItems": [],
3078
+ "mappedType": "text"
3079
+ },
3080
+ "appearance_color": {
3081
+ "name": "appearance_color",
3082
+ "type": "text",
3083
+ "unsigned": false,
3084
+ "autoincrement": false,
3085
+ "primary": false,
3086
+ "nullable": true,
1120
3087
  "unique": false,
1121
3088
  "length": null,
1122
3089
  "precision": null,
1123
3090
  "scale": null,
1124
- "default": "gen_random_uuid()",
3091
+ "default": null,
1125
3092
  "comment": null,
1126
3093
  "enumItems": [],
1127
- "mappedType": "uuid"
3094
+ "mappedType": "text"
1128
3095
  },
1129
3096
  "created_at": {
1130
3097
  "name": "created_at",
@@ -1142,8 +3109,24 @@
1142
3109
  "enumItems": [],
1143
3110
  "mappedType": "datetime"
1144
3111
  },
1145
- "deal_id": {
1146
- "name": "deal_id",
3112
+ "updated_at": {
3113
+ "name": "updated_at",
3114
+ "type": "timestamptz",
3115
+ "unsigned": false,
3116
+ "autoincrement": false,
3117
+ "primary": false,
3118
+ "nullable": false,
3119
+ "unique": false,
3120
+ "length": 6,
3121
+ "precision": null,
3122
+ "scale": null,
3123
+ "default": null,
3124
+ "comment": null,
3125
+ "enumItems": [],
3126
+ "mappedType": "datetime"
3127
+ },
3128
+ "entity_id": {
3129
+ "name": "entity_id",
1147
3130
  "type": "uuid",
1148
3131
  "unsigned": false,
1149
3132
  "autoincrement": false,
@@ -1158,13 +3141,13 @@
1158
3141
  "enumItems": [],
1159
3142
  "mappedType": "uuid"
1160
3143
  },
1161
- "company_entity_id": {
1162
- "name": "company_entity_id",
3144
+ "deal_id": {
3145
+ "name": "deal_id",
1163
3146
  "type": "uuid",
1164
3147
  "unsigned": false,
1165
3148
  "autoincrement": false,
1166
3149
  "primary": false,
1167
- "nullable": false,
3150
+ "nullable": true,
1168
3151
  "unique": false,
1169
3152
  "length": null,
1170
3153
  "precision": null,
@@ -1175,23 +3158,25 @@
1175
3158
  "mappedType": "uuid"
1176
3159
  }
1177
3160
  },
1178
- "name": "customer_deal_companies",
3161
+ "name": "customer_activities",
1179
3162
  "schema": "public",
1180
3163
  "indexes": [
1181
3164
  {
1182
- "keyName": "customer_deal_companies_company_idx",
3165
+ "keyName": "customer_activities_entity_occurred_created_idx",
1183
3166
  "columnNames": [
1184
- "company_entity_id"
3167
+ "entity_id",
3168
+ "occurred_at",
3169
+ "created_at"
1185
3170
  ],
1186
- "composite": false,
3171
+ "composite": true,
1187
3172
  "constraint": false,
1188
3173
  "primary": false,
1189
3174
  "unique": false
1190
3175
  },
1191
3176
  {
1192
- "keyName": "customer_deal_companies_deal_idx",
3177
+ "keyName": "customer_activities_entity_idx",
1193
3178
  "columnNames": [
1194
- "deal_id"
3179
+ "entity_id"
1195
3180
  ],
1196
3181
  "composite": false,
1197
3182
  "constraint": false,
@@ -1199,18 +3184,18 @@
1199
3184
  "unique": false
1200
3185
  },
1201
3186
  {
1202
- "keyName": "customer_deal_companies_unique",
3187
+ "keyName": "customer_activities_org_tenant_idx",
1203
3188
  "columnNames": [
1204
- "deal_id",
1205
- "company_entity_id"
3189
+ "organization_id",
3190
+ "tenant_id"
1206
3191
  ],
1207
3192
  "composite": true,
1208
- "constraint": true,
3193
+ "constraint": false,
1209
3194
  "primary": false,
1210
- "unique": true
3195
+ "unique": false
1211
3196
  },
1212
3197
  {
1213
- "keyName": "customer_deal_companies_pkey",
3198
+ "keyName": "customer_activities_pkey",
1214
3199
  "columnNames": [
1215
3200
  "id"
1216
3201
  ],
@@ -1222,28 +3207,29 @@
1222
3207
  ],
1223
3208
  "checks": [],
1224
3209
  "foreignKeys": {
1225
- "customer_deal_companies_deal_id_foreign": {
1226
- "constraintName": "customer_deal_companies_deal_id_foreign",
3210
+ "customer_activities_entity_id_foreign": {
3211
+ "constraintName": "customer_activities_entity_id_foreign",
1227
3212
  "columnNames": [
1228
- "deal_id"
3213
+ "entity_id"
1229
3214
  ],
1230
- "localTableName": "public.customer_deal_companies",
3215
+ "localTableName": "public.customer_activities",
1231
3216
  "referencedColumnNames": [
1232
3217
  "id"
1233
3218
  ],
1234
- "referencedTableName": "public.customer_deals",
3219
+ "referencedTableName": "public.customer_entities",
1235
3220
  "updateRule": "cascade"
1236
3221
  },
1237
- "customer_deal_companies_company_entity_id_foreign": {
1238
- "constraintName": "customer_deal_companies_company_entity_id_foreign",
3222
+ "customer_activities_deal_id_foreign": {
3223
+ "constraintName": "customer_activities_deal_id_foreign",
1239
3224
  "columnNames": [
1240
- "company_entity_id"
3225
+ "deal_id"
1241
3226
  ],
1242
- "localTableName": "public.customer_deal_companies",
3227
+ "localTableName": "public.customer_activities",
1243
3228
  "referencedColumnNames": [
1244
3229
  "id"
1245
3230
  ],
1246
- "referencedTableName": "public.customer_entities",
3231
+ "referencedTableName": "public.customer_deals",
3232
+ "deleteRule": "set null",
1247
3233
  "updateRule": "cascade"
1248
3234
  }
1249
3235
  },
@@ -1267,9 +3253,9 @@
1267
3253
  "enumItems": [],
1268
3254
  "mappedType": "uuid"
1269
3255
  },
1270
- "organization_id": {
1271
- "name": "organization_id",
1272
- "type": "uuid",
3256
+ "entity_type": {
3257
+ "name": "entity_type",
3258
+ "type": "text",
1273
3259
  "unsigned": false,
1274
3260
  "autoincrement": false,
1275
3261
  "primary": false,
@@ -1281,10 +3267,10 @@
1281
3267
  "default": null,
1282
3268
  "comment": null,
1283
3269
  "enumItems": [],
1284
- "mappedType": "uuid"
3270
+ "mappedType": "text"
1285
3271
  },
1286
- "tenant_id": {
1287
- "name": "tenant_id",
3272
+ "entity_id": {
3273
+ "name": "entity_id",
1288
3274
  "type": "uuid",
1289
3275
  "unsigned": false,
1290
3276
  "autoincrement": false,
@@ -1299,45 +3285,13 @@
1299
3285
  "enumItems": [],
1300
3286
  "mappedType": "uuid"
1301
3287
  },
1302
- "legal_name": {
1303
- "name": "legal_name",
1304
- "type": "text",
1305
- "unsigned": false,
1306
- "autoincrement": false,
1307
- "primary": false,
1308
- "nullable": true,
1309
- "unique": false,
1310
- "length": null,
1311
- "precision": null,
1312
- "scale": null,
1313
- "default": null,
1314
- "comment": null,
1315
- "enumItems": [],
1316
- "mappedType": "text"
1317
- },
1318
- "brand_name": {
1319
- "name": "brand_name",
1320
- "type": "text",
1321
- "unsigned": false,
1322
- "autoincrement": false,
1323
- "primary": false,
1324
- "nullable": true,
1325
- "unique": false,
1326
- "length": null,
1327
- "precision": null,
1328
- "scale": null,
1329
- "default": null,
1330
- "comment": null,
1331
- "enumItems": [],
1332
- "mappedType": "text"
1333
- },
1334
- "domain": {
1335
- "name": "domain",
1336
- "type": "text",
3288
+ "user_id": {
3289
+ "name": "user_id",
3290
+ "type": "uuid",
1337
3291
  "unsigned": false,
1338
3292
  "autoincrement": false,
1339
3293
  "primary": false,
1340
- "nullable": true,
3294
+ "nullable": false,
1341
3295
  "unique": false,
1342
3296
  "length": null,
1343
3297
  "precision": null,
@@ -1345,15 +3299,15 @@
1345
3299
  "default": null,
1346
3300
  "comment": null,
1347
3301
  "enumItems": [],
1348
- "mappedType": "text"
3302
+ "mappedType": "uuid"
1349
3303
  },
1350
- "website_url": {
1351
- "name": "website_url",
3304
+ "role_type": {
3305
+ "name": "role_type",
1352
3306
  "type": "text",
1353
3307
  "unsigned": false,
1354
3308
  "autoincrement": false,
1355
3309
  "primary": false,
1356
- "nullable": true,
3310
+ "nullable": false,
1357
3311
  "unique": false,
1358
3312
  "length": null,
1359
3313
  "precision": null,
@@ -1363,13 +3317,13 @@
1363
3317
  "enumItems": [],
1364
3318
  "mappedType": "text"
1365
3319
  },
1366
- "industry": {
1367
- "name": "industry",
1368
- "type": "text",
3320
+ "organization_id": {
3321
+ "name": "organization_id",
3322
+ "type": "uuid",
1369
3323
  "unsigned": false,
1370
3324
  "autoincrement": false,
1371
3325
  "primary": false,
1372
- "nullable": true,
3326
+ "nullable": false,
1373
3327
  "unique": false,
1374
3328
  "length": null,
1375
3329
  "precision": null,
@@ -1377,15 +3331,15 @@
1377
3331
  "default": null,
1378
3332
  "comment": null,
1379
3333
  "enumItems": [],
1380
- "mappedType": "text"
3334
+ "mappedType": "uuid"
1381
3335
  },
1382
- "size_bucket": {
1383
- "name": "size_bucket",
1384
- "type": "text",
3336
+ "tenant_id": {
3337
+ "name": "tenant_id",
3338
+ "type": "uuid",
1385
3339
  "unsigned": false,
1386
3340
  "autoincrement": false,
1387
3341
  "primary": false,
1388
- "nullable": true,
3342
+ "nullable": false,
1389
3343
  "unique": false,
1390
3344
  "length": null,
1391
3345
  "precision": null,
@@ -1393,23 +3347,7 @@
1393
3347
  "default": null,
1394
3348
  "comment": null,
1395
3349
  "enumItems": [],
1396
- "mappedType": "text"
1397
- },
1398
- "annual_revenue": {
1399
- "name": "annual_revenue",
1400
- "type": "numeric(16,2)",
1401
- "unsigned": false,
1402
- "autoincrement": false,
1403
- "primary": false,
1404
- "nullable": true,
1405
- "unique": false,
1406
- "length": null,
1407
- "precision": 16,
1408
- "scale": 2,
1409
- "default": null,
1410
- "comment": null,
1411
- "enumItems": [],
1412
- "mappedType": "decimal"
3350
+ "mappedType": "uuid"
1413
3351
  },
1414
3352
  "created_at": {
1415
3353
  "name": "created_at",
@@ -1443,47 +3381,37 @@
1443
3381
  "enumItems": [],
1444
3382
  "mappedType": "datetime"
1445
3383
  },
1446
- "entity_id": {
1447
- "name": "entity_id",
1448
- "type": "uuid",
3384
+ "deleted_at": {
3385
+ "name": "deleted_at",
3386
+ "type": "timestamptz",
1449
3387
  "unsigned": false,
1450
3388
  "autoincrement": false,
1451
3389
  "primary": false,
1452
- "nullable": false,
3390
+ "nullable": true,
1453
3391
  "unique": false,
1454
- "length": null,
3392
+ "length": 6,
1455
3393
  "precision": null,
1456
3394
  "scale": null,
1457
3395
  "default": null,
1458
3396
  "comment": null,
1459
3397
  "enumItems": [],
1460
- "mappedType": "uuid"
3398
+ "mappedType": "datetime"
1461
3399
  }
1462
3400
  },
1463
- "name": "customer_companies",
3401
+ "name": "customer_entity_roles",
1464
3402
  "schema": "public",
1465
3403
  "indexes": [
1466
3404
  {
1467
- "columnNames": [
1468
- "entity_id"
1469
- ],
1470
- "composite": false,
1471
- "keyName": "customer_companies_entity_id_unique",
1472
- "constraint": true,
1473
- "primary": false,
1474
- "unique": true
1475
- },
1476
- {
1477
- "keyName": "idx_customer_companies_entity_id",
3405
+ "keyName": "customer_entity_roles_active_unique",
1478
3406
  "columnNames": [],
1479
3407
  "composite": false,
1480
3408
  "constraint": false,
1481
3409
  "primary": false,
1482
3410
  "unique": false,
1483
- "expression": "create index \"idx_customer_companies_entity_id\" on \"customer_companies\" (\"entity_id\")"
3411
+ "expression": "create unique index \"customer_entity_roles_active_unique\" on \"customer_entity_roles\" (\"entity_type\", \"entity_id\", \"role_type\") where \"deleted_at\" is null"
1484
3412
  },
1485
3413
  {
1486
- "keyName": "customer_companies_org_tenant_idx",
3414
+ "keyName": "customer_entity_roles_scope_idx",
1487
3415
  "columnNames": [
1488
3416
  "organization_id",
1489
3417
  "tenant_id"
@@ -1494,7 +3422,18 @@
1494
3422
  "unique": false
1495
3423
  },
1496
3424
  {
1497
- "keyName": "customer_companies_pkey",
3425
+ "keyName": "customer_entity_roles_entity_idx",
3426
+ "columnNames": [
3427
+ "entity_type",
3428
+ "entity_id"
3429
+ ],
3430
+ "composite": true,
3431
+ "constraint": false,
3432
+ "primary": false,
3433
+ "unique": false
3434
+ },
3435
+ {
3436
+ "keyName": "customer_entity_roles_pkey",
1498
3437
  "columnNames": [
1499
3438
  "id"
1500
3439
  ],
@@ -1505,20 +3444,7 @@
1505
3444
  }
1506
3445
  ],
1507
3446
  "checks": [],
1508
- "foreignKeys": {
1509
- "customer_companies_entity_id_foreign": {
1510
- "constraintName": "customer_companies_entity_id_foreign",
1511
- "columnNames": [
1512
- "entity_id"
1513
- ],
1514
- "localTableName": "public.customer_companies",
1515
- "referencedColumnNames": [
1516
- "id"
1517
- ],
1518
- "referencedTableName": "public.customer_entities",
1519
- "updateRule": "cascade"
1520
- }
1521
- },
3447
+ "foreignKeys": {},
1522
3448
  "nativeEnums": {}
1523
3449
  },
1524
3450
  {
@@ -1571,8 +3497,8 @@
1571
3497
  "enumItems": [],
1572
3498
  "mappedType": "uuid"
1573
3499
  },
1574
- "body": {
1575
- "name": "body",
3500
+ "interaction_type": {
3501
+ "name": "interaction_type",
1576
3502
  "type": "text",
1577
3503
  "unsigned": false,
1578
3504
  "autoincrement": false,
@@ -1587,24 +3513,8 @@
1587
3513
  "enumItems": [],
1588
3514
  "mappedType": "text"
1589
3515
  },
1590
- "author_user_id": {
1591
- "name": "author_user_id",
1592
- "type": "uuid",
1593
- "unsigned": false,
1594
- "autoincrement": false,
1595
- "primary": false,
1596
- "nullable": true,
1597
- "unique": false,
1598
- "length": null,
1599
- "precision": null,
1600
- "scale": null,
1601
- "default": null,
1602
- "comment": null,
1603
- "enumItems": [],
1604
- "mappedType": "uuid"
1605
- },
1606
- "appearance_icon": {
1607
- "name": "appearance_icon",
3516
+ "title": {
3517
+ "name": "title",
1608
3518
  "type": "text",
1609
3519
  "unsigned": false,
1610
3520
  "autoincrement": false,
@@ -1619,8 +3529,8 @@
1619
3529
  "enumItems": [],
1620
3530
  "mappedType": "text"
1621
3531
  },
1622
- "appearance_color": {
1623
- "name": "appearance_color",
3532
+ "body": {
3533
+ "name": "body",
1624
3534
  "type": "text",
1625
3535
  "unsigned": false,
1626
3536
  "autoincrement": false,
@@ -1635,29 +3545,29 @@
1635
3545
  "enumItems": [],
1636
3546
  "mappedType": "text"
1637
3547
  },
1638
- "created_at": {
1639
- "name": "created_at",
1640
- "type": "timestamptz",
3548
+ "status": {
3549
+ "name": "status",
3550
+ "type": "text",
1641
3551
  "unsigned": false,
1642
3552
  "autoincrement": false,
1643
3553
  "primary": false,
1644
3554
  "nullable": false,
1645
3555
  "unique": false,
1646
- "length": 6,
3556
+ "length": null,
1647
3557
  "precision": null,
1648
3558
  "scale": null,
1649
- "default": null,
3559
+ "default": "'planned'",
1650
3560
  "comment": null,
1651
3561
  "enumItems": [],
1652
- "mappedType": "datetime"
3562
+ "mappedType": "text"
1653
3563
  },
1654
- "updated_at": {
1655
- "name": "updated_at",
3564
+ "scheduled_at": {
3565
+ "name": "scheduled_at",
1656
3566
  "type": "timestamptz",
1657
3567
  "unsigned": false,
1658
3568
  "autoincrement": false,
1659
3569
  "primary": false,
1660
- "nullable": false,
3570
+ "nullable": true,
1661
3571
  "unique": false,
1662
3572
  "length": 6,
1663
3573
  "precision": null,
@@ -1667,8 +3577,8 @@
1667
3577
  "enumItems": [],
1668
3578
  "mappedType": "datetime"
1669
3579
  },
1670
- "deleted_at": {
1671
- "name": "deleted_at",
3580
+ "occurred_at": {
3581
+ "name": "occurred_at",
1672
3582
  "type": "timestamptz",
1673
3583
  "unsigned": false,
1674
3584
  "autoincrement": false,
@@ -1683,13 +3593,13 @@
1683
3593
  "enumItems": [],
1684
3594
  "mappedType": "datetime"
1685
3595
  },
1686
- "entity_id": {
1687
- "name": "entity_id",
1688
- "type": "uuid",
3596
+ "priority": {
3597
+ "name": "priority",
3598
+ "type": "int",
1689
3599
  "unsigned": false,
1690
3600
  "autoincrement": false,
1691
3601
  "primary": false,
1692
- "nullable": false,
3602
+ "nullable": true,
1693
3603
  "unique": false,
1694
3604
  "length": null,
1695
3605
  "precision": null,
@@ -1697,10 +3607,10 @@
1697
3607
  "default": null,
1698
3608
  "comment": null,
1699
3609
  "enumItems": [],
1700
- "mappedType": "uuid"
3610
+ "mappedType": "integer"
1701
3611
  },
1702
- "deal_id": {
1703
- "name": "deal_id",
3612
+ "author_user_id": {
3613
+ "name": "author_user_id",
1704
3614
  "type": "uuid",
1705
3615
  "unsigned": false,
1706
3616
  "autoincrement": false,
@@ -1714,98 +3624,14 @@
1714
3624
  "comment": null,
1715
3625
  "enumItems": [],
1716
3626
  "mappedType": "uuid"
1717
- }
1718
- },
1719
- "name": "customer_comments",
1720
- "schema": "public",
1721
- "indexes": [
1722
- {
1723
- "keyName": "customer_comments_entity_created_idx",
1724
- "columnNames": [
1725
- "entity_id",
1726
- "created_at"
1727
- ],
1728
- "composite": true,
1729
- "constraint": false,
1730
- "primary": false,
1731
- "unique": false
1732
- },
1733
- {
1734
- "keyName": "customer_comments_entity_idx",
1735
- "columnNames": [
1736
- "entity_id"
1737
- ],
1738
- "composite": false,
1739
- "constraint": false,
1740
- "primary": false,
1741
- "unique": false
1742
- },
1743
- {
1744
- "keyName": "customer_comments_pkey",
1745
- "columnNames": [
1746
- "id"
1747
- ],
1748
- "composite": false,
1749
- "constraint": true,
1750
- "primary": true,
1751
- "unique": true
1752
- }
1753
- ],
1754
- "checks": [],
1755
- "foreignKeys": {
1756
- "customer_comments_entity_id_foreign": {
1757
- "constraintName": "customer_comments_entity_id_foreign",
1758
- "columnNames": [
1759
- "entity_id"
1760
- ],
1761
- "localTableName": "public.customer_comments",
1762
- "referencedColumnNames": [
1763
- "id"
1764
- ],
1765
- "referencedTableName": "public.customer_entities",
1766
- "updateRule": "cascade"
1767
- },
1768
- "customer_comments_deal_id_foreign": {
1769
- "constraintName": "customer_comments_deal_id_foreign",
1770
- "columnNames": [
1771
- "deal_id"
1772
- ],
1773
- "localTableName": "public.customer_comments",
1774
- "referencedColumnNames": [
1775
- "id"
1776
- ],
1777
- "referencedTableName": "public.customer_deals",
1778
- "deleteRule": "set null",
1779
- "updateRule": "cascade"
1780
- }
1781
- },
1782
- "nativeEnums": {}
1783
- },
1784
- {
1785
- "columns": {
1786
- "id": {
1787
- "name": "id",
1788
- "type": "uuid",
1789
- "unsigned": false,
1790
- "autoincrement": false,
1791
- "primary": true,
1792
- "nullable": false,
1793
- "unique": false,
1794
- "length": null,
1795
- "precision": null,
1796
- "scale": null,
1797
- "default": "gen_random_uuid()",
1798
- "comment": null,
1799
- "enumItems": [],
1800
- "mappedType": "uuid"
1801
3627
  },
1802
- "organization_id": {
1803
- "name": "organization_id",
3628
+ "owner_user_id": {
3629
+ "name": "owner_user_id",
1804
3630
  "type": "uuid",
1805
3631
  "unsigned": false,
1806
3632
  "autoincrement": false,
1807
3633
  "primary": false,
1808
- "nullable": false,
3634
+ "nullable": true,
1809
3635
  "unique": false,
1810
3636
  "length": null,
1811
3637
  "precision": null,
@@ -1815,13 +3641,13 @@
1815
3641
  "enumItems": [],
1816
3642
  "mappedType": "uuid"
1817
3643
  },
1818
- "tenant_id": {
1819
- "name": "tenant_id",
1820
- "type": "uuid",
3644
+ "appearance_icon": {
3645
+ "name": "appearance_icon",
3646
+ "type": "text",
1821
3647
  "unsigned": false,
1822
3648
  "autoincrement": false,
1823
3649
  "primary": false,
1824
- "nullable": false,
3650
+ "nullable": true,
1825
3651
  "unique": false,
1826
3652
  "length": null,
1827
3653
  "precision": null,
@@ -1829,10 +3655,10 @@
1829
3655
  "default": null,
1830
3656
  "comment": null,
1831
3657
  "enumItems": [],
1832
- "mappedType": "uuid"
3658
+ "mappedType": "text"
1833
3659
  },
1834
- "name": {
1835
- "name": "name",
3660
+ "appearance_color": {
3661
+ "name": "appearance_color",
1836
3662
  "type": "text",
1837
3663
  "unsigned": false,
1838
3664
  "autoincrement": false,
@@ -1847,8 +3673,8 @@
1847
3673
  "enumItems": [],
1848
3674
  "mappedType": "text"
1849
3675
  },
1850
- "purpose": {
1851
- "name": "purpose",
3676
+ "source": {
3677
+ "name": "source",
1852
3678
  "type": "text",
1853
3679
  "unsigned": false,
1854
3680
  "autoincrement": false,
@@ -1863,9 +3689,9 @@
1863
3689
  "enumItems": [],
1864
3690
  "mappedType": "text"
1865
3691
  },
1866
- "company_name": {
1867
- "name": "company_name",
1868
- "type": "text",
3692
+ "deal_id": {
3693
+ "name": "deal_id",
3694
+ "type": "uuid",
1869
3695
  "unsigned": false,
1870
3696
  "autoincrement": false,
1871
3697
  "primary": false,
@@ -1877,15 +3703,15 @@
1877
3703
  "default": null,
1878
3704
  "comment": null,
1879
3705
  "enumItems": [],
1880
- "mappedType": "text"
3706
+ "mappedType": "uuid"
1881
3707
  },
1882
- "address_line1": {
1883
- "name": "address_line1",
1884
- "type": "text",
3708
+ "duration_minutes": {
3709
+ "name": "duration_minutes",
3710
+ "type": "int",
1885
3711
  "unsigned": false,
1886
3712
  "autoincrement": false,
1887
3713
  "primary": false,
1888
- "nullable": false,
3714
+ "nullable": true,
1889
3715
  "unique": false,
1890
3716
  "length": null,
1891
3717
  "precision": null,
@@ -1893,10 +3719,10 @@
1893
3719
  "default": null,
1894
3720
  "comment": null,
1895
3721
  "enumItems": [],
1896
- "mappedType": "text"
3722
+ "mappedType": "integer"
1897
3723
  },
1898
- "address_line2": {
1899
- "name": "address_line2",
3724
+ "location": {
3725
+ "name": "location",
1900
3726
  "type": "text",
1901
3727
  "unsigned": false,
1902
3728
  "autoincrement": false,
@@ -1911,9 +3737,9 @@
1911
3737
  "enumItems": [],
1912
3738
  "mappedType": "text"
1913
3739
  },
1914
- "city": {
1915
- "name": "city",
1916
- "type": "text",
3740
+ "all_day": {
3741
+ "name": "all_day",
3742
+ "type": "boolean",
1917
3743
  "unsigned": false,
1918
3744
  "autoincrement": false,
1919
3745
  "primary": false,
@@ -1925,10 +3751,10 @@
1925
3751
  "default": null,
1926
3752
  "comment": null,
1927
3753
  "enumItems": [],
1928
- "mappedType": "text"
3754
+ "mappedType": "boolean"
1929
3755
  },
1930
- "region": {
1931
- "name": "region",
3756
+ "recurrence_rule": {
3757
+ "name": "recurrence_rule",
1932
3758
  "type": "text",
1933
3759
  "unsigned": false,
1934
3760
  "autoincrement": false,
@@ -1943,25 +3769,25 @@
1943
3769
  "enumItems": [],
1944
3770
  "mappedType": "text"
1945
3771
  },
1946
- "postal_code": {
1947
- "name": "postal_code",
1948
- "type": "text",
3772
+ "recurrence_end": {
3773
+ "name": "recurrence_end",
3774
+ "type": "timestamptz",
1949
3775
  "unsigned": false,
1950
3776
  "autoincrement": false,
1951
3777
  "primary": false,
1952
3778
  "nullable": true,
1953
3779
  "unique": false,
1954
- "length": null,
3780
+ "length": 6,
1955
3781
  "precision": null,
1956
3782
  "scale": null,
1957
3783
  "default": null,
1958
3784
  "comment": null,
1959
3785
  "enumItems": [],
1960
- "mappedType": "text"
3786
+ "mappedType": "datetime"
1961
3787
  },
1962
- "country": {
1963
- "name": "country",
1964
- "type": "text",
3788
+ "participants": {
3789
+ "name": "participants",
3790
+ "type": "jsonb",
1965
3791
  "unsigned": false,
1966
3792
  "autoincrement": false,
1967
3793
  "primary": false,
@@ -1973,11 +3799,11 @@
1973
3799
  "default": null,
1974
3800
  "comment": null,
1975
3801
  "enumItems": [],
1976
- "mappedType": "text"
3802
+ "mappedType": "json"
1977
3803
  },
1978
- "building_number": {
1979
- "name": "building_number",
1980
- "type": "text",
3804
+ "reminder_minutes": {
3805
+ "name": "reminder_minutes",
3806
+ "type": "int",
1981
3807
  "unsigned": false,
1982
3808
  "autoincrement": false,
1983
3809
  "primary": false,
@@ -1989,10 +3815,10 @@
1989
3815
  "default": null,
1990
3816
  "comment": null,
1991
3817
  "enumItems": [],
1992
- "mappedType": "text"
3818
+ "mappedType": "integer"
1993
3819
  },
1994
- "flat_number": {
1995
- "name": "flat_number",
3820
+ "visibility": {
3821
+ "name": "visibility",
1996
3822
  "type": "text",
1997
3823
  "unsigned": false,
1998
3824
  "autoincrement": false,
@@ -2007,9 +3833,9 @@
2007
3833
  "enumItems": [],
2008
3834
  "mappedType": "text"
2009
3835
  },
2010
- "latitude": {
2011
- "name": "latitude",
2012
- "type": "real",
3836
+ "linked_entities": {
3837
+ "name": "linked_entities",
3838
+ "type": "jsonb",
2013
3839
  "unsigned": false,
2014
3840
  "autoincrement": false,
2015
3841
  "primary": false,
@@ -2021,11 +3847,11 @@
2021
3847
  "default": null,
2022
3848
  "comment": null,
2023
3849
  "enumItems": [],
2024
- "mappedType": "float"
3850
+ "mappedType": "json"
2025
3851
  },
2026
- "longitude": {
2027
- "name": "longitude",
2028
- "type": "real",
3852
+ "guest_permissions": {
3853
+ "name": "guest_permissions",
3854
+ "type": "jsonb",
2029
3855
  "unsigned": false,
2030
3856
  "autoincrement": false,
2031
3857
  "primary": false,
@@ -2037,10 +3863,10 @@
2037
3863
  "default": null,
2038
3864
  "comment": null,
2039
3865
  "enumItems": [],
2040
- "mappedType": "float"
3866
+ "mappedType": "json"
2041
3867
  },
2042
- "is_primary": {
2043
- "name": "is_primary",
3868
+ "pinned": {
3869
+ "name": "pinned",
2044
3870
  "type": "boolean",
2045
3871
  "unsigned": false,
2046
3872
  "autoincrement": false,
@@ -2087,38 +3913,82 @@
2087
3913
  "enumItems": [],
2088
3914
  "mappedType": "datetime"
2089
3915
  },
3916
+ "deleted_at": {
3917
+ "name": "deleted_at",
3918
+ "type": "timestamptz",
3919
+ "unsigned": false,
3920
+ "autoincrement": false,
3921
+ "primary": false,
3922
+ "nullable": true,
3923
+ "unique": false,
3924
+ "length": 6,
3925
+ "precision": null,
3926
+ "scale": null,
3927
+ "default": null,
3928
+ "comment": null,
3929
+ "enumItems": [],
3930
+ "mappedType": "datetime"
3931
+ },
2090
3932
  "entity_id": {
2091
3933
  "name": "entity_id",
2092
3934
  "type": "uuid",
2093
3935
  "unsigned": false,
2094
3936
  "autoincrement": false,
2095
3937
  "primary": false,
2096
- "nullable": false,
2097
- "unique": false,
2098
- "length": null,
2099
- "precision": null,
2100
- "scale": null,
2101
- "default": null,
2102
- "comment": null,
2103
- "enumItems": [],
2104
- "mappedType": "uuid"
2105
- }
2106
- },
2107
- "name": "customer_addresses",
2108
- "schema": "public",
2109
- "indexes": [
3938
+ "nullable": false,
3939
+ "unique": false,
3940
+ "length": null,
3941
+ "precision": null,
3942
+ "scale": null,
3943
+ "default": null,
3944
+ "comment": null,
3945
+ "enumItems": [],
3946
+ "mappedType": "uuid"
3947
+ }
3948
+ },
3949
+ "name": "customer_interactions",
3950
+ "schema": "public",
3951
+ "indexes": [
3952
+ {
3953
+ "keyName": "customer_interactions_type_idx",
3954
+ "columnNames": [
3955
+ "tenant_id",
3956
+ "organization_id",
3957
+ "interaction_type"
3958
+ ],
3959
+ "composite": true,
3960
+ "constraint": false,
3961
+ "primary": false,
3962
+ "unique": false
3963
+ },
3964
+ {
3965
+ "keyName": "customer_interactions_org_tenant_status_idx",
3966
+ "columnNames": [
3967
+ "organization_id",
3968
+ "tenant_id",
3969
+ "status",
3970
+ "scheduled_at"
3971
+ ],
3972
+ "composite": true,
3973
+ "constraint": false,
3974
+ "primary": false,
3975
+ "unique": false
3976
+ },
2110
3977
  {
2111
- "keyName": "customer_addresses_entity_idx",
3978
+ "keyName": "customer_interactions_entity_status_scheduled_idx",
2112
3979
  "columnNames": [
2113
- "entity_id"
3980
+ "entity_id",
3981
+ "status",
3982
+ "scheduled_at",
3983
+ "created_at"
2114
3984
  ],
2115
- "composite": false,
3985
+ "composite": true,
2116
3986
  "constraint": false,
2117
3987
  "primary": false,
2118
3988
  "unique": false
2119
3989
  },
2120
3990
  {
2121
- "keyName": "customer_addresses_pkey",
3991
+ "keyName": "customer_interactions_pkey",
2122
3992
  "columnNames": [
2123
3993
  "id"
2124
3994
  ],
@@ -2130,12 +4000,12 @@
2130
4000
  ],
2131
4001
  "checks": [],
2132
4002
  "foreignKeys": {
2133
- "customer_addresses_entity_id_foreign": {
2134
- "constraintName": "customer_addresses_entity_id_foreign",
4003
+ "customer_interactions_entity_id_foreign": {
4004
+ "constraintName": "customer_interactions_entity_id_foreign",
2135
4005
  "columnNames": [
2136
4006
  "entity_id"
2137
4007
  ],
2138
- "localTableName": "public.customer_addresses",
4008
+ "localTableName": "public.customer_interactions",
2139
4009
  "referencedColumnNames": [
2140
4010
  "id"
2141
4011
  ],
@@ -2195,9 +4065,9 @@
2195
4065
  "enumItems": [],
2196
4066
  "mappedType": "uuid"
2197
4067
  },
2198
- "activity_type": {
2199
- "name": "activity_type",
2200
- "type": "text",
4068
+ "user_id": {
4069
+ "name": "user_id",
4070
+ "type": "uuid",
2201
4071
  "unsigned": false,
2202
4072
  "autoincrement": false,
2203
4073
  "primary": false,
@@ -2209,15 +4079,15 @@
2209
4079
  "default": null,
2210
4080
  "comment": null,
2211
4081
  "enumItems": [],
2212
- "mappedType": "text"
4082
+ "mappedType": "uuid"
2213
4083
  },
2214
- "subject": {
2215
- "name": "subject",
4084
+ "slug": {
4085
+ "name": "slug",
2216
4086
  "type": "text",
2217
4087
  "unsigned": false,
2218
4088
  "autoincrement": false,
2219
4089
  "primary": false,
2220
- "nullable": true,
4090
+ "nullable": false,
2221
4091
  "unique": false,
2222
4092
  "length": null,
2223
4093
  "precision": null,
@@ -2227,13 +4097,13 @@
2227
4097
  "enumItems": [],
2228
4098
  "mappedType": "text"
2229
4099
  },
2230
- "body": {
2231
- "name": "body",
4100
+ "label": {
4101
+ "name": "label",
2232
4102
  "type": "text",
2233
4103
  "unsigned": false,
2234
4104
  "autoincrement": false,
2235
4105
  "primary": false,
2236
- "nullable": true,
4106
+ "nullable": false,
2237
4107
  "unique": false,
2238
4108
  "length": null,
2239
4109
  "precision": null,
@@ -2243,13 +4113,13 @@
2243
4113
  "enumItems": [],
2244
4114
  "mappedType": "text"
2245
4115
  },
2246
- "occurred_at": {
2247
- "name": "occurred_at",
4116
+ "created_at": {
4117
+ "name": "created_at",
2248
4118
  "type": "timestamptz",
2249
4119
  "unsigned": false,
2250
4120
  "autoincrement": false,
2251
4121
  "primary": false,
2252
- "nullable": true,
4122
+ "nullable": false,
2253
4123
  "unique": false,
2254
4124
  "length": 6,
2255
4125
  "precision": null,
@@ -2259,29 +4129,91 @@
2259
4129
  "enumItems": [],
2260
4130
  "mappedType": "datetime"
2261
4131
  },
2262
- "author_user_id": {
2263
- "name": "author_user_id",
2264
- "type": "uuid",
4132
+ "updated_at": {
4133
+ "name": "updated_at",
4134
+ "type": "timestamptz",
2265
4135
  "unsigned": false,
2266
4136
  "autoincrement": false,
2267
4137
  "primary": false,
2268
- "nullable": true,
4138
+ "nullable": false,
2269
4139
  "unique": false,
2270
- "length": null,
4140
+ "length": 6,
2271
4141
  "precision": null,
2272
4142
  "scale": null,
2273
4143
  "default": null,
2274
4144
  "comment": null,
2275
4145
  "enumItems": [],
4146
+ "mappedType": "datetime"
4147
+ }
4148
+ },
4149
+ "name": "customer_labels",
4150
+ "schema": "public",
4151
+ "indexes": [
4152
+ {
4153
+ "keyName": "customer_labels_scope_idx",
4154
+ "columnNames": [
4155
+ "organization_id",
4156
+ "tenant_id",
4157
+ "user_id"
4158
+ ],
4159
+ "composite": true,
4160
+ "constraint": false,
4161
+ "primary": false,
4162
+ "unique": false
4163
+ },
4164
+ {
4165
+ "keyName": "customer_labels_unique",
4166
+ "columnNames": [
4167
+ "user_id",
4168
+ "tenant_id",
4169
+ "organization_id",
4170
+ "slug"
4171
+ ],
4172
+ "composite": true,
4173
+ "constraint": true,
4174
+ "primary": false,
4175
+ "unique": true
4176
+ },
4177
+ {
4178
+ "keyName": "customer_labels_pkey",
4179
+ "columnNames": [
4180
+ "id"
4181
+ ],
4182
+ "composite": false,
4183
+ "constraint": true,
4184
+ "primary": true,
4185
+ "unique": true
4186
+ }
4187
+ ],
4188
+ "checks": [],
4189
+ "foreignKeys": {},
4190
+ "nativeEnums": {}
4191
+ },
4192
+ {
4193
+ "columns": {
4194
+ "id": {
4195
+ "name": "id",
4196
+ "type": "uuid",
4197
+ "unsigned": false,
4198
+ "autoincrement": false,
4199
+ "primary": true,
4200
+ "nullable": false,
4201
+ "unique": false,
4202
+ "length": null,
4203
+ "precision": null,
4204
+ "scale": null,
4205
+ "default": "gen_random_uuid()",
4206
+ "comment": null,
4207
+ "enumItems": [],
2276
4208
  "mappedType": "uuid"
2277
4209
  },
2278
- "appearance_icon": {
2279
- "name": "appearance_icon",
2280
- "type": "text",
4210
+ "organization_id": {
4211
+ "name": "organization_id",
4212
+ "type": "uuid",
2281
4213
  "unsigned": false,
2282
4214
  "autoincrement": false,
2283
4215
  "primary": false,
2284
- "nullable": true,
4216
+ "nullable": false,
2285
4217
  "unique": false,
2286
4218
  "length": null,
2287
4219
  "precision": null,
@@ -2289,15 +4221,15 @@
2289
4221
  "default": null,
2290
4222
  "comment": null,
2291
4223
  "enumItems": [],
2292
- "mappedType": "text"
4224
+ "mappedType": "uuid"
2293
4225
  },
2294
- "appearance_color": {
2295
- "name": "appearance_color",
2296
- "type": "text",
4226
+ "tenant_id": {
4227
+ "name": "tenant_id",
4228
+ "type": "uuid",
2297
4229
  "unsigned": false,
2298
4230
  "autoincrement": false,
2299
4231
  "primary": false,
2300
- "nullable": true,
4232
+ "nullable": false,
2301
4233
  "unique": false,
2302
4234
  "length": null,
2303
4235
  "precision": null,
@@ -2305,39 +4237,39 @@
2305
4237
  "default": null,
2306
4238
  "comment": null,
2307
4239
  "enumItems": [],
2308
- "mappedType": "text"
4240
+ "mappedType": "uuid"
2309
4241
  },
2310
- "created_at": {
2311
- "name": "created_at",
2312
- "type": "timestamptz",
4242
+ "user_id": {
4243
+ "name": "user_id",
4244
+ "type": "uuid",
2313
4245
  "unsigned": false,
2314
4246
  "autoincrement": false,
2315
4247
  "primary": false,
2316
4248
  "nullable": false,
2317
4249
  "unique": false,
2318
- "length": 6,
4250
+ "length": null,
2319
4251
  "precision": null,
2320
4252
  "scale": null,
2321
4253
  "default": null,
2322
4254
  "comment": null,
2323
4255
  "enumItems": [],
2324
- "mappedType": "datetime"
4256
+ "mappedType": "uuid"
2325
4257
  },
2326
- "updated_at": {
2327
- "name": "updated_at",
2328
- "type": "timestamptz",
4258
+ "label_id": {
4259
+ "name": "label_id",
4260
+ "type": "uuid",
2329
4261
  "unsigned": false,
2330
4262
  "autoincrement": false,
2331
4263
  "primary": false,
2332
4264
  "nullable": false,
2333
4265
  "unique": false,
2334
- "length": 6,
4266
+ "length": null,
2335
4267
  "precision": null,
2336
4268
  "scale": null,
2337
4269
  "default": null,
2338
4270
  "comment": null,
2339
4271
  "enumItems": [],
2340
- "mappedType": "datetime"
4272
+ "mappedType": "uuid"
2341
4273
  },
2342
4274
  "entity_id": {
2343
4275
  "name": "entity_id",
@@ -2355,40 +4287,28 @@
2355
4287
  "enumItems": [],
2356
4288
  "mappedType": "uuid"
2357
4289
  },
2358
- "deal_id": {
2359
- "name": "deal_id",
2360
- "type": "uuid",
4290
+ "created_at": {
4291
+ "name": "created_at",
4292
+ "type": "timestamptz",
2361
4293
  "unsigned": false,
2362
4294
  "autoincrement": false,
2363
4295
  "primary": false,
2364
- "nullable": true,
4296
+ "nullable": false,
2365
4297
  "unique": false,
2366
- "length": null,
4298
+ "length": 6,
2367
4299
  "precision": null,
2368
4300
  "scale": null,
2369
4301
  "default": null,
2370
4302
  "comment": null,
2371
4303
  "enumItems": [],
2372
- "mappedType": "uuid"
4304
+ "mappedType": "datetime"
2373
4305
  }
2374
4306
  },
2375
- "name": "customer_activities",
4307
+ "name": "customer_label_assignments",
2376
4308
  "schema": "public",
2377
4309
  "indexes": [
2378
4310
  {
2379
- "keyName": "customer_activities_entity_occurred_created_idx",
2380
- "columnNames": [
2381
- "entity_id",
2382
- "occurred_at",
2383
- "created_at"
2384
- ],
2385
- "composite": true,
2386
- "constraint": false,
2387
- "primary": false,
2388
- "unique": false
2389
- },
2390
- {
2391
- "keyName": "customer_activities_entity_idx",
4311
+ "keyName": "customer_label_assignments_entity_idx",
2392
4312
  "columnNames": [
2393
4313
  "entity_id"
2394
4314
  ],
@@ -2398,18 +4318,18 @@
2398
4318
  "unique": false
2399
4319
  },
2400
4320
  {
2401
- "keyName": "customer_activities_org_tenant_idx",
4321
+ "keyName": "customer_label_assignments_unique",
2402
4322
  "columnNames": [
2403
- "organization_id",
2404
- "tenant_id"
4323
+ "label_id",
4324
+ "entity_id"
2405
4325
  ],
2406
4326
  "composite": true,
2407
- "constraint": false,
4327
+ "constraint": true,
2408
4328
  "primary": false,
2409
- "unique": false
4329
+ "unique": true
2410
4330
  },
2411
4331
  {
2412
- "keyName": "customer_activities_pkey",
4332
+ "keyName": "customer_label_assignments_pkey",
2413
4333
  "columnNames": [
2414
4334
  "id"
2415
4335
  ],
@@ -2421,29 +4341,28 @@
2421
4341
  ],
2422
4342
  "checks": [],
2423
4343
  "foreignKeys": {
2424
- "customer_activities_entity_id_foreign": {
2425
- "constraintName": "customer_activities_entity_id_foreign",
4344
+ "customer_label_assignments_label_id_foreign": {
4345
+ "constraintName": "customer_label_assignments_label_id_foreign",
2426
4346
  "columnNames": [
2427
- "entity_id"
4347
+ "label_id"
2428
4348
  ],
2429
- "localTableName": "public.customer_activities",
4349
+ "localTableName": "public.customer_label_assignments",
2430
4350
  "referencedColumnNames": [
2431
4351
  "id"
2432
4352
  ],
2433
- "referencedTableName": "public.customer_entities",
4353
+ "referencedTableName": "public.customer_labels",
2434
4354
  "updateRule": "cascade"
2435
4355
  },
2436
- "customer_activities_deal_id_foreign": {
2437
- "constraintName": "customer_activities_deal_id_foreign",
4356
+ "customer_label_assignments_entity_id_foreign": {
4357
+ "constraintName": "customer_label_assignments_entity_id_foreign",
2438
4358
  "columnNames": [
2439
- "deal_id"
4359
+ "entity_id"
2440
4360
  ],
2441
- "localTableName": "public.customer_activities",
4361
+ "localTableName": "public.customer_label_assignments",
2442
4362
  "referencedColumnNames": [
2443
4363
  "id"
2444
4364
  ],
2445
- "referencedTableName": "public.customer_deals",
2446
- "deleteRule": "set null",
4365
+ "referencedTableName": "public.customer_entities",
2447
4366
  "updateRule": "cascade"
2448
4367
  }
2449
4368
  },
@@ -2462,66 +4381,18 @@
2462
4381
  "length": null,
2463
4382
  "precision": null,
2464
4383
  "scale": null,
2465
- "default": "gen_random_uuid()",
2466
- "comment": null,
2467
- "enumItems": [],
2468
- "mappedType": "uuid"
2469
- },
2470
- "organization_id": {
2471
- "name": "organization_id",
2472
- "type": "uuid",
2473
- "unsigned": false,
2474
- "autoincrement": false,
2475
- "primary": false,
2476
- "nullable": false,
2477
- "unique": false,
2478
- "length": null,
2479
- "precision": null,
2480
- "scale": null,
2481
- "default": null,
2482
- "comment": null,
2483
- "enumItems": [],
2484
- "mappedType": "uuid"
2485
- },
2486
- "tenant_id": {
2487
- "name": "tenant_id",
2488
- "type": "uuid",
2489
- "unsigned": false,
2490
- "autoincrement": false,
2491
- "primary": false,
2492
- "nullable": false,
2493
- "unique": false,
2494
- "length": null,
2495
- "precision": null,
2496
- "scale": null,
2497
- "default": null,
2498
- "comment": null,
2499
- "enumItems": [],
2500
- "mappedType": "uuid"
2501
- },
2502
- "interaction_type": {
2503
- "name": "interaction_type",
2504
- "type": "text",
2505
- "unsigned": false,
2506
- "autoincrement": false,
2507
- "primary": false,
2508
- "nullable": false,
2509
- "unique": false,
2510
- "length": null,
2511
- "precision": null,
2512
- "scale": null,
2513
- "default": null,
4384
+ "default": "gen_random_uuid()",
2514
4385
  "comment": null,
2515
4386
  "enumItems": [],
2516
- "mappedType": "text"
4387
+ "mappedType": "uuid"
2517
4388
  },
2518
- "title": {
2519
- "name": "title",
2520
- "type": "text",
4389
+ "organization_id": {
4390
+ "name": "organization_id",
4391
+ "type": "uuid",
2521
4392
  "unsigned": false,
2522
4393
  "autoincrement": false,
2523
4394
  "primary": false,
2524
- "nullable": true,
4395
+ "nullable": false,
2525
4396
  "unique": false,
2526
4397
  "length": null,
2527
4398
  "precision": null,
@@ -2529,15 +4400,15 @@
2529
4400
  "default": null,
2530
4401
  "comment": null,
2531
4402
  "enumItems": [],
2532
- "mappedType": "text"
4403
+ "mappedType": "uuid"
2533
4404
  },
2534
- "body": {
2535
- "name": "body",
2536
- "type": "text",
4405
+ "tenant_id": {
4406
+ "name": "tenant_id",
4407
+ "type": "uuid",
2537
4408
  "unsigned": false,
2538
4409
  "autoincrement": false,
2539
4410
  "primary": false,
2540
- "nullable": true,
4411
+ "nullable": false,
2541
4412
  "unique": false,
2542
4413
  "length": null,
2543
4414
  "precision": null,
@@ -2545,11 +4416,11 @@
2545
4416
  "default": null,
2546
4417
  "comment": null,
2547
4418
  "enumItems": [],
2548
- "mappedType": "text"
4419
+ "mappedType": "uuid"
2549
4420
  },
2550
- "status": {
2551
- "name": "status",
2552
- "type": "text",
4421
+ "is_primary": {
4422
+ "name": "is_primary",
4423
+ "type": "boolean",
2553
4424
  "unsigned": false,
2554
4425
  "autoincrement": false,
2555
4426
  "primary": false,
@@ -2558,18 +4429,18 @@
2558
4429
  "length": null,
2559
4430
  "precision": null,
2560
4431
  "scale": null,
2561
- "default": "'planned'",
4432
+ "default": "false",
2562
4433
  "comment": null,
2563
4434
  "enumItems": [],
2564
- "mappedType": "text"
4435
+ "mappedType": "boolean"
2565
4436
  },
2566
- "scheduled_at": {
2567
- "name": "scheduled_at",
4437
+ "created_at": {
4438
+ "name": "created_at",
2568
4439
  "type": "timestamptz",
2569
4440
  "unsigned": false,
2570
4441
  "autoincrement": false,
2571
4442
  "primary": false,
2572
- "nullable": true,
4443
+ "nullable": false,
2573
4444
  "unique": false,
2574
4445
  "length": 6,
2575
4446
  "precision": null,
@@ -2579,13 +4450,13 @@
2579
4450
  "enumItems": [],
2580
4451
  "mappedType": "datetime"
2581
4452
  },
2582
- "occurred_at": {
2583
- "name": "occurred_at",
4453
+ "updated_at": {
4454
+ "name": "updated_at",
2584
4455
  "type": "timestamptz",
2585
4456
  "unsigned": false,
2586
4457
  "autoincrement": false,
2587
4458
  "primary": false,
2588
- "nullable": true,
4459
+ "nullable": false,
2589
4460
  "unique": false,
2590
4461
  "length": 6,
2591
4462
  "precision": null,
@@ -2595,29 +4466,29 @@
2595
4466
  "enumItems": [],
2596
4467
  "mappedType": "datetime"
2597
4468
  },
2598
- "priority": {
2599
- "name": "priority",
2600
- "type": "int",
4469
+ "deleted_at": {
4470
+ "name": "deleted_at",
4471
+ "type": "timestamptz",
2601
4472
  "unsigned": false,
2602
4473
  "autoincrement": false,
2603
4474
  "primary": false,
2604
4475
  "nullable": true,
2605
4476
  "unique": false,
2606
- "length": null,
4477
+ "length": 6,
2607
4478
  "precision": null,
2608
4479
  "scale": null,
2609
4480
  "default": null,
2610
4481
  "comment": null,
2611
4482
  "enumItems": [],
2612
- "mappedType": "integer"
4483
+ "mappedType": "datetime"
2613
4484
  },
2614
- "author_user_id": {
2615
- "name": "author_user_id",
4485
+ "person_entity_id": {
4486
+ "name": "person_entity_id",
2616
4487
  "type": "uuid",
2617
4488
  "unsigned": false,
2618
4489
  "autoincrement": false,
2619
4490
  "primary": false,
2620
- "nullable": true,
4491
+ "nullable": false,
2621
4492
  "unique": false,
2622
4493
  "length": null,
2623
4494
  "precision": null,
@@ -2627,13 +4498,13 @@
2627
4498
  "enumItems": [],
2628
4499
  "mappedType": "uuid"
2629
4500
  },
2630
- "owner_user_id": {
2631
- "name": "owner_user_id",
4501
+ "company_entity_id": {
4502
+ "name": "company_entity_id",
2632
4503
  "type": "uuid",
2633
4504
  "unsigned": false,
2634
4505
  "autoincrement": false,
2635
4506
  "primary": false,
2636
- "nullable": true,
4507
+ "nullable": false,
2637
4508
  "unique": false,
2638
4509
  "length": null,
2639
4510
  "precision": null,
@@ -2642,30 +4513,116 @@
2642
4513
  "comment": null,
2643
4514
  "enumItems": [],
2644
4515
  "mappedType": "uuid"
4516
+ }
4517
+ },
4518
+ "name": "customer_person_company_links",
4519
+ "schema": "public",
4520
+ "indexes": [
4521
+ {
4522
+ "keyName": "customer_person_company_links_active_unique",
4523
+ "columnNames": [],
4524
+ "composite": false,
4525
+ "constraint": false,
4526
+ "primary": false,
4527
+ "unique": false,
4528
+ "expression": "create unique index \"customer_person_company_links_active_unique\" on \"customer_person_company_links\" (\"person_entity_id\", \"company_entity_id\") where \"deleted_at\" is null"
2645
4529
  },
2646
- "appearance_icon": {
2647
- "name": "appearance_icon",
2648
- "type": "text",
4530
+ {
4531
+ "keyName": "customer_person_company_links_scope_idx",
4532
+ "columnNames": [
4533
+ "organization_id",
4534
+ "tenant_id"
4535
+ ],
4536
+ "composite": true,
4537
+ "constraint": false,
4538
+ "primary": false,
4539
+ "unique": false
4540
+ },
4541
+ {
4542
+ "keyName": "customer_person_company_links_company_idx",
4543
+ "columnNames": [
4544
+ "company_entity_id"
4545
+ ],
4546
+ "composite": false,
4547
+ "constraint": false,
4548
+ "primary": false,
4549
+ "unique": false
4550
+ },
4551
+ {
4552
+ "keyName": "customer_person_company_links_person_idx",
4553
+ "columnNames": [
4554
+ "person_entity_id"
4555
+ ],
4556
+ "composite": false,
4557
+ "constraint": false,
4558
+ "primary": false,
4559
+ "unique": false
4560
+ },
4561
+ {
4562
+ "keyName": "customer_person_company_links_pkey",
4563
+ "columnNames": [
4564
+ "id"
4565
+ ],
4566
+ "composite": false,
4567
+ "constraint": true,
4568
+ "primary": true,
4569
+ "unique": true
4570
+ }
4571
+ ],
4572
+ "checks": [],
4573
+ "foreignKeys": {
4574
+ "customer_person_company_links_person_entity_id_foreign": {
4575
+ "constraintName": "customer_person_company_links_person_entity_id_foreign",
4576
+ "columnNames": [
4577
+ "person_entity_id"
4578
+ ],
4579
+ "localTableName": "public.customer_person_company_links",
4580
+ "referencedColumnNames": [
4581
+ "id"
4582
+ ],
4583
+ "referencedTableName": "public.customer_entities",
4584
+ "updateRule": "cascade"
4585
+ },
4586
+ "customer_person_company_links_company_entity_id_foreign": {
4587
+ "constraintName": "customer_person_company_links_company_entity_id_foreign",
4588
+ "columnNames": [
4589
+ "company_entity_id"
4590
+ ],
4591
+ "localTableName": "public.customer_person_company_links",
4592
+ "referencedColumnNames": [
4593
+ "id"
4594
+ ],
4595
+ "referencedTableName": "public.customer_entities",
4596
+ "updateRule": "cascade"
4597
+ }
4598
+ },
4599
+ "nativeEnums": {}
4600
+ },
4601
+ {
4602
+ "columns": {
4603
+ "id": {
4604
+ "name": "id",
4605
+ "type": "uuid",
2649
4606
  "unsigned": false,
2650
4607
  "autoincrement": false,
2651
- "primary": false,
2652
- "nullable": true,
4608
+ "primary": true,
4609
+ "nullable": false,
2653
4610
  "unique": false,
2654
4611
  "length": null,
2655
4612
  "precision": null,
2656
4613
  "scale": null,
2657
- "default": null,
4614
+ "default": "gen_random_uuid()",
2658
4615
  "comment": null,
2659
4616
  "enumItems": [],
2660
- "mappedType": "text"
4617
+ "mappedType": "uuid"
2661
4618
  },
2662
- "appearance_color": {
2663
- "name": "appearance_color",
2664
- "type": "text",
4619
+ "organization_id": {
4620
+ "name": "organization_id",
4621
+ "type": "uuid",
2665
4622
  "unsigned": false,
2666
4623
  "autoincrement": false,
2667
4624
  "primary": false,
2668
- "nullable": true,
4625
+ "nullable": false,
2669
4626
  "unique": false,
2670
4627
  "length": null,
2671
4628
  "precision": null,
@@ -2673,15 +4630,15 @@
2673
4630
  "default": null,
2674
4631
  "comment": null,
2675
4632
  "enumItems": [],
2676
- "mappedType": "text"
4633
+ "mappedType": "uuid"
2677
4634
  },
2678
- "source": {
2679
- "name": "source",
2680
- "type": "text",
4635
+ "tenant_id": {
4636
+ "name": "tenant_id",
4637
+ "type": "uuid",
2681
4638
  "unsigned": false,
2682
4639
  "autoincrement": false,
2683
4640
  "primary": false,
2684
- "nullable": true,
4641
+ "nullable": false,
2685
4642
  "unique": false,
2686
4643
  "length": null,
2687
4644
  "precision": null,
@@ -2689,15 +4646,15 @@
2689
4646
  "default": null,
2690
4647
  "comment": null,
2691
4648
  "enumItems": [],
2692
- "mappedType": "text"
4649
+ "mappedType": "uuid"
2693
4650
  },
2694
- "deal_id": {
2695
- "name": "deal_id",
4651
+ "person_entity_id": {
4652
+ "name": "person_entity_id",
2696
4653
  "type": "uuid",
2697
4654
  "unsigned": false,
2698
4655
  "autoincrement": false,
2699
4656
  "primary": false,
2700
- "nullable": true,
4657
+ "nullable": false,
2701
4658
  "unique": false,
2702
4659
  "length": null,
2703
4660
  "precision": null,
@@ -2707,45 +4664,45 @@
2707
4664
  "enumItems": [],
2708
4665
  "mappedType": "uuid"
2709
4666
  },
2710
- "created_at": {
2711
- "name": "created_at",
2712
- "type": "timestamptz",
4667
+ "company_entity_id": {
4668
+ "name": "company_entity_id",
4669
+ "type": "uuid",
2713
4670
  "unsigned": false,
2714
4671
  "autoincrement": false,
2715
4672
  "primary": false,
2716
4673
  "nullable": false,
2717
4674
  "unique": false,
2718
- "length": 6,
4675
+ "length": null,
2719
4676
  "precision": null,
2720
4677
  "scale": null,
2721
4678
  "default": null,
2722
4679
  "comment": null,
2723
4680
  "enumItems": [],
2724
- "mappedType": "datetime"
4681
+ "mappedType": "uuid"
2725
4682
  },
2726
- "updated_at": {
2727
- "name": "updated_at",
2728
- "type": "timestamptz",
4683
+ "role_value": {
4684
+ "name": "role_value",
4685
+ "type": "text",
2729
4686
  "unsigned": false,
2730
4687
  "autoincrement": false,
2731
4688
  "primary": false,
2732
4689
  "nullable": false,
2733
4690
  "unique": false,
2734
- "length": 6,
4691
+ "length": null,
2735
4692
  "precision": null,
2736
4693
  "scale": null,
2737
4694
  "default": null,
2738
4695
  "comment": null,
2739
4696
  "enumItems": [],
2740
- "mappedType": "datetime"
4697
+ "mappedType": "text"
2741
4698
  },
2742
- "deleted_at": {
2743
- "name": "deleted_at",
4699
+ "created_at": {
4700
+ "name": "created_at",
2744
4701
  "type": "timestamptz",
2745
4702
  "unsigned": false,
2746
4703
  "autoincrement": false,
2747
4704
  "primary": false,
2748
- "nullable": true,
4705
+ "nullable": false,
2749
4706
  "unique": false,
2750
4707
  "length": 6,
2751
4708
  "precision": null,
@@ -2754,33 +4711,16 @@
2754
4711
  "comment": null,
2755
4712
  "enumItems": [],
2756
4713
  "mappedType": "datetime"
2757
- },
2758
- "entity_id": {
2759
- "name": "entity_id",
2760
- "type": "uuid",
2761
- "unsigned": false,
2762
- "autoincrement": false,
2763
- "primary": false,
2764
- "nullable": false,
2765
- "unique": false,
2766
- "length": null,
2767
- "precision": null,
2768
- "scale": null,
2769
- "default": null,
2770
- "comment": null,
2771
- "enumItems": [],
2772
- "mappedType": "uuid"
2773
4714
  }
2774
4715
  },
2775
- "name": "customer_interactions",
4716
+ "name": "customer_person_company_roles",
2776
4717
  "schema": "public",
2777
4718
  "indexes": [
2778
4719
  {
2779
- "keyName": "customer_interactions_type_idx",
4720
+ "keyName": "customer_pcr_person_company_idx",
2780
4721
  "columnNames": [
2781
- "tenant_id",
2782
- "organization_id",
2783
- "interaction_type"
4722
+ "person_entity_id",
4723
+ "company_entity_id"
2784
4724
  ],
2785
4725
  "composite": true,
2786
4726
  "constraint": false,
@@ -2788,12 +4728,10 @@
2788
4728
  "unique": false
2789
4729
  },
2790
4730
  {
2791
- "keyName": "customer_interactions_org_tenant_status_idx",
4731
+ "keyName": "customer_pcr_scope_idx",
2792
4732
  "columnNames": [
2793
4733
  "organization_id",
2794
- "tenant_id",
2795
- "status",
2796
- "scheduled_at"
4734
+ "tenant_id"
2797
4735
  ],
2798
4736
  "composite": true,
2799
4737
  "constraint": false,
@@ -2801,20 +4739,19 @@
2801
4739
  "unique": false
2802
4740
  },
2803
4741
  {
2804
- "keyName": "customer_interactions_entity_status_scheduled_idx",
4742
+ "keyName": "customer_pcr_unique",
2805
4743
  "columnNames": [
2806
- "entity_id",
2807
- "status",
2808
- "scheduled_at",
2809
- "created_at"
4744
+ "person_entity_id",
4745
+ "company_entity_id",
4746
+ "role_value"
2810
4747
  ],
2811
4748
  "composite": true,
2812
- "constraint": false,
4749
+ "constraint": true,
2813
4750
  "primary": false,
2814
- "unique": false
4751
+ "unique": true
2815
4752
  },
2816
4753
  {
2817
- "keyName": "customer_interactions_pkey",
4754
+ "keyName": "customer_person_company_roles_pkey",
2818
4755
  "columnNames": [
2819
4756
  "id"
2820
4757
  ],
@@ -2826,12 +4763,24 @@
2826
4763
  ],
2827
4764
  "checks": [],
2828
4765
  "foreignKeys": {
2829
- "customer_interactions_entity_id_foreign": {
2830
- "constraintName": "customer_interactions_entity_id_foreign",
4766
+ "customer_person_company_roles_person_entity_id_foreign": {
4767
+ "constraintName": "customer_person_company_roles_person_entity_id_foreign",
2831
4768
  "columnNames": [
2832
- "entity_id"
4769
+ "person_entity_id"
2833
4770
  ],
2834
- "localTableName": "public.customer_interactions",
4771
+ "localTableName": "public.customer_person_company_roles",
4772
+ "referencedColumnNames": [
4773
+ "id"
4774
+ ],
4775
+ "referencedTableName": "public.customer_entities",
4776
+ "updateRule": "cascade"
4777
+ },
4778
+ "customer_person_company_roles_company_entity_id_foreign": {
4779
+ "constraintName": "customer_person_company_roles_company_entity_id_foreign",
4780
+ "columnNames": [
4781
+ "company_entity_id"
4782
+ ],
4783
+ "localTableName": "public.customer_person_company_roles",
2835
4784
  "referencedColumnNames": [
2836
4785
  "id"
2837
4786
  ],