@open-mercato/core 0.4.5-develop-2e9903a57a → 0.4.5-develop-eeccf7adf4

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 (473) hide show
  1. package/package.json +2 -2
  2. package/dist/modules/auth/__integration__/TC-AUTH-001.spec.js +0 -9
  3. package/dist/modules/auth/__integration__/TC-AUTH-001.spec.js.map +0 -7
  4. package/dist/modules/auth/__integration__/TC-AUTH-002.spec.js +0 -22
  5. package/dist/modules/auth/__integration__/TC-AUTH-002.spec.js.map +0 -7
  6. package/dist/modules/auth/__integration__/TC-AUTH-003.spec.js +0 -21
  7. package/dist/modules/auth/__integration__/TC-AUTH-003.spec.js.map +0 -7
  8. package/dist/modules/auth/__integration__/TC-AUTH-004.spec.js +0 -15
  9. package/dist/modules/auth/__integration__/TC-AUTH-004.spec.js.map +0 -7
  10. package/dist/modules/auth/__integration__/TC-AUTH-005.spec.js +0 -11
  11. package/dist/modules/auth/__integration__/TC-AUTH-005.spec.js.map +0 -7
  12. package/dist/modules/auth/__integration__/TC-AUTH-006.spec.js +0 -11
  13. package/dist/modules/auth/__integration__/TC-AUTH-006.spec.js.map +0 -7
  14. package/dist/modules/auth/__integration__/TC-AUTH-007.spec.js +0 -14
  15. package/dist/modules/auth/__integration__/TC-AUTH-007.spec.js.map +0 -7
  16. package/dist/modules/auth/__integration__/TC-AUTH-008.spec.js +0 -26
  17. package/dist/modules/auth/__integration__/TC-AUTH-008.spec.js.map +0 -7
  18. package/dist/modules/auth/__integration__/TC-AUTH-009.spec.js +0 -16
  19. package/dist/modules/auth/__integration__/TC-AUTH-009.spec.js.map +0 -7
  20. package/dist/modules/auth/__integration__/TC-AUTH-010.spec.js +0 -32
  21. package/dist/modules/auth/__integration__/TC-AUTH-010.spec.js.map +0 -7
  22. package/dist/modules/auth/__integration__/TC-AUTH-011.spec.js +0 -26
  23. package/dist/modules/auth/__integration__/TC-AUTH-011.spec.js.map +0 -7
  24. package/dist/modules/auth/__integration__/TC-AUTH-012.spec.js +0 -30
  25. package/dist/modules/auth/__integration__/TC-AUTH-012.spec.js.map +0 -7
  26. package/dist/modules/auth/__integration__/TC-AUTH-013.spec.js +0 -41
  27. package/dist/modules/auth/__integration__/TC-AUTH-013.spec.js.map +0 -7
  28. package/dist/modules/auth/__integration__/TC-AUTH-014.spec.js +0 -25
  29. package/dist/modules/auth/__integration__/TC-AUTH-014.spec.js.map +0 -7
  30. package/dist/modules/auth/__integration__/TC-AUTH-015.spec.js +0 -20
  31. package/dist/modules/auth/__integration__/TC-AUTH-015.spec.js.map +0 -7
  32. package/dist/modules/auth/__integration__/TC-AUTH-016.spec.js +0 -76
  33. package/dist/modules/auth/__integration__/TC-AUTH-016.spec.js.map +0 -7
  34. package/dist/modules/catalog/__integration__/TC-CAT-001.spec.js +0 -20
  35. package/dist/modules/catalog/__integration__/TC-CAT-001.spec.js.map +0 -7
  36. package/dist/modules/catalog/__integration__/TC-CAT-002.spec.js +0 -12
  37. package/dist/modules/catalog/__integration__/TC-CAT-002.spec.js.map +0 -7
  38. package/dist/modules/catalog/__integration__/TC-CAT-003.spec.js +0 -28
  39. package/dist/modules/catalog/__integration__/TC-CAT-003.spec.js.map +0 -7
  40. package/dist/modules/catalog/__integration__/TC-CAT-004.spec.js +0 -33
  41. package/dist/modules/catalog/__integration__/TC-CAT-004.spec.js.map +0 -7
  42. package/dist/modules/catalog/__integration__/TC-CAT-005.spec.js +0 -30
  43. package/dist/modules/catalog/__integration__/TC-CAT-005.spec.js.map +0 -7
  44. package/dist/modules/catalog/__integration__/TC-CAT-006.spec.js +0 -31
  45. package/dist/modules/catalog/__integration__/TC-CAT-006.spec.js.map +0 -7
  46. package/dist/modules/catalog/__integration__/TC-CAT-007.spec.js +0 -31
  47. package/dist/modules/catalog/__integration__/TC-CAT-007.spec.js.map +0 -7
  48. package/dist/modules/catalog/__integration__/TC-CAT-008.spec.js +0 -65
  49. package/dist/modules/catalog/__integration__/TC-CAT-008.spec.js.map +0 -7
  50. package/dist/modules/catalog/__integration__/TC-CAT-009.spec.js +0 -31
  51. package/dist/modules/catalog/__integration__/TC-CAT-009.spec.js.map +0 -7
  52. package/dist/modules/catalog/__integration__/TC-CAT-010.spec.js +0 -28
  53. package/dist/modules/catalog/__integration__/TC-CAT-010.spec.js.map +0 -7
  54. package/dist/modules/catalog/__integration__/TC-CAT-011.spec.js +0 -34
  55. package/dist/modules/catalog/__integration__/TC-CAT-011.spec.js.map +0 -7
  56. package/dist/modules/catalog/__integration__/TC-CAT-012.spec.js +0 -27
  57. package/dist/modules/catalog/__integration__/TC-CAT-012.spec.js.map +0 -7
  58. package/dist/modules/core/__integration__/admin/TC-ADMIN-001.spec.js +0 -44
  59. package/dist/modules/core/__integration__/admin/TC-ADMIN-001.spec.js.map +0 -7
  60. package/dist/modules/core/__integration__/admin/TC-ADMIN-002.spec.js +0 -53
  61. package/dist/modules/core/__integration__/admin/TC-ADMIN-002.spec.js.map +0 -7
  62. package/dist/modules/core/__integration__/admin/TC-ADMIN-003.spec.js +0 -26
  63. package/dist/modules/core/__integration__/admin/TC-ADMIN-003.spec.js.map +0 -7
  64. package/dist/modules/core/__integration__/admin/TC-ADMIN-004.spec.js +0 -47
  65. package/dist/modules/core/__integration__/admin/TC-ADMIN-004.spec.js.map +0 -7
  66. package/dist/modules/core/__integration__/admin/TC-ADMIN-005.spec.js +0 -33
  67. package/dist/modules/core/__integration__/admin/TC-ADMIN-005.spec.js.map +0 -7
  68. package/dist/modules/core/__integration__/admin/TC-ADMIN-006.spec.js +0 -30
  69. package/dist/modules/core/__integration__/admin/TC-ADMIN-006.spec.js.map +0 -7
  70. package/dist/modules/core/__integration__/admin/TC-ADMIN-007.spec.js +0 -36
  71. package/dist/modules/core/__integration__/admin/TC-ADMIN-007.spec.js.map +0 -7
  72. package/dist/modules/core/__integration__/admin/TC-ADMIN-008.spec.js +0 -113
  73. package/dist/modules/core/__integration__/admin/TC-ADMIN-008.spec.js.map +0 -7
  74. package/dist/modules/core/__integration__/admin/TC-ADMIN-009.spec.js +0 -25
  75. package/dist/modules/core/__integration__/admin/TC-ADMIN-009.spec.js.map +0 -7
  76. package/dist/modules/core/__integration__/admin/TC-ADMIN-010.spec.js +0 -35
  77. package/dist/modules/core/__integration__/admin/TC-ADMIN-010.spec.js.map +0 -7
  78. package/dist/modules/core/__integration__/helpers/api.js +0 -64
  79. package/dist/modules/core/__integration__/helpers/api.js.map +0 -7
  80. package/dist/modules/core/__integration__/helpers/auth.js +0 -98
  81. package/dist/modules/core/__integration__/helpers/auth.js.map +0 -7
  82. package/dist/modules/core/__integration__/helpers/authUi.js +0 -31
  83. package/dist/modules/core/__integration__/helpers/authUi.js.map +0 -7
  84. package/dist/modules/core/__integration__/helpers/catalogFixtures.js +0 -49
  85. package/dist/modules/core/__integration__/helpers/catalogFixtures.js.map +0 -7
  86. package/dist/modules/core/__integration__/helpers/crmFixtures.js +0 -73
  87. package/dist/modules/core/__integration__/helpers/crmFixtures.js.map +0 -7
  88. package/dist/modules/core/__integration__/helpers/salesFixtures.js +0 -63
  89. package/dist/modules/core/__integration__/helpers/salesFixtures.js.map +0 -7
  90. package/dist/modules/core/__integration__/helpers/salesUi.js +0 -464
  91. package/dist/modules/core/__integration__/helpers/salesUi.js.map +0 -7
  92. package/dist/modules/core/__integration__/integration/TC-INT-001.spec.js +0 -26
  93. package/dist/modules/core/__integration__/integration/TC-INT-001.spec.js.map +0 -7
  94. package/dist/modules/core/__integration__/integration/TC-INT-002.spec.js +0 -60
  95. package/dist/modules/core/__integration__/integration/TC-INT-002.spec.js.map +0 -7
  96. package/dist/modules/core/__integration__/integration/TC-INT-003.spec.js +0 -36
  97. package/dist/modules/core/__integration__/integration/TC-INT-003.spec.js.map +0 -7
  98. package/dist/modules/core/__integration__/integration/TC-INT-004.spec.js +0 -74
  99. package/dist/modules/core/__integration__/integration/TC-INT-004.spec.js.map +0 -7
  100. package/dist/modules/core/__integration__/integration/TC-INT-005.spec.js +0 -21
  101. package/dist/modules/core/__integration__/integration/TC-INT-005.spec.js.map +0 -7
  102. package/dist/modules/customers/__integration__/TC-CRM-001.spec.js +0 -32
  103. package/dist/modules/customers/__integration__/TC-CRM-001.spec.js.map +0 -7
  104. package/dist/modules/customers/__integration__/TC-CRM-002.spec.js +0 -35
  105. package/dist/modules/customers/__integration__/TC-CRM-002.spec.js.map +0 -7
  106. package/dist/modules/customers/__integration__/TC-CRM-003.spec.js +0 -40
  107. package/dist/modules/customers/__integration__/TC-CRM-003.spec.js.map +0 -7
  108. package/dist/modules/customers/__integration__/TC-CRM-004.spec.js +0 -40
  109. package/dist/modules/customers/__integration__/TC-CRM-004.spec.js.map +0 -7
  110. package/dist/modules/customers/__integration__/TC-CRM-005.spec.js +0 -37
  111. package/dist/modules/customers/__integration__/TC-CRM-005.spec.js.map +0 -7
  112. package/dist/modules/customers/__integration__/TC-CRM-006.spec.js +0 -42
  113. package/dist/modules/customers/__integration__/TC-CRM-006.spec.js.map +0 -7
  114. package/dist/modules/customers/__integration__/TC-CRM-007.spec.js +0 -44
  115. package/dist/modules/customers/__integration__/TC-CRM-007.spec.js.map +0 -7
  116. package/dist/modules/customers/__integration__/TC-CRM-008.spec.js +0 -50
  117. package/dist/modules/customers/__integration__/TC-CRM-008.spec.js.map +0 -7
  118. package/dist/modules/customers/__integration__/TC-CRM-009.spec.js +0 -33
  119. package/dist/modules/customers/__integration__/TC-CRM-009.spec.js.map +0 -7
  120. package/dist/modules/customers/__integration__/TC-CRM-010.spec.js +0 -39
  121. package/dist/modules/customers/__integration__/TC-CRM-010.spec.js.map +0 -7
  122. package/dist/modules/customers/__integration__/TC-CRM-011.spec.js +0 -37
  123. package/dist/modules/customers/__integration__/TC-CRM-011.spec.js.map +0 -7
  124. package/dist/modules/customers/__integration__/TC-CRM-012.spec.js +0 -38
  125. package/dist/modules/customers/__integration__/TC-CRM-012.spec.js.map +0 -7
  126. package/dist/modules/customers/__integration__/TC-CRM-013.spec.js +0 -43
  127. package/dist/modules/customers/__integration__/TC-CRM-013.spec.js.map +0 -7
  128. package/dist/modules/customers/__integration__/TC-CRM-014.spec.js +0 -23
  129. package/dist/modules/customers/__integration__/TC-CRM-014.spec.js.map +0 -7
  130. package/dist/modules/customers/__integration__/TC-CRM-015.spec.js +0 -63
  131. package/dist/modules/customers/__integration__/TC-CRM-015.spec.js.map +0 -7
  132. package/dist/modules/customers/__integration__/TC-CRM-016.spec.js +0 -46
  133. package/dist/modules/customers/__integration__/TC-CRM-016.spec.js.map +0 -7
  134. package/dist/modules/customers/__integration__/TC-CRM-017.spec.js +0 -29
  135. package/dist/modules/customers/__integration__/TC-CRM-017.spec.js.map +0 -7
  136. package/dist/modules/customers/__integration__/TC-CRM-018.spec.js +0 -52
  137. package/dist/modules/customers/__integration__/TC-CRM-018.spec.js.map +0 -7
  138. package/dist/modules/customers/__integration__/TC-CRM-019.spec.js +0 -37
  139. package/dist/modules/customers/__integration__/TC-CRM-019.spec.js.map +0 -7
  140. package/dist/modules/customers/__integration__/TC-CRM-020.spec.js +0 -65
  141. package/dist/modules/customers/__integration__/TC-CRM-020.spec.js.map +0 -7
  142. package/dist/modules/progress/__integration__/TC-PROG-001.spec.js +0 -51
  143. package/dist/modules/progress/__integration__/TC-PROG-001.spec.js.map +0 -7
  144. package/dist/modules/resources/__integration__/TC-INT-007.spec.js +0 -88
  145. package/dist/modules/resources/__integration__/TC-INT-007.spec.js.map +0 -7
  146. package/dist/modules/resources/__integration__/helpers/resourcesFixtures.js +0 -45
  147. package/dist/modules/resources/__integration__/helpers/resourcesFixtures.js.map +0 -7
  148. package/dist/modules/sales/__integration__/TC-SALES-001.spec.js +0 -20
  149. package/dist/modules/sales/__integration__/TC-SALES-001.spec.js.map +0 -7
  150. package/dist/modules/sales/__integration__/TC-SALES-002.spec.js +0 -31
  151. package/dist/modules/sales/__integration__/TC-SALES-002.spec.js.map +0 -7
  152. package/dist/modules/sales/__integration__/TC-SALES-003.spec.js +0 -13
  153. package/dist/modules/sales/__integration__/TC-SALES-003.spec.js.map +0 -7
  154. package/dist/modules/sales/__integration__/TC-SALES-004.spec.js +0 -14
  155. package/dist/modules/sales/__integration__/TC-SALES-004.spec.js.map +0 -7
  156. package/dist/modules/sales/__integration__/TC-SALES-005.spec.js +0 -15
  157. package/dist/modules/sales/__integration__/TC-SALES-005.spec.js.map +0 -7
  158. package/dist/modules/sales/__integration__/TC-SALES-006.spec.js +0 -20
  159. package/dist/modules/sales/__integration__/TC-SALES-006.spec.js.map +0 -7
  160. package/dist/modules/sales/__integration__/TC-SALES-007.spec.js +0 -19
  161. package/dist/modules/sales/__integration__/TC-SALES-007.spec.js.map +0 -7
  162. package/dist/modules/sales/__integration__/TC-SALES-008.spec.js +0 -7
  163. package/dist/modules/sales/__integration__/TC-SALES-008.spec.js.map +0 -7
  164. package/dist/modules/sales/__integration__/TC-SALES-009.spec.js +0 -7
  165. package/dist/modules/sales/__integration__/TC-SALES-009.spec.js.map +0 -7
  166. package/dist/modules/sales/__integration__/TC-SALES-010.spec.js +0 -16
  167. package/dist/modules/sales/__integration__/TC-SALES-010.spec.js.map +0 -7
  168. package/dist/modules/sales/__integration__/TC-SALES-011.spec.js +0 -20
  169. package/dist/modules/sales/__integration__/TC-SALES-011.spec.js.map +0 -7
  170. package/dist/modules/sales/__integration__/TC-SALES-012.spec.js +0 -7
  171. package/dist/modules/sales/__integration__/TC-SALES-012.spec.js.map +0 -7
  172. package/dist/modules/sales/__integration__/TC-SALES-013.spec.js +0 -66
  173. package/dist/modules/sales/__integration__/TC-SALES-013.spec.js.map +0 -7
  174. package/dist/modules/sales/__integration__/TC-SALES-014.spec.js +0 -13
  175. package/dist/modules/sales/__integration__/TC-SALES-014.spec.js.map +0 -7
  176. package/dist/modules/sales/__integration__/TC-SALES-015.spec.js +0 -13
  177. package/dist/modules/sales/__integration__/TC-SALES-015.spec.js.map +0 -7
  178. package/dist/modules/sales/__integration__/TC-SALES-016.spec.js +0 -13
  179. package/dist/modules/sales/__integration__/TC-SALES-016.spec.js.map +0 -7
  180. package/dist/modules/sales/__integration__/TC-SALES-017.spec.js +0 -44
  181. package/dist/modules/sales/__integration__/TC-SALES-017.spec.js.map +0 -7
  182. package/dist/modules/sales/__integration__/TC-SALES-018.spec.js +0 -18
  183. package/dist/modules/sales/__integration__/TC-SALES-018.spec.js.map +0 -7
  184. package/dist/modules/sales/__integration__/TC-SALES-019.spec.js +0 -16
  185. package/dist/modules/sales/__integration__/TC-SALES-019.spec.js.map +0 -7
  186. package/dist/modules/sales/__integration__/TC-SALES-020.spec.js +0 -75
  187. package/dist/modules/sales/__integration__/TC-SALES-020.spec.js.map +0 -7
  188. package/dist/modules/staff/__integration__/TC-INT-006.spec.js +0 -64
  189. package/dist/modules/staff/__integration__/TC-INT-006.spec.js.map +0 -7
  190. package/dist/modules/translations/__integration__/TC-TRANS-001.spec.js +0 -48
  191. package/dist/modules/translations/__integration__/TC-TRANS-001.spec.js.map +0 -7
  192. package/dist/modules/translations/__integration__/TC-TRANS-002.spec.js +0 -94
  193. package/dist/modules/translations/__integration__/TC-TRANS-002.spec.js.map +0 -7
  194. package/dist/modules/translations/__integration__/TC-TRANS-003.spec.js +0 -61
  195. package/dist/modules/translations/__integration__/TC-TRANS-003.spec.js.map +0 -7
  196. package/dist/modules/translations/__integration__/TC-TRANS-004.spec.js +0 -52
  197. package/dist/modules/translations/__integration__/TC-TRANS-004.spec.js.map +0 -7
  198. package/dist/modules/translations/__integration__/TC-TRANS-005.spec.js +0 -106
  199. package/dist/modules/translations/__integration__/TC-TRANS-005.spec.js.map +0 -7
  200. package/dist/modules/translations/__integration__/TC-TRANS-006.spec.js +0 -94
  201. package/dist/modules/translations/__integration__/TC-TRANS-006.spec.js.map +0 -7
  202. package/dist/modules/translations/__integration__/TC-TRANS-007.spec.js +0 -62
  203. package/dist/modules/translations/__integration__/TC-TRANS-007.spec.js.map +0 -7
  204. package/dist/modules/translations/__integration__/TC-TRANS-008.spec.js +0 -168
  205. package/dist/modules/translations/__integration__/TC-TRANS-008.spec.js.map +0 -7
  206. package/dist/modules/translations/__integration__/helpers/translationFixtures.js +0 -63
  207. package/dist/modules/translations/__integration__/helpers/translationFixtures.js.map +0 -7
  208. package/dist/modules/workflows/__integration__/TC-WF-001.spec.js +0 -73
  209. package/dist/modules/workflows/__integration__/TC-WF-001.spec.js.map +0 -7
  210. package/src/__tests__/module-decoupling.test.ts +0 -356
  211. package/src/modules/api_keys/api/__tests__/keys.route.test.ts +0 -244
  212. package/src/modules/attachments/api/__tests__/attachments.api.test.ts +0 -240
  213. package/src/modules/attachments/components/__tests__/AttachmentContentPreview.test.tsx +0 -45
  214. package/src/modules/attachments/data/__tests__/entities-ocr.test.ts +0 -15
  215. package/src/modules/attachments/lib/__tests__/ocr-config.test.ts +0 -27
  216. package/src/modules/attachments/lib/__tests__/textExtraction.test.ts +0 -64
  217. package/src/modules/audit_logs/api/__tests__/access.route.test.ts +0 -118
  218. package/src/modules/audit_logs/api/__tests__/redo.route.test.ts +0 -131
  219. package/src/modules/audit_logs/api/__tests__/undo.route.test.ts +0 -103
  220. package/src/modules/audit_logs/services/__tests__/actionLogService.test.ts +0 -26
  221. package/src/modules/auth/__integration__/TC-AUTH-001.spec.ts +0 -13
  222. package/src/modules/auth/__integration__/TC-AUTH-002.spec.ts +0 -30
  223. package/src/modules/auth/__integration__/TC-AUTH-003.spec.ts +0 -28
  224. package/src/modules/auth/__integration__/TC-AUTH-004.spec.ts +0 -21
  225. package/src/modules/auth/__integration__/TC-AUTH-005.spec.ts +0 -17
  226. package/src/modules/auth/__integration__/TC-AUTH-006.spec.ts +0 -17
  227. package/src/modules/auth/__integration__/TC-AUTH-007.spec.ts +0 -19
  228. package/src/modules/auth/__integration__/TC-AUTH-008.spec.ts +0 -31
  229. package/src/modules/auth/__integration__/TC-AUTH-009.spec.ts +0 -22
  230. package/src/modules/auth/__integration__/TC-AUTH-010.spec.ts +0 -39
  231. package/src/modules/auth/__integration__/TC-AUTH-011.spec.ts +0 -35
  232. package/src/modules/auth/__integration__/TC-AUTH-012.spec.ts +0 -36
  233. package/src/modules/auth/__integration__/TC-AUTH-013.spec.ts +0 -48
  234. package/src/modules/auth/__integration__/TC-AUTH-014.spec.ts +0 -31
  235. package/src/modules/auth/__integration__/TC-AUTH-015.spec.ts +0 -28
  236. package/src/modules/auth/__integration__/TC-AUTH-016.spec.ts +0 -109
  237. package/src/modules/auth/__tests__/cli-rotate-encryption.test.ts +0 -97
  238. package/src/modules/auth/__tests__/cli-setup-acl.test.ts +0 -148
  239. package/src/modules/auth/api/__tests__/feature-check.test.ts +0 -65
  240. package/src/modules/auth/api/__tests__/login.test.ts +0 -47
  241. package/src/modules/auth/commands/__tests__/roles.custom-fields.test.ts +0 -126
  242. package/src/modules/auth/commands/__tests__/users.custom-fields.test.ts +0 -147
  243. package/src/modules/auth/lib/__tests__/rateLimitCheck.test.ts +0 -224
  244. package/src/modules/auth/services/__tests__/authService.test.ts +0 -32
  245. package/src/modules/auth/services/__tests__/rbacService.test.ts +0 -814
  246. package/src/modules/business_rules/api/__tests__/execute.route.test.ts +0 -311
  247. package/src/modules/business_rules/api/__tests__/logs-detail.route.test.ts +0 -181
  248. package/src/modules/business_rules/api/__tests__/logs.route.test.ts +0 -261
  249. package/src/modules/business_rules/api/__tests__/rules-detail.route.test.ts +0 -115
  250. package/src/modules/business_rules/api/__tests__/rules.route.test.ts +0 -746
  251. package/src/modules/business_rules/api/__tests__/sets-detail.route.test.ts +0 -169
  252. package/src/modules/business_rules/api/__tests__/sets-members.route.test.ts +0 -367
  253. package/src/modules/business_rules/api/__tests__/sets.route.test.ts +0 -361
  254. package/src/modules/business_rules/api/__tests__/test-helpers.ts +0 -42
  255. package/src/modules/business_rules/components/utils/__tests__/formHelpers.test.ts +0 -69
  256. package/src/modules/business_rules/data/__tests__/validators.test.ts +0 -637
  257. package/src/modules/business_rules/lib/__tests__/action-executor.test.ts +0 -728
  258. package/src/modules/business_rules/lib/__tests__/expression-evaluator.test.ts +0 -592
  259. package/src/modules/business_rules/lib/__tests__/rule-engine.test.ts +0 -805
  260. package/src/modules/business_rules/lib/__tests__/rule-evaluator.test.ts +0 -436
  261. package/src/modules/catalog/__integration__/TC-CAT-001.spec.ts +0 -32
  262. package/src/modules/catalog/__integration__/TC-CAT-002.spec.ts +0 -19
  263. package/src/modules/catalog/__integration__/TC-CAT-003.spec.ts +0 -39
  264. package/src/modules/catalog/__integration__/TC-CAT-004.spec.ts +0 -41
  265. package/src/modules/catalog/__integration__/TC-CAT-005.spec.ts +0 -37
  266. package/src/modules/catalog/__integration__/TC-CAT-006.spec.ts +0 -40
  267. package/src/modules/catalog/__integration__/TC-CAT-007.spec.ts +0 -37
  268. package/src/modules/catalog/__integration__/TC-CAT-008.spec.ts +0 -76
  269. package/src/modules/catalog/__integration__/TC-CAT-009.spec.ts +0 -39
  270. package/src/modules/catalog/__integration__/TC-CAT-010.spec.ts +0 -36
  271. package/src/modules/catalog/__integration__/TC-CAT-011.spec.ts +0 -44
  272. package/src/modules/catalog/__integration__/TC-CAT-012.spec.ts +0 -35
  273. package/src/modules/catalog/api/__tests__/offers.route.test.ts +0 -161
  274. package/src/modules/catalog/api/__tests__/prices.route.test.ts +0 -39
  275. package/src/modules/catalog/api/__tests__/products.route.test.ts +0 -91
  276. package/src/modules/catalog/api/__tests__/utils.test.ts +0 -36
  277. package/src/modules/catalog/api/__tests__/variants.route.test.ts +0 -44
  278. package/src/modules/catalog/backend/catalog/products/__tests__/ProductsDataTable.test.tsx +0 -172
  279. package/src/modules/catalog/commands/__tests__/products.delete.test.ts +0 -146
  280. package/src/modules/catalog/commands/__tests__/products.update.test.ts +0 -142
  281. package/src/modules/catalog/commands/__tests__/registration.test.ts +0 -54
  282. package/src/modules/catalog/commands/__tests__/shared.test.ts +0 -129
  283. package/src/modules/catalog/components/__tests__/catalogComponentsRender.test.tsx +0 -373
  284. package/src/modules/catalog/components/products/__tests__/ProductImageCell.test.tsx +0 -51
  285. package/src/modules/catalog/components/products/__tests__/productForm.test.ts +0 -32
  286. package/src/modules/catalog/lib/__tests__/pricing.test.ts +0 -150
  287. package/src/modules/catalog/services/__tests__/catalogPricingService.test.ts +0 -21
  288. package/src/modules/configs/components/__tests__/CachePanel.test.tsx +0 -134
  289. package/src/modules/configs/components/__tests__/SystemStatusPanel.test.tsx +0 -93
  290. package/src/modules/configs/lib/__tests__/system-status.test.ts +0 -55
  291. package/src/modules/configs/lib/__tests__/upgrade-actions.test.ts +0 -135
  292. package/src/modules/core/__integration__/admin/TC-ADMIN-001.spec.ts +0 -70
  293. package/src/modules/core/__integration__/admin/TC-ADMIN-002.spec.ts +0 -83
  294. package/src/modules/core/__integration__/admin/TC-ADMIN-003.spec.ts +0 -50
  295. package/src/modules/core/__integration__/admin/TC-ADMIN-004.spec.ts +0 -77
  296. package/src/modules/core/__integration__/admin/TC-ADMIN-005.spec.ts +0 -49
  297. package/src/modules/core/__integration__/admin/TC-ADMIN-006.spec.ts +0 -59
  298. package/src/modules/core/__integration__/admin/TC-ADMIN-007.spec.ts +0 -68
  299. package/src/modules/core/__integration__/admin/TC-ADMIN-008.spec.ts +0 -127
  300. package/src/modules/core/__integration__/admin/TC-ADMIN-009.spec.ts +0 -48
  301. package/src/modules/core/__integration__/admin/TC-ADMIN-010.spec.ts +0 -57
  302. package/src/modules/core/__integration__/helpers/api.ts +0 -84
  303. package/src/modules/core/__integration__/helpers/auth.ts +0 -110
  304. package/src/modules/core/__integration__/helpers/authUi.ts +0 -33
  305. package/src/modules/core/__integration__/helpers/catalogFixtures.ts +0 -73
  306. package/src/modules/core/__integration__/helpers/crmFixtures.ts +0 -101
  307. package/src/modules/core/__integration__/helpers/salesFixtures.ts +0 -89
  308. package/src/modules/core/__integration__/helpers/salesUi.ts +0 -528
  309. package/src/modules/core/__integration__/integration/TC-INT-001.spec.ts +0 -34
  310. package/src/modules/core/__integration__/integration/TC-INT-002.spec.ts +0 -74
  311. package/src/modules/core/__integration__/integration/TC-INT-003.spec.ts +0 -43
  312. package/src/modules/core/__integration__/integration/TC-INT-004.spec.ts +0 -82
  313. package/src/modules/core/__integration__/integration/TC-INT-005.spec.ts +0 -29
  314. package/src/modules/currencies/backend/exchange-rates/__tests__/formatDateTimeLocal.test.ts +0 -78
  315. package/src/modules/currencies/data/__tests__/validators.test.ts +0 -100
  316. package/src/modules/currencies/services/__tests__/exchangeRateService.test.ts +0 -666
  317. package/src/modules/currencies/services/__tests__/rateFetchingService.basic.test.ts +0 -398
  318. package/src/modules/currencies/services/__tests__/rateFetchingService.errors.test.ts +0 -296
  319. package/src/modules/currencies/services/__tests__/rateFetchingService.providers.test.ts +0 -350
  320. package/src/modules/currencies/services/__tests__/rateFetchingService.setup.ts +0 -188
  321. package/src/modules/customers/__integration__/TC-CRM-001.spec.ts +0 -42
  322. package/src/modules/customers/__integration__/TC-CRM-002.spec.ts +0 -47
  323. package/src/modules/customers/__integration__/TC-CRM-003.spec.ts +0 -55
  324. package/src/modules/customers/__integration__/TC-CRM-004.spec.ts +0 -57
  325. package/src/modules/customers/__integration__/TC-CRM-005.spec.ts +0 -50
  326. package/src/modules/customers/__integration__/TC-CRM-006.spec.ts +0 -60
  327. package/src/modules/customers/__integration__/TC-CRM-007.spec.ts +0 -57
  328. package/src/modules/customers/__integration__/TC-CRM-008.spec.ts +0 -62
  329. package/src/modules/customers/__integration__/TC-CRM-009.spec.ts +0 -46
  330. package/src/modules/customers/__integration__/TC-CRM-010.spec.ts +0 -49
  331. package/src/modules/customers/__integration__/TC-CRM-011.spec.ts +0 -47
  332. package/src/modules/customers/__integration__/TC-CRM-012.spec.ts +0 -49
  333. package/src/modules/customers/__integration__/TC-CRM-013.spec.ts +0 -61
  334. package/src/modules/customers/__integration__/TC-CRM-014.spec.ts +0 -31
  335. package/src/modules/customers/__integration__/TC-CRM-015.spec.ts +0 -89
  336. package/src/modules/customers/__integration__/TC-CRM-016.spec.ts +0 -55
  337. package/src/modules/customers/__integration__/TC-CRM-017.spec.ts +0 -37
  338. package/src/modules/customers/__integration__/TC-CRM-018.spec.ts +0 -62
  339. package/src/modules/customers/__integration__/TC-CRM-019.spec.ts +0 -44
  340. package/src/modules/customers/__integration__/TC-CRM-020.spec.ts +0 -73
  341. package/src/modules/customers/api/__tests__/utils.test.ts +0 -61
  342. package/src/modules/customers/api/dashboard/widgets/new-deals/__tests__/route.test.ts +0 -54
  343. package/src/modules/customers/commands/__tests__/shared.test.ts +0 -263
  344. package/src/modules/customers/commands/__tests__/undo.custom-fields.test.ts +0 -1184
  345. package/src/modules/customers/components/detail/__tests__/ActivityForm.validation.test.ts +0 -37
  346. package/src/modules/customers/components/detail/__tests__/DealForm.validation.test.ts +0 -45
  347. package/src/modules/customers/components/detail/__tests__/InlineEditors.test.tsx +0 -166
  348. package/src/modules/customers/components/detail/__tests__/TaskForm.submit.test.ts +0 -21
  349. package/src/modules/customers/components/detail/hooks/__tests__/useCustomerDictionary.test.ts +0 -97
  350. package/src/modules/customers/lib/__tests__/customFieldRouting.test.ts +0 -107
  351. package/src/modules/customers/utils/__tests__/addressFormat.test.ts +0 -105
  352. package/src/modules/customers/utils/__tests__/phoneDuplicates.test.ts +0 -98
  353. package/src/modules/dashboards/__tests__/widgets.test.ts +0 -70
  354. package/src/modules/dashboards/lib/__tests__/aggregations.test.ts +0 -328
  355. package/src/modules/dashboards/lib/__tests__/formatters.test.ts +0 -128
  356. package/src/modules/directory/backend/directory/organizations/__tests__/create-submit.test.ts +0 -46
  357. package/src/modules/directory/backend/directory/organizations/__tests__/edit-submit.test.ts +0 -49
  358. package/src/modules/directory/components/__tests__/OrganizationSelect.test.tsx +0 -71
  359. package/src/modules/directory/components/__tests__/TenantSelect.test.tsx +0 -75
  360. package/src/modules/entities/__tests__/cli-decrypt-database.test.ts +0 -534
  361. package/src/modules/entities/__tests__/cli-rotate-encryption.test.ts +0 -123
  362. package/src/modules/entities/api/__tests__/encryption.api.test.ts +0 -57
  363. package/src/modules/entities/api/__tests__/records.get.custom-entity.test.ts +0 -43
  364. package/src/modules/entities/api/__tests__/records.validation.test.ts +0 -53
  365. package/src/modules/entities/backend/entities/user/__tests__/create-entity-submit.test.ts +0 -47
  366. package/src/modules/entities/backend/entities/user/__tests__/records-submit.test.ts +0 -104
  367. package/src/modules/feature_toggles/commands/__tests__/global.test.ts +0 -325
  368. package/src/modules/feature_toggles/commands/__tests__/overrides.test.ts +0 -186
  369. package/src/modules/feature_toggles/lib/__tests__/feature-flag-check.test.ts +0 -365
  370. package/src/modules/feature_toggles/lib/__tests__/queries.test.ts +0 -130
  371. package/src/modules/inbox_ops/api/emails/[id]/reprocess/__tests__/route.test.ts +0 -194
  372. package/src/modules/inbox_ops/api/proposals/[id]/__tests__/route.test.ts +0 -124
  373. package/src/modules/inbox_ops/api/proposals/[id]/accept-all/__tests__/route.test.ts +0 -154
  374. package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/__tests__/route.test.ts +0 -200
  375. package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/accept/__tests__/route.test.ts +0 -261
  376. package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/reject/__tests__/route.test.ts +0 -201
  377. package/src/modules/inbox_ops/api/proposals/[id]/reject/__tests__/route.test.ts +0 -123
  378. package/src/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/__tests__/route.test.ts +0 -232
  379. package/src/modules/inbox_ops/api/proposals/[id]/translate/__tests__/route.test.ts +0 -173
  380. package/src/modules/inbox_ops/api/proposals/__tests__/route.test.ts +0 -185
  381. package/src/modules/inbox_ops/api/webhook/__tests__/inbound.test.ts +0 -317
  382. package/src/modules/inbox_ops/data/__tests__/validators.test.ts +0 -463
  383. package/src/modules/inbox_ops/lib/__tests__/catalogLookup.test.ts +0 -143
  384. package/src/modules/inbox_ops/lib/__tests__/contactMatcher.test.ts +0 -158
  385. package/src/modules/inbox_ops/lib/__tests__/emailParser.test.ts +0 -191
  386. package/src/modules/inbox_ops/lib/__tests__/executionEngine.test.ts +0 -1419
  387. package/src/modules/inbox_ops/lib/__tests__/extractionPrompt.test.ts +0 -151
  388. package/src/modules/inbox_ops/lib/__tests__/priceValidator.test.ts +0 -259
  389. package/src/modules/inbox_ops/lib/__tests__/translationProvider.test.ts +0 -99
  390. package/src/modules/inbox_ops/subscribers/__tests__/extractionWorker.test.ts +0 -803
  391. package/src/modules/notifications/__tests__/deliver-notification.test.ts +0 -285
  392. package/src/modules/notifications/__tests__/deliveryStrategies.test.ts +0 -19
  393. package/src/modules/notifications/__tests__/notificationService.test.ts +0 -248
  394. package/src/modules/planner/__tests__/availabilityMerge.test.ts +0 -99
  395. package/src/modules/planner/__tests__/plannerAvailabilityService.test.ts +0 -89
  396. package/src/modules/planner/data/__tests__/validators.test.ts +0 -78
  397. package/src/modules/progress/__integration__/TC-PROG-001.spec.ts +0 -67
  398. package/src/modules/progress/__tests__/progressService.test.ts +0 -377
  399. package/src/modules/query_index/__tests__/hybrid-engine.test.ts +0 -365
  400. package/src/modules/query_index/__tests__/indexer.test.ts +0 -175
  401. package/src/modules/resources/__integration__/TC-INT-007.spec.ts +0 -110
  402. package/src/modules/resources/__integration__/helpers/resourcesFixtures.ts +0 -50
  403. package/src/modules/resources/data/__tests__/validators.test.ts +0 -65
  404. package/src/modules/sales/__integration__/TC-SALES-001.spec.ts +0 -26
  405. package/src/modules/sales/__integration__/TC-SALES-002.spec.ts +0 -38
  406. package/src/modules/sales/__integration__/TC-SALES-003.spec.ts +0 -18
  407. package/src/modules/sales/__integration__/TC-SALES-004.spec.ts +0 -19
  408. package/src/modules/sales/__integration__/TC-SALES-005.spec.ts +0 -21
  409. package/src/modules/sales/__integration__/TC-SALES-006.spec.ts +0 -26
  410. package/src/modules/sales/__integration__/TC-SALES-007.spec.ts +0 -23
  411. package/src/modules/sales/__integration__/TC-SALES-008.spec.ts +0 -11
  412. package/src/modules/sales/__integration__/TC-SALES-009.spec.ts +0 -12
  413. package/src/modules/sales/__integration__/TC-SALES-010.spec.ts +0 -20
  414. package/src/modules/sales/__integration__/TC-SALES-011.spec.ts +0 -26
  415. package/src/modules/sales/__integration__/TC-SALES-012.spec.ts +0 -12
  416. package/src/modules/sales/__integration__/TC-SALES-013.spec.ts +0 -73
  417. package/src/modules/sales/__integration__/TC-SALES-014.spec.ts +0 -17
  418. package/src/modules/sales/__integration__/TC-SALES-015.spec.ts +0 -17
  419. package/src/modules/sales/__integration__/TC-SALES-016.spec.ts +0 -17
  420. package/src/modules/sales/__integration__/TC-SALES-017.spec.ts +0 -60
  421. package/src/modules/sales/__integration__/TC-SALES-018.spec.ts +0 -25
  422. package/src/modules/sales/__integration__/TC-SALES-019.spec.ts +0 -22
  423. package/src/modules/sales/__integration__/TC-SALES-020.spec.ts +0 -107
  424. package/src/modules/sales/api/__tests__/channels.route.test.ts +0 -50
  425. package/src/modules/sales/api/__tests__/document-history.test.ts +0 -146
  426. package/src/modules/sales/api/__tests__/documents.factory.test.ts +0 -98
  427. package/src/modules/sales/api/__tests__/documents.routes.test.ts +0 -149
  428. package/src/modules/sales/api/__tests__/quotes.acceptance.test.ts +0 -209
  429. package/src/modules/sales/api/__tests__/timeline.test.tsx +0 -165
  430. package/src/modules/sales/api/dashboard/widgets/new-orders/__tests__/route.test.ts +0 -112
  431. package/src/modules/sales/api/dashboard/widgets/new-quotes/__tests__/route.test.ts +0 -116
  432. package/src/modules/sales/commands/__tests__/documents.cache.test.ts +0 -126
  433. package/src/modules/sales/commands/__tests__/documents.undo.test.ts +0 -170
  434. package/src/modules/sales/commands/__tests__/registration.test.ts +0 -141
  435. package/src/modules/sales/components/__tests__/salesComponentsRender.test.tsx +0 -456
  436. package/src/modules/sales/lib/__tests__/calculations.test.ts +0 -210
  437. package/src/modules/sales/services/__tests__/salesCalculationService.test.ts +0 -181
  438. package/src/modules/sales/services/__tests__/taxCalculationService.test.ts +0 -79
  439. package/src/modules/sales/widgets/dashboard/new-orders/__tests__/config.test.ts +0 -47
  440. package/src/modules/sales/widgets/dashboard/new-quotes/__tests__/config.test.ts +0 -47
  441. package/src/modules/staff/__integration__/TC-INT-006.spec.ts +0 -71
  442. package/src/modules/staff/data/__tests__/validators.test.ts +0 -60
  443. package/src/modules/translations/__integration__/TC-TRANS-001.spec.ts +0 -57
  444. package/src/modules/translations/__integration__/TC-TRANS-002.spec.ts +0 -114
  445. package/src/modules/translations/__integration__/TC-TRANS-003.spec.ts +0 -71
  446. package/src/modules/translations/__integration__/TC-TRANS-004.spec.ts +0 -66
  447. package/src/modules/translations/__integration__/TC-TRANS-005.spec.ts +0 -135
  448. package/src/modules/translations/__integration__/TC-TRANS-006.spec.ts +0 -113
  449. package/src/modules/translations/__integration__/TC-TRANS-007.spec.ts +0 -80
  450. package/src/modules/translations/__integration__/TC-TRANS-008.spec.ts +0 -209
  451. package/src/modules/translations/__integration__/helpers/translationFixtures.ts +0 -95
  452. package/src/modules/translations/api/__tests__/locales.test.ts +0 -67
  453. package/src/modules/translations/data/__tests__/validators.test.ts +0 -143
  454. package/src/modules/translations/lib/__tests__/extract-record-id.test.ts +0 -75
  455. package/src/modules/translations/lib/__tests__/helpers.test.ts +0 -215
  456. package/src/modules/translations/lib/__tests__/locale.test.ts +0 -115
  457. package/src/modules/translations/lib/__tests__/resolve-field-list.test.ts +0 -176
  458. package/src/modules/translations/lib/__tests__/translatable-fields.test.ts +0 -79
  459. package/src/modules/translations/widgets/__tests__/injection-table.test.ts +0 -83
  460. package/src/modules/workflows/__integration__/TC-WF-001.spec.ts +0 -114
  461. package/src/modules/workflows/api/__tests__/definitions.route.test.ts +0 -762
  462. package/src/modules/workflows/api/__tests__/instances.route.test.ts +0 -869
  463. package/src/modules/workflows/data/__tests__/validators.test.ts +0 -707
  464. package/src/modules/workflows/lib/__tests__/activity-executor.test.ts +0 -1230
  465. package/src/modules/workflows/lib/__tests__/call-api.test.ts +0 -421
  466. package/src/modules/workflows/lib/__tests__/compensation.test.ts +0 -713
  467. package/src/modules/workflows/lib/__tests__/event-logger.test.ts +0 -615
  468. package/src/modules/workflows/lib/__tests__/integration.test.ts +0 -693
  469. package/src/modules/workflows/lib/__tests__/signals.test.ts +0 -566
  470. package/src/modules/workflows/lib/__tests__/step-handler.test.ts +0 -670
  471. package/src/modules/workflows/lib/__tests__/sub-workflow.test.ts +0 -934
  472. package/src/modules/workflows/lib/__tests__/transition-handler.test.ts +0 -925
  473. package/src/modules/workflows/lib/__tests__/workflow-executor.test.ts +0 -684
@@ -1,37 +0,0 @@
1
- jest.mock('@open-mercato/ui/backend/CrudForm', () => ({
2
- CrudForm: () => null,
3
- }))
4
-
5
- import { z } from 'zod'
6
- import { buildActivityValidationError } from '../ActivityForm'
7
-
8
- describe('buildActivityValidationError', () => {
9
- const t = (key: string, fallback?: string) => fallback ?? key
10
-
11
- it('throws CrudFormError with field mapping when available', () => {
12
- const issue: z.ZodIssue = {
13
- code: z.ZodIssueCode.custom,
14
- message: 'Activity type is required',
15
- path: ['activityType'],
16
- }
17
- const thrower = () => buildActivityValidationError([issue], t)
18
- expect(thrower).toThrow('Activity type is required')
19
- try {
20
- thrower()
21
- } catch (error) {
22
- expect(error).toMatchObject({
23
- message: 'Activity type is required',
24
- fieldErrors: { activityType: 'Activity type is required' },
25
- })
26
- }
27
- })
28
-
29
- it('uses fallback message when missing', () => {
30
- const issue: z.ZodIssue = {
31
- code: z.ZodIssueCode.custom,
32
- message: undefined as unknown as string,
33
- path: [],
34
- }
35
- expect(() => buildActivityValidationError([issue], t)).toThrow('customers.people.detail.activities.error')
36
- })
37
- })
@@ -1,45 +0,0 @@
1
- jest.mock('@open-mercato/ui/backend/CrudForm', () => ({
2
- CrudForm: () => null,
3
- }))
4
- jest.mock('react-markdown', () => ({
5
- __esModule: true,
6
- default: () => null,
7
- }))
8
- jest.mock('remark-gfm', () => ({
9
- __esModule: true,
10
- default: () => undefined,
11
- }))
12
-
13
- import { z } from 'zod'
14
- import { buildDealValidationError } from '../DealForm'
15
-
16
- describe('buildDealValidationError', () => {
17
- const t = (key: string, fallback?: string) => fallback ?? key
18
-
19
- it('throws CrudFormError with message and field when available', () => {
20
- const issue: z.ZodIssue = {
21
- code: z.ZodIssueCode.custom,
22
- message: 'Title is required',
23
- path: ['title'],
24
- }
25
- const thrower = () => buildDealValidationError([issue], t)
26
- expect(thrower).toThrow('Title is required')
27
- try {
28
- thrower()
29
- } catch (error) {
30
- expect(error).toMatchObject({
31
- message: 'Title is required',
32
- fieldErrors: { title: 'Title is required' },
33
- })
34
- }
35
- })
36
-
37
- it('throws with fallback message when issue is missing', () => {
38
- const issue: z.ZodIssue = {
39
- code: z.ZodIssueCode.custom,
40
- message: undefined as unknown as string,
41
- path: [],
42
- }
43
- expect(() => buildDealValidationError([issue], t)).toThrow('Failed to save deal.')
44
- })
45
- })
@@ -1,166 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- import * as React from 'react'
5
- import { fireEvent, render, screen } from '@testing-library/react'
6
- import { InlineMultilineEditor, InlineTextEditor, renderMultilineMarkdownDisplay } from '../InlineEditors'
7
-
8
- // jsdom does not provide requestAnimationFrame by default.
9
- ;(global as any).requestAnimationFrame =
10
- (global as any).requestAnimationFrame || ((cb: FrameRequestCallback) => setTimeout(cb, 0))
11
-
12
- const reactMarkdownMock = jest.fn((props: any) => <div data-testid="react-markdown">{props.children}</div>)
13
-
14
- jest.mock('react-markdown', () => ({
15
- __esModule: true,
16
- default: (props: any) => reactMarkdownMock(props),
17
- }))
18
-
19
- jest.mock('remark-gfm', () => ({
20
- __esModule: true,
21
- default: () => null,
22
- }))
23
-
24
- jest.mock('next/dynamic', () => () => {
25
- return function MockDynamicComponent(props: any) {
26
- return <div data-testid="dynamic-import" {...props} />
27
- }
28
- })
29
-
30
- jest.mock('@uiw/react-md-editor', () => (props: any) => {
31
- return <textarea data-testid="markdown-editor" value={props.value ?? ''} onChange={(event) => props.onChange?.(event.target.value)} />
32
- })
33
-
34
- jest.mock('@open-mercato/ui/primitives/button', () => ({
35
- Button: ({ children, ...props }: any) => (
36
- <button type={props.type || 'button'} {...props}>
37
- {children}
38
- </button>
39
- ),
40
- }))
41
-
42
- jest.mock('@open-mercato/ui/backend/detail', () => ({
43
- LoadingMessage: ({ label }: { label?: string }) => <div>{label ?? 'loading'}</div>,
44
- }))
45
-
46
- jest.mock('@open-mercato/ui/backend/FlashMessages', () => ({
47
- flash: jest.fn(),
48
- }))
49
-
50
- jest.mock('@open-mercato/ui/backend/inputs/PhoneNumberField', () => ({
51
- PhoneNumberField: ({ value, onValueChange, placeholder }: any) => (
52
- <input
53
- data-testid="phone-input"
54
- value={value ?? ''}
55
- onChange={(event) => onValueChange?.(event.target.value)}
56
- placeholder={placeholder}
57
- />
58
- ),
59
- }))
60
-
61
- jest.mock('@tanstack/react-query', () => ({
62
- useQueryClient: () => ({
63
- invalidateQueries: jest.fn(),
64
- }),
65
- }))
66
-
67
- jest.mock('@open-mercato/shared/lib/i18n/context', () => ({
68
- useT: () => (key: string, fallback?: string) => fallback ?? key,
69
- }))
70
-
71
- jest.mock('../../../backend/hooks/useEmailDuplicateCheck', () => ({
72
- useEmailDuplicateCheck: () => ({ duplicate: null, checking: false }),
73
- }))
74
-
75
- jest.mock('../../../utils/phoneDuplicates', () => ({
76
- lookupPhoneDuplicate: jest.fn(),
77
- }))
78
-
79
- jest.mock('@open-mercato/core/modules/dictionaries/components/AppearanceSelector', () => ({
80
- AppearanceSelector: ({ children }: { children?: React.ReactNode }) => <div>{children}</div>,
81
- }))
82
-
83
- jest.mock('@open-mercato/shared/lib/i18n/context', () => ({
84
- useT: () => (key: string, fallback?: string) => fallback ?? key,
85
- }))
86
-
87
- describe('Inline multiline editors', () => {
88
- it('renders markdown preview and falls back to empty label', () => {
89
- const { rerender } = render(
90
- <>
91
- {renderMultilineMarkdownDisplay({
92
- value: 'Hello **world**',
93
- emptyLabel: 'Empty state',
94
- })}
95
- </>,
96
- )
97
-
98
- expect(reactMarkdownMock).toHaveBeenCalledWith(
99
- expect.objectContaining({
100
- children: 'Hello **world**',
101
- remarkPlugins: expect.any(Array),
102
- }),
103
- )
104
-
105
- rerender(
106
- <>
107
- {renderMultilineMarkdownDisplay({
108
- value: ' ',
109
- emptyLabel: 'Empty state',
110
- })}
111
- </>,
112
- )
113
-
114
- expect(screen.getByText('Empty state')).toBeInTheDocument()
115
- })
116
-
117
- it('activates edit mode on click and shows save shortcut label', () => {
118
- const handleSave = jest.fn().mockResolvedValue(undefined)
119
- const { container } = render(
120
- <InlineMultilineEditor
121
- label="Description"
122
- value="Link text"
123
- placeholder="Description"
124
- emptyLabel="No description"
125
- onSave={handleSave}
126
- renderDisplay={({ value }) => (
127
- <a href="https://example.com" data-testid="description-link">
128
- {value}
129
- </a>
130
- )}
131
- activateOnClick
132
- />,
133
- )
134
-
135
- const wrapper = container.firstChild as HTMLElement
136
- expect(wrapper).toHaveClass('cursor-pointer')
137
-
138
- const link = screen.getByTestId('description-link')
139
- fireEvent.click(link)
140
-
141
- expect(screen.getByRole('textbox')).toBeInTheDocument()
142
- expect(screen.getByText('Save ⌘⏎ / Ctrl+Enter')).toBeInTheDocument()
143
- })
144
- })
145
-
146
- describe('Inline text editor', () => {
147
- it('renders save shortcut label with fallback text', () => {
148
- const handleSave = jest.fn().mockResolvedValue(undefined)
149
- render(
150
- <InlineTextEditor
151
- label="Domain"
152
- value="https://example.com"
153
- placeholder="Domain"
154
- emptyLabel="No domain"
155
- onSave={handleSave}
156
- activateOnClick
157
- type="url"
158
- />,
159
- )
160
-
161
- fireEvent.click(screen.getByRole('link'))
162
-
163
- expect(screen.getByRole('textbox')).toBeInTheDocument()
164
- expect(screen.getByText('Save ⌘⏎ / Ctrl+Enter')).toBeInTheDocument()
165
- })
166
- })
@@ -1,21 +0,0 @@
1
- jest.mock('@open-mercato/ui/backend/CrudForm', () => ({
2
- CrudForm: () => null,
3
- }))
4
-
5
- import { buildTaskSubmitPayload } from '../TaskForm'
6
-
7
- describe('buildTaskSubmitPayload', () => {
8
- const t = (key: string, fallback?: string) => fallback ?? key
9
-
10
- it('throws when title is missing', () => {
11
- expect(() => buildTaskSubmitPayload({}, t)).toThrow('Task name is required.')
12
- })
13
-
14
- it('returns normalized payload when title is provided', () => {
15
- const payload = buildTaskSubmitPayload({ title: ' Follow up ', is_done: true, cf_priority: 'high' }, t)
16
- expect(payload).toEqual({
17
- base: { title: 'Follow up', is_done: true },
18
- custom: { priority: 'high' },
19
- })
20
- })
21
- })
@@ -1,97 +0,0 @@
1
- import { QueryClient } from '@tanstack/query-core'
2
- import {
3
- ensureCustomerDictionary,
4
- invalidateCustomerDictionary,
5
- } from '../useCustomerDictionary'
6
-
7
- jest.mock('@open-mercato/ui/backend/utils/apiCall', () => ({
8
- readApiResultOrThrow: jest.fn(),
9
- }))
10
-
11
- import { readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'
12
-
13
- const mockReadApiResultOrThrow = readApiResultOrThrow as jest.Mock
14
-
15
- const createApiResponse = (items: unknown[]) => ({ items })
16
-
17
- describe('ensureCustomerDictionary', () => {
18
- let queryClient: QueryClient
19
-
20
- beforeEach(() => {
21
- queryClient = new QueryClient()
22
- mockReadApiResultOrThrow.mockReset()
23
- })
24
-
25
- afterEach(() => {
26
- queryClient?.clear?.()
27
- })
28
-
29
- it('normalizes API payload into dictionary data', async () => {
30
- mockReadApiResultOrThrow.mockResolvedValueOnce(
31
- createApiResponse([
32
- {
33
- id: 'status-1',
34
- value: 'new',
35
- label: 'New',
36
- color: '#AABBCC',
37
- icon: '⭐',
38
- organizationId: 'org-123',
39
- isInherited: false,
40
- },
41
- ]),
42
- )
43
-
44
- const result = await ensureCustomerDictionary(queryClient, 'statuses', 0)
45
-
46
- expect(mockReadApiResultOrThrow).toHaveBeenCalledWith(
47
- '/api/customers/dictionaries/statuses',
48
- undefined,
49
- { errorMessage: 'Failed to load dictionary entries.' },
50
- )
51
- expect(result.entries).toEqual([
52
- { value: 'new', label: 'New', color: '#aabbcc', icon: '⭐' },
53
- ])
54
- expect(result.map['new']).toEqual({ value: 'new', label: 'New', color: '#aabbcc', icon: '⭐' })
55
- expect(result.fullEntries[0]).toMatchObject({
56
- id: 'status-1',
57
- value: 'new',
58
- label: 'New',
59
- color: '#aabbcc',
60
- icon: '⭐',
61
- organizationId: 'org-123',
62
- isInherited: false,
63
- })
64
- })
65
-
66
- it('refetches freshly after invalidation and returns updated entries', async () => {
67
- mockReadApiResultOrThrow
68
- .mockResolvedValueOnce(createApiResponse([{ id: 'status-1', value: 'alpha', label: 'Alpha' }]))
69
- .mockResolvedValueOnce(createApiResponse([{ id: 'status-2', value: 'beta', label: 'Beta' }]))
70
-
71
- const first = await ensureCustomerDictionary(queryClient, 'statuses', 0)
72
- expect(first.entries.map((entry) => entry.value)).toEqual(['alpha'])
73
- expect(mockReadApiResultOrThrow).toHaveBeenCalledTimes(1)
74
-
75
- await invalidateCustomerDictionary(queryClient, 'statuses')
76
-
77
- const second = await ensureCustomerDictionary(queryClient, 'statuses', 0)
78
- expect(mockReadApiResultOrThrow).toHaveBeenCalledTimes(2)
79
- expect(second.entries.map((entry) => entry.value)).toEqual(['beta'])
80
- })
81
-
82
- it('isolates cached data per scope version', async () => {
83
- mockReadApiResultOrThrow
84
- .mockResolvedValueOnce(createApiResponse([{ id: 'source-1', value: 'scope-0', label: 'Scope Zero' }]))
85
- .mockResolvedValueOnce(createApiResponse([{ id: 'source-2', value: 'scope-1', label: 'Scope One' }]))
86
-
87
- const scopeZero = await ensureCustomerDictionary(queryClient, 'sources', 0)
88
- expect(scopeZero.entries[0]?.value).toBe('scope-0')
89
-
90
- const scopeOne = await ensureCustomerDictionary(queryClient, 'sources', 1)
91
- expect(scopeOne.entries[0]?.value).toBe('scope-1')
92
-
93
- const cachedKeys = queryClient.getQueryCache().findAll().map((query) => query.queryKey)
94
- expect(cachedKeys).toContainEqual(['customers', 'dictionaries', 'sources', 'scope:0'])
95
- expect(cachedKeys).toContainEqual(['customers', 'dictionaries', 'sources', 'scope:1'])
96
- })
97
- })
@@ -1,107 +0,0 @@
1
- import {
2
- CUSTOMER_ENTITY_ID,
3
- PERSON_ENTITY_ID,
4
- resolvePersonCustomFieldRouting,
5
- mergePersonCustomFieldValues,
6
- } from '../customFieldRouting'
7
- import { CustomFieldDef } from '@open-mercato/core/modules/entities/data/entities'
8
-
9
- describe('customers lib - custom field routing', () => {
10
- it('prefers definitions with higher score and lower penalty', async () => {
11
- const find = jest.fn().mockResolvedValue([
12
- {
13
- id: 'def-1',
14
- key: 'priority',
15
- kind: 'dictionary',
16
- configJson: JSON.stringify({ filterable: true, priority: 5 }),
17
- entityId: CUSTOMER_ENTITY_ID,
18
- },
19
- {
20
- id: 'def-2',
21
- key: 'priority',
22
- kind: 'dictionary',
23
- configJson: JSON.stringify({ filterable: true, priority: 1 }),
24
- entityId: PERSON_ENTITY_ID,
25
- },
26
- {
27
- id: 'def-3',
28
- key: 'notes',
29
- kind: 'multiline',
30
- configJson: null,
31
- entityId: PERSON_ENTITY_ID,
32
- },
33
- ])
34
-
35
- const em = { find } as unknown as Parameters<typeof resolvePersonCustomFieldRouting>[0]
36
-
37
- const routing = await resolvePersonCustomFieldRouting(em, 'tenant-1', 'org-1')
38
-
39
- expect(find).toHaveBeenCalledTimes(1)
40
- const [, where] = find.mock.calls[0]
41
- expect(where).toMatchObject({
42
- entityId: { $in: expect.arrayContaining([CUSTOMER_ENTITY_ID, PERSON_ENTITY_ID]) },
43
- deletedAt: null,
44
- isActive: true,
45
- })
46
- expect(where.$and).toEqual(
47
- expect.arrayContaining([
48
- { $or: [{ tenantId: 'tenant-1' }, { tenantId: null }] },
49
- { $or: [{ organizationId: 'org-1' }, { organizationId: null }] },
50
- ])
51
- )
52
-
53
- expect(routing.get('priority')).toBe(PERSON_ENTITY_ID)
54
- expect(routing.get('notes')).toBe(PERSON_ENTITY_ID)
55
- })
56
-
57
- it('falls back to customer entity when scores are equal', async () => {
58
- const find = jest.fn().mockResolvedValue([
59
- {
60
- id: 'def-1',
61
- key: 'priority',
62
- kind: 'dictionary',
63
- configJson: { filterable: true, priority: 2 },
64
- entityId: CUSTOMER_ENTITY_ID,
65
- },
66
- {
67
- id: 'def-2',
68
- key: 'priority',
69
- kind: 'dictionary',
70
- configJson: { filterable: true, priority: 2 },
71
- entityId: PERSON_ENTITY_ID,
72
- },
73
- ])
74
- const em = { find } as unknown as Parameters<typeof resolvePersonCustomFieldRouting>[0]
75
- const routing = await resolvePersonCustomFieldRouting(em, null, null)
76
- expect(find).toHaveBeenCalledWith(CustomFieldDef, expect.any(Object))
77
- const [, where] = find.mock.calls[0]
78
- expect(where.$and).toEqual([{ tenantId: null }])
79
- expect(routing.get('priority')).toBe(CUSTOMER_ENTITY_ID)
80
- })
81
-
82
- it('merges customer and profile custom field values correctly', () => {
83
- const routing = new Map<string, string>([
84
- ['fieldA', PERSON_ENTITY_ID],
85
- ['fieldB', CUSTOMER_ENTITY_ID],
86
- ['fieldC', PERSON_ENTITY_ID],
87
- ])
88
- const entityValues = {
89
- cf_fieldB: 'entity-value',
90
- cf_fieldC: 'old-value',
91
- }
92
- const profileValues = {
93
- cf_fieldA: 'profile-A',
94
- fieldB: 'profile-should-not-overwrite',
95
- cf_fieldC: 'profile-C',
96
- cf_fieldD: 'profile-D',
97
- }
98
- const merged = mergePersonCustomFieldValues(routing, entityValues, profileValues)
99
- expect(merged).toEqual({
100
- cf_fieldB: 'entity-value',
101
- cf_fieldC: 'profile-C',
102
- cf_fieldA: 'profile-A',
103
- cf_fieldD: 'profile-D',
104
- fieldB: 'profile-should-not-overwrite',
105
- })
106
- })
107
- })
@@ -1,105 +0,0 @@
1
- import {
2
- formatAddressJson,
3
- formatAddressLines,
4
- formatAddressString,
5
- } from '../addressFormat'
6
-
7
- describe('customers utils - address formatting', () => {
8
- it('normalizes address fields to trimmed values or null', () => {
9
- const json = formatAddressJson(
10
- {
11
- addressLine1: ' 123 Baker Street ',
12
- addressLine2: ' Suite 5 ',
13
- buildingNumber: ' 10 ',
14
- flatNumber: ' 2B ',
15
- postalCode: ' NW1 ',
16
- city: ' London ',
17
- region: ' Greater London ',
18
- country: ' UK ',
19
- companyName: ' Widgets Inc. ',
20
- },
21
- 'street_first'
22
- )
23
- expect(json).toEqual({
24
- format: 'street_first',
25
- companyName: 'Widgets Inc.',
26
- addressLine1: '123 Baker Street',
27
- addressLine2: 'Suite 5',
28
- buildingNumber: '10',
29
- flatNumber: '2B',
30
- postalCode: 'NW1',
31
- city: 'London',
32
- region: 'Greater London',
33
- country: 'UK',
34
- })
35
- })
36
-
37
- it('formats lines in street_first mode with merged street data', () => {
38
- const lines = formatAddressLines(
39
- {
40
- addressLine1: 'Baker Street',
41
- addressLine2: 'Suite 5',
42
- buildingNumber: '10',
43
- flatNumber: '2B',
44
- postalCode: 'NW1',
45
- city: 'London',
46
- region: 'Greater London',
47
- country: 'UK',
48
- },
49
- 'street_first'
50
- )
51
- expect(lines).toEqual([
52
- 'Baker Street 10/2B',
53
- 'Suite 5',
54
- 'NW1 London',
55
- 'Greater London',
56
- 'UK',
57
- ])
58
- })
59
-
60
- it('adds company name as the first line when present', () => {
61
- const lines = formatAddressLines(
62
- {
63
- companyName: 'Widgets Inc.',
64
- addressLine1: 'Baker Street',
65
- buildingNumber: '10',
66
- postalCode: 'NW1',
67
- city: 'London',
68
- },
69
- 'street_first'
70
- )
71
- expect(lines[0]).toBe('Widgets Inc.')
72
- expect(lines.slice(1)).toEqual(['Baker Street 10', 'NW1 London'])
73
- })
74
-
75
- it('formats lines in line_first mode preserving primary line', () => {
76
- const lines = formatAddressLines(
77
- {
78
- addressLine1: 'Headquarters',
79
- addressLine2: 'North Entrance',
80
- buildingNumber: '10',
81
- postalCode: 'NW1',
82
- city: 'London',
83
- country: 'UK',
84
- },
85
- 'line_first'
86
- )
87
- expect(lines).toEqual([
88
- 'Headquarters 10',
89
- 'North Entrance',
90
- 'NW1 London',
91
- 'UK',
92
- ])
93
- })
94
-
95
- it('joins formatted lines into a single string', () => {
96
- const address = {
97
- addressLine1: 'Baker Street',
98
- buildingNumber: '10',
99
- postalCode: 'NW1',
100
- city: 'London',
101
- }
102
- expect(formatAddressString(address, 'street_first')).toBe('Baker Street 10, NW1 London')
103
- expect(formatAddressString(address, 'line_first', ' | ')).toBe('Baker Street 10 | NW1 London')
104
- })
105
- })
@@ -1,98 +0,0 @@
1
- jest.mock('@open-mercato/ui/backend/utils/apiCall', () => ({
2
- apiCall: jest.fn(),
3
- }))
4
-
5
- import { lookupPhoneDuplicate } from '../phoneDuplicates'
6
- import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
7
-
8
- const mockedApiCall = apiCall as jest.MockedFunction<typeof apiCall>
9
-
10
- const createResponse = (payload: unknown, ok = true) => {
11
- return {
12
- ok,
13
- status: ok ? 200 : 500,
14
- result: payload,
15
- response: {} as Response,
16
- cacheStatus: null,
17
- }
18
- }
19
-
20
- describe('customers utils - phone duplicate lookup', () => {
21
- beforeEach(() => {
22
- mockedApiCall.mockReset()
23
- })
24
-
25
- it('returns null when no digits are provided', async () => {
26
- const result = await lookupPhoneDuplicate(' ( ) ')
27
- expect(result).toBeNull()
28
- expect(mockedApiCall).not.toHaveBeenCalled()
29
- })
30
-
31
- it('returns first matching duplicate and builds link', async () => {
32
- mockedApiCall.mockResolvedValueOnce(
33
- createResponse({
34
- items: [
35
- { id: 'c1', display_name: 'Ada Lovelace', primary_phone: '+1 (555) 123-4567' },
36
- ],
37
- total: 1,
38
- })
39
- )
40
- const result = await lookupPhoneDuplicate('+1 555 123-4567')
41
- expect(result).toEqual({
42
- id: 'c1',
43
- label: 'Ada Lovelace',
44
- href: '/backend/customers/people/c1',
45
- })
46
- expect(mockedApiCall).toHaveBeenCalledWith(
47
- '/api/customers/people?hasPhone=true&page=1&pageSize=50&sortField=createdAt&sortDir=desc'
48
- )
49
- })
50
-
51
- it('skips current record and continues scanning subsequent pages', async () => {
52
- mockedApiCall
53
- .mockResolvedValueOnce(
54
- createResponse({
55
- items: [
56
- { id: 'current', display_name: 'Keep', primary_phone: '+1 555 123-4567' },
57
- ],
58
- total: 120,
59
- })
60
- )
61
- .mockResolvedValueOnce(
62
- createResponse({
63
- items: [
64
- { id: 'duplicate', display_name: 'Grace Hopper', primary_phone: '+1 555 123-4567' },
65
- ],
66
- total: 120,
67
- })
68
- )
69
- .mockResolvedValue(createResponse({ items: [], total: 120 }))
70
-
71
- const result = await lookupPhoneDuplicate('+1 555 123-4567', { recordId: 'current' })
72
- expect(result).toEqual({
73
- id: 'duplicate',
74
- label: 'Grace Hopper',
75
- href: '/backend/customers/people/duplicate',
76
- })
77
- expect(mockedApiCall).toHaveBeenCalledTimes(2)
78
- })
79
-
80
- it('ignores failed requests and returns null when nothing matches', async () => {
81
- mockedApiCall
82
- .mockRejectedValueOnce(new Error('network'))
83
- .mockResolvedValueOnce(
84
- createResponse({
85
- items: [
86
- { id: 'c1', display_name: 'Incomplete', primary_phone: '+1 555 000-0000' },
87
- { id: 'c2', display_name: null, primary_phone: '+1 555 123-4567' },
88
- ],
89
- total: 200,
90
- })
91
- )
92
- .mockResolvedValue(createResponse({ items: [], total: 200 }))
93
-
94
- const result = await lookupPhoneDuplicate('+1 555 999-9999')
95
- expect(result).toBeNull()
96
- expect(mockedApiCall).toHaveBeenCalledTimes(3)
97
- })
98
- })