@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,25 +0,0 @@
1
- import { test, expect } from "@playwright/test";
2
- import { login } from "@open-mercato/core/modules/core/__integration__/helpers/auth";
3
- test.describe("TC-ADMIN-009: View System Status Dashboard", () => {
4
- test("should display system status sections with environment variable details", async ({ page }) => {
5
- await login(page, "admin");
6
- await page.goto("/backend/config/system-status");
7
- await expect(page.getByRole("heading", { name: "System status", level: 2 })).toBeVisible();
8
- await expect(page.getByText("Review debugging, cache, and logging flags")).toBeVisible();
9
- await page.getByText("Loading status snapshot").waitFor({ state: "hidden", timeout: 1e4 }).catch(() => {
10
- });
11
- await expect(page.getByText(/Runtime mode:/)).toBeVisible();
12
- await expect(page.getByRole("heading", { name: "Profiling", level: 3 })).toBeVisible();
13
- await expect(page.getByRole("heading", { name: "Logging", level: 3 })).toBeVisible();
14
- await expect(page.getByRole("heading", { name: "Security", level: 3 })).toBeVisible();
15
- await expect(page.getByRole("heading", { name: "Caching", level: 3 })).toBeVisible();
16
- await expect(page.getByRole("heading", { name: "Query index", level: 3 })).toBeVisible();
17
- await expect(page.getByText("Current value").first()).toBeVisible();
18
- await expect(page.getByText("Default").first()).toBeVisible();
19
- await expect(page.getByRole("heading", { name: "Cache strategy", level: 4 })).toBeVisible();
20
- await expect(page.getByRole("heading", { name: "Password min length", level: 4 })).toBeVisible();
21
- await expect(page.getByRole("link", { name: "System status" })).toBeVisible();
22
- await expect(page.getByRole("link", { name: "Cache" })).toBeVisible();
23
- });
24
- });
25
- //# sourceMappingURL=TC-ADMIN-009.spec.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/admin/TC-ADMIN-009.spec.ts"],
4
- "sourcesContent": ["import { test, expect } from '@playwright/test';\nimport { login } from '@open-mercato/core/modules/core/__integration__/helpers/auth';\n\n/**\n * TC-ADMIN-009: View System Status Dashboard\n * Source: .ai/qa/scenarios/TC-ADMIN-009-system-status-view.md\n *\n * Verifies that the system status page displays environment variable\n * configuration sections for profiling, logging, security, caching,\n * query index, and entities.\n *\n * Navigation: Settings \u2192 System \u2192 System status\n */\ntest.describe('TC-ADMIN-009: View System Status Dashboard', () => {\n test('should display system status sections with environment variable details', async ({ page }) => {\n await login(page, 'admin');\n await page.goto('/backend/config/system-status');\n\n // Wait for the page to load\n await expect(page.getByRole('heading', { name: 'System status', level: 2 })).toBeVisible();\n await expect(page.getByText('Review debugging, cache, and logging flags')).toBeVisible();\n\n // Wait for loading to finish\n await page.getByText('Loading status snapshot').waitFor({ state: 'hidden', timeout: 10_000 }).catch(() => {});\n\n // Verify runtime mode is shown\n await expect(page.getByText(/Runtime mode:/)).toBeVisible();\n\n // Verify key sections are present\n await expect(page.getByRole('heading', { name: 'Profiling', level: 3 })).toBeVisible();\n await expect(page.getByRole('heading', { name: 'Logging', level: 3 })).toBeVisible();\n await expect(page.getByRole('heading', { name: 'Security', level: 3 })).toBeVisible();\n await expect(page.getByRole('heading', { name: 'Caching', level: 3 })).toBeVisible();\n await expect(page.getByRole('heading', { name: 'Query index', level: 3 })).toBeVisible();\n\n // Verify at least one env var card shows Current value and Default\n await expect(page.getByText('Current value').first()).toBeVisible();\n await expect(page.getByText('Default').first()).toBeVisible();\n\n // Verify specific env var cards exist\n await expect(page.getByRole('heading', { name: 'Cache strategy', level: 4 })).toBeVisible();\n await expect(page.getByRole('heading', { name: 'Password min length', level: 4 })).toBeVisible();\n\n // Verify the page is accessible via Settings sidebar\n await expect(page.getByRole('link', { name: 'System status' })).toBeVisible();\n await expect(page.getByRole('link', { name: 'Cache' })).toBeVisible();\n });\n});\n"],
5
- "mappings": "AAAA,SAAS,MAAM,cAAc;AAC7B,SAAS,aAAa;AAYtB,KAAK,SAAS,8CAA8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,KAAK,UAAU,QAAQ,EAAE,MAAM,gBAAgB,CAAC,CAAC,EAAE,YAAY;AAC5E,UAAM,OAAO,KAAK,UAAU,QAAQ,EAAE,MAAM,QAAQ,CAAC,CAAC,EAAE,YAAY;AAAA,EACtE,CAAC;AACH,CAAC;",
6
- "names": []
7
- }
@@ -1,35 +0,0 @@
1
- import { test, expect } from "@playwright/test";
2
- import { login } from "@open-mercato/core/modules/core/__integration__/helpers/auth";
3
- test.describe("TC-ADMIN-010: Cache Management", () => {
4
- test("should display cache statistics and allow purging", async ({ page }) => {
5
- await login(page, "superadmin");
6
- await page.goto("/backend/customers/companies");
7
- await page.getByText("Loading data...").waitFor({ state: "hidden", timeout: 1e4 }).catch(() => {
8
- });
9
- await page.goto("/backend/config/cache");
10
- await expect(page.getByRole("heading", { name: "Cache overview", level: 2 })).toBeVisible();
11
- await expect(page.getByText("Inspect cached responses and clear segments")).toBeVisible();
12
- await page.getByText("Loading cache statistics").waitFor({ state: "hidden", timeout: 1e4 }).catch(() => {
13
- });
14
- await expect(page.getByText(/\d+ cached entr/)).toBeVisible();
15
- await expect(page.getByText(/Stats generated/)).toBeVisible();
16
- await expect(page.getByRole("button", { name: "Refresh" })).toBeVisible();
17
- const purgeAllButton = page.getByRole("button", { name: "Purge all cache" }).first();
18
- if (await purgeAllButton.isVisible().catch(() => false)) {
19
- await expect(purgeAllButton).toBeVisible();
20
- }
21
- const hasEmptyState = await page.getByText(/No cached responses for this tenant\./).isVisible().catch(() => false);
22
- if (!hasEmptyState) {
23
- await expect(page.getByRole("columnheader", { name: "Segment" })).toBeVisible();
24
- await expect(page.getByRole("columnheader", { name: "Path" })).toBeVisible();
25
- await expect(page.getByRole("columnheader", { name: "Method" })).toBeVisible();
26
- await expect(page.getByRole("columnheader", { name: "Cached keys" })).toBeVisible();
27
- const firstPurgeButton = page.getByRole("button", { name: "Purge segment" }).first();
28
- await firstPurgeButton.click();
29
- await expect(page.getByText(/Stats generated/)).toBeVisible();
30
- } else {
31
- await expect(page.getByText(/No cached responses for this tenant\./)).toBeVisible();
32
- }
33
- });
34
- });
35
- //# sourceMappingURL=TC-ADMIN-010.spec.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/admin/TC-ADMIN-010.spec.ts"],
4
- "sourcesContent": ["import { test, expect } from '@playwright/test';\nimport { login } from '@open-mercato/core/modules/core/__integration__/helpers/auth';\n\n/**\n * TC-ADMIN-010: Cache Management\n * Source: .ai/qa/scenarios/TC-ADMIN-010-cache-management.md\n *\n * Verifies that the cache overview page displays cache statistics,\n * segments with purge controls, and a global purge button.\n *\n * Navigation: Settings \u2192 System \u2192 Cache\n */\ntest.describe('TC-ADMIN-010: Cache Management', () => {\n test('should display cache statistics and allow purging', async ({ page }) => {\n await login(page, 'superadmin');\n\n // First visit a CRUD page to ensure some cache entries exist\n await page.goto('/backend/customers/companies');\n await page.getByText('Loading data...').waitFor({ state: 'hidden', timeout: 10_000 }).catch(() => {});\n\n // Navigate to cache management\n await page.goto('/backend/config/cache');\n\n // Verify page heading\n await expect(page.getByRole('heading', { name: 'Cache overview', level: 2 })).toBeVisible();\n await expect(page.getByText('Inspect cached responses and clear segments')).toBeVisible();\n\n // Wait for loading\n await page.getByText('Loading cache statistics').waitFor({ state: 'hidden', timeout: 10_000 }).catch(() => {});\n\n // Verify stats are displayed\n await expect(page.getByText(/\\d+ cached entr/)).toBeVisible();\n await expect(page.getByText(/Stats generated/)).toBeVisible();\n\n // Verify control buttons\n await expect(page.getByRole('button', { name: 'Refresh' })).toBeVisible();\n const purgeAllButton = page.getByRole('button', { name: 'Purge all cache' }).first();\n if (await purgeAllButton.isVisible().catch(() => false)) {\n await expect(purgeAllButton).toBeVisible();\n }\n\n // Verify table structure + purge flow only when segments are present\n const hasEmptyState = await page.getByText(/No cached responses for this tenant\\./).isVisible().catch(() => false);\n if (!hasEmptyState) {\n await expect(page.getByRole('columnheader', { name: 'Segment' })).toBeVisible();\n await expect(page.getByRole('columnheader', { name: 'Path' })).toBeVisible();\n await expect(page.getByRole('columnheader', { name: 'Method' })).toBeVisible();\n await expect(page.getByRole('columnheader', { name: 'Cached keys' })).toBeVisible();\n\n const firstPurgeButton = page.getByRole('button', { name: 'Purge segment' }).first();\n await firstPurgeButton.click();\n await expect(page.getByText(/Stats generated/)).toBeVisible();\n } else {\n await expect(page.getByText(/No cached responses for this tenant\\./)).toBeVisible();\n }\n });\n});\n"],
5
- "mappings": "AAAA,SAAS,MAAM,cAAc;AAC7B,SAAS,aAAa;AAWtB,KAAK,SAAS,kCAAkC,MAAM;AACpD,OAAK,qDAAqD,OAAO,EAAE,KAAK,MAAM;AAC5E,UAAM,MAAM,MAAM,YAAY;AAG9B,UAAM,KAAK,KAAK,8BAA8B;AAC9C,UAAM,KAAK,UAAU,iBAAiB,EAAE,QAAQ,EAAE,OAAO,UAAU,SAAS,IAAO,CAAC,EAAE,MAAM,MAAM;AAAA,IAAC,CAAC;AAGpG,UAAM,KAAK,KAAK,uBAAuB;AAGvC,UAAM,OAAO,KAAK,UAAU,WAAW,EAAE,MAAM,kBAAkB,OAAO,EAAE,CAAC,CAAC,EAAE,YAAY;AAC1F,UAAM,OAAO,KAAK,UAAU,6CAA6C,CAAC,EAAE,YAAY;AAGxF,UAAM,KAAK,UAAU,0BAA0B,EAAE,QAAQ,EAAE,OAAO,UAAU,SAAS,IAAO,CAAC,EAAE,MAAM,MAAM;AAAA,IAAC,CAAC;AAG7G,UAAM,OAAO,KAAK,UAAU,iBAAiB,CAAC,EAAE,YAAY;AAC5D,UAAM,OAAO,KAAK,UAAU,iBAAiB,CAAC,EAAE,YAAY;AAG5D,UAAM,OAAO,KAAK,UAAU,UAAU,EAAE,MAAM,UAAU,CAAC,CAAC,EAAE,YAAY;AACxE,UAAM,iBAAiB,KAAK,UAAU,UAAU,EAAE,MAAM,kBAAkB,CAAC,EAAE,MAAM;AACnF,QAAI,MAAM,eAAe,UAAU,EAAE,MAAM,MAAM,KAAK,GAAG;AACvD,YAAM,OAAO,cAAc,EAAE,YAAY;AAAA,IAC3C;AAGA,UAAM,gBAAgB,MAAM,KAAK,UAAU,uCAAuC,EAAE,UAAU,EAAE,MAAM,MAAM,KAAK;AACjH,QAAI,CAAC,eAAe;AAClB,YAAM,OAAO,KAAK,UAAU,gBAAgB,EAAE,MAAM,UAAU,CAAC,CAAC,EAAE,YAAY;AAC9E,YAAM,OAAO,KAAK,UAAU,gBAAgB,EAAE,MAAM,OAAO,CAAC,CAAC,EAAE,YAAY;AAC3E,YAAM,OAAO,KAAK,UAAU,gBAAgB,EAAE,MAAM,SAAS,CAAC,CAAC,EAAE,YAAY;AAC7E,YAAM,OAAO,KAAK,UAAU,gBAAgB,EAAE,MAAM,cAAc,CAAC,CAAC,EAAE,YAAY;AAElF,YAAM,mBAAmB,KAAK,UAAU,UAAU,EAAE,MAAM,gBAAgB,CAAC,EAAE,MAAM;AACnF,YAAM,iBAAiB,MAAM;AAC7B,YAAM,OAAO,KAAK,UAAU,iBAAiB,CAAC,EAAE,YAAY;AAAA,IAC9D,OAAO;AACL,YAAM,OAAO,KAAK,UAAU,uCAAuC,CAAC,EAAE,YAAY;AAAA,IACpF;AAAA,EACF,CAAC;AACH,CAAC;",
6
- "names": []
7
- }
@@ -1,64 +0,0 @@
1
- import { DEFAULT_CREDENTIALS } from "./auth.js";
2
- const BASE_URL = process.env.BASE_URL || "http://localhost:3000";
3
- async function getAuthToken(request, roleOrEmail = "admin", password) {
4
- const role = roleOrEmail in DEFAULT_CREDENTIALS ? roleOrEmail : null;
5
- const credentialAttempts = [];
6
- if (role) {
7
- const configured = DEFAULT_CREDENTIALS[role];
8
- credentialAttempts.push({ email: configured.email, password: password ?? configured.password });
9
- if (!password) {
10
- credentialAttempts.push({ email: `${role}@acme.com`, password: "secret" });
11
- }
12
- } else {
13
- credentialAttempts.push({ email: roleOrEmail, password: password ?? "secret" });
14
- }
15
- let lastStatus = 0;
16
- for (const attempt of credentialAttempts) {
17
- const form = new URLSearchParams();
18
- form.set("email", attempt.email);
19
- form.set("password", attempt.password);
20
- const response = await request.post(`${BASE_URL}/api/auth/login`, {
21
- headers: {
22
- "content-type": "application/x-www-form-urlencoded"
23
- },
24
- data: form.toString()
25
- });
26
- const raw = await response.text();
27
- let body = null;
28
- try {
29
- body = raw ? JSON.parse(raw) : null;
30
- } catch {
31
- body = null;
32
- }
33
- lastStatus = response.status();
34
- if (response.ok() && body && typeof body.token === "string" && body.token) {
35
- return body.token;
36
- }
37
- }
38
- throw new Error(`Failed to obtain auth token (status ${lastStatus})`);
39
- }
40
- async function apiRequest(request, method, path, options) {
41
- const url = `${BASE_URL}${path}`;
42
- const headers = {
43
- Authorization: `Bearer ${options.token}`,
44
- "Content-Type": "application/json"
45
- };
46
- return request.fetch(url, { method, headers, data: options.data });
47
- }
48
- async function postForm(request, path, data, options) {
49
- const form = new URLSearchParams();
50
- for (const [key, value] of Object.entries(data)) form.set(key, value);
51
- return request.post(`${BASE_URL}${path}`, {
52
- headers: {
53
- "content-type": "application/x-www-form-urlencoded",
54
- ...options?.headers ?? {}
55
- },
56
- data: form.toString()
57
- });
58
- }
59
- export {
60
- apiRequest,
61
- getAuthToken,
62
- postForm
63
- };
64
- //# sourceMappingURL=api.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/helpers/api.ts"],
4
- "sourcesContent": ["import { type APIRequestContext } from '@playwright/test';\nimport { DEFAULT_CREDENTIALS, type Role } from './auth';\n\nconst BASE_URL = process.env.BASE_URL || 'http://localhost:3000';\n\nexport async function getAuthToken(\n request: APIRequestContext,\n roleOrEmail: Role | string = 'admin',\n password?: string,\n): Promise<string> {\n const role = roleOrEmail in DEFAULT_CREDENTIALS ? (roleOrEmail as Role) : null;\n const credentialAttempts: Array<{ email: string; password: string }> = [];\n\n if (role) {\n const configured = DEFAULT_CREDENTIALS[role];\n credentialAttempts.push({ email: configured.email, password: password ?? configured.password });\n if (!password) {\n credentialAttempts.push({ email: `${role}@acme.com`, password: 'secret' });\n }\n } else {\n credentialAttempts.push({ email: roleOrEmail, password: password ?? 'secret' });\n }\n\n let lastStatus = 0;\n\n for (const attempt of credentialAttempts) {\n const form = new URLSearchParams();\n form.set('email', attempt.email);\n form.set('password', attempt.password);\n\n const response = await request.post(`${BASE_URL}/api/auth/login`, {\n headers: {\n 'content-type': 'application/x-www-form-urlencoded',\n },\n data: form.toString(),\n });\n\n const raw = await response.text();\n let body: Record<string, unknown> | null = null;\n try {\n body = raw ? (JSON.parse(raw) as Record<string, unknown>) : null;\n } catch {\n body = null;\n }\n\n lastStatus = response.status();\n if (response.ok() && body && typeof body.token === 'string' && body.token) {\n return body.token;\n }\n }\n\n throw new Error(`Failed to obtain auth token (status ${lastStatus})`);\n}\n\nexport async function apiRequest(\n request: APIRequestContext,\n method: string,\n path: string,\n options: { token: string; data?: unknown },\n) {\n const url = `${BASE_URL}${path}`;\n const headers = {\n Authorization: `Bearer ${options.token}`,\n 'Content-Type': 'application/json',\n };\n return request.fetch(url, { method, headers, data: options.data });\n}\n\nexport async function postForm(\n request: APIRequestContext,\n path: string,\n data: Record<string, string>,\n options?: { headers?: Record<string, string> },\n) {\n const form = new URLSearchParams();\n for (const [key, value] of Object.entries(data)) form.set(key, value);\n return request.post(`${BASE_URL}${path}`, {\n headers: {\n 'content-type': 'application/x-www-form-urlencoded',\n ...(options?.headers ?? {}),\n },\n data: form.toString(),\n });\n}\n"],
5
- "mappings": "AACA,SAAS,2BAAsC;AAE/C,MAAM,WAAW,QAAQ,IAAI,YAAY;AAEzC,eAAsB,aACpB,SACA,cAA6B,SAC7B,UACiB;AACjB,QAAM,OAAO,eAAe,sBAAuB,cAAuB;AAC1E,QAAM,qBAAiE,CAAC;AAExE,MAAI,MAAM;AACR,UAAM,aAAa,oBAAoB,IAAI;AAC3C,uBAAmB,KAAK,EAAE,OAAO,WAAW,OAAO,UAAU,YAAY,WAAW,SAAS,CAAC;AAC9F,QAAI,CAAC,UAAU;A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SAAO,QAAQ,KAAK,GAAG,QAAQ,GAAG,IAAI,IAAI;AAAA,IACxC,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,GAAI,SAAS,WAAW,CAAC;AAAA,IAC3B;AAAA,IACA,MAAM,KAAK,SAAS;AAAA,EACtB,CAAC;AACH;",
6
- "names": []
7
- }
@@ -1,98 +0,0 @@
1
- import { readFileSync } from "fs";
2
- import { resolve } from "path";
3
- function loadEnvFileContent() {
4
- const candidatePaths = [
5
- resolve(process.cwd(), "apps/mercato/.env"),
6
- resolve(process.cwd(), ".env")
7
- ];
8
- for (const envPath of candidatePaths) {
9
- try {
10
- const content = readFileSync(envPath, "utf-8");
11
- if (content.trim().length > 0) {
12
- return content;
13
- }
14
- } catch {
15
- continue;
16
- }
17
- }
18
- return null;
19
- }
20
- function loadEnvValue(key) {
21
- if (process.env[key]) return process.env[key];
22
- const content = loadEnvFileContent();
23
- if (!content) return void 0;
24
- const match = content.match(new RegExp(`^${key}=(.+)$`, "m"));
25
- return match?.[1]?.trim();
26
- }
27
- const DEFAULT_CREDENTIALS = {
28
- superadmin: {
29
- email: loadEnvValue("OM_INIT_SUPERADMIN_EMAIL") || "superadmin@acme.com",
30
- password: loadEnvValue("OM_INIT_SUPERADMIN_PASSWORD") || "secret"
31
- },
32
- admin: { email: "admin@acme.com", password: "secret" },
33
- employee: { email: "employee@acme.com", password: "secret" }
34
- };
35
- async function acknowledgeGlobalNotices(page) {
36
- const baseUrl = process.env.BASE_URL || "http://localhost:3000";
37
- await page.context().addCookies([
38
- {
39
- name: "om_demo_notice_ack",
40
- value: "ack",
41
- url: baseUrl,
42
- sameSite: "Lax"
43
- },
44
- {
45
- name: "om_cookie_notice_ack",
46
- value: "ack",
47
- url: baseUrl,
48
- sameSite: "Lax"
49
- }
50
- ]);
51
- }
52
- async function dismissGlobalNoticesIfPresent(page) {
53
- const cookieAcceptButton = page.getByRole("button", { name: /accept cookies/i }).first();
54
- if (await cookieAcceptButton.isVisible().catch(() => false)) {
55
- await cookieAcceptButton.click();
56
- }
57
- const demoNotice = page.getByText(/this instance is provided for demo purposes only/i).first();
58
- if (await demoNotice.isVisible().catch(() => false)) {
59
- const noticeContainer = demoNotice.locator('xpath=ancestor::div[contains(@class,"pointer-events-auto")]').first();
60
- const dismissButton = noticeContainer.locator("button").first();
61
- if (await dismissButton.isVisible().catch(() => false)) {
62
- await dismissButton.click();
63
- }
64
- }
65
- }
66
- async function login(page, role = "admin") {
67
- const creds = DEFAULT_CREDENTIALS[role];
68
- const hasBackendUrl = () => /\/backend(?:\/.*)?$/.test(page.url());
69
- const waitForBackend = async (timeout) => {
70
- try {
71
- await page.waitForURL(/\/backend(?:\/.*)?$/, { timeout });
72
- return true;
73
- } catch {
74
- return hasBackendUrl();
75
- }
76
- };
77
- await acknowledgeGlobalNotices(page);
78
- await page.goto("/login");
79
- await dismissGlobalNoticesIfPresent(page);
80
- await page.getByLabel("Email").fill(creds.email);
81
- const passwordInput = page.getByLabel("Password");
82
- await passwordInput.fill(creds.password);
83
- await passwordInput.press("Enter");
84
- if (await waitForBackend(7e3)) return;
85
- const loginButton = page.getByRole("button", { name: /login|sign in/i }).first();
86
- if (await loginButton.isVisible().catch(() => false)) {
87
- await loginButton.click({ force: true });
88
- }
89
- if (await waitForBackend(8e3)) return;
90
- await page.goto("/backend");
91
- if (await waitForBackend(8e3)) return;
92
- throw new Error(`Login did not reach backend for role: ${role}; current URL: ${page.url()}`);
93
- }
94
- export {
95
- DEFAULT_CREDENTIALS,
96
- login
97
- };
98
- //# sourceMappingURL=auth.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/helpers/auth.ts"],
4
- "sourcesContent": ["import { type Page } from '@playwright/test';\nimport { readFileSync } from 'fs';\nimport { resolve } from 'path';\n\nfunction loadEnvFileContent(): string | null {\n const candidatePaths = [\n resolve(process.cwd(), 'apps/mercato/.env'),\n resolve(process.cwd(), '.env'),\n ];\n\n for (const envPath of candidatePaths) {\n try {\n const content = readFileSync(envPath, 'utf-8');\n if (content.trim().length > 0) {\n return content;\n }\n } catch {\n continue;\n }\n }\n\n return null;\n}\n\nfunction loadEnvValue(key: string): string | undefined {\n if (process.env[key]) return process.env[key];\n const content = loadEnvFileContent();\n if (!content) return undefined;\n const match = content.match(new RegExp(`^${key}=(.+)$`, 'm'));\n return match?.[1]?.trim();\n}\n\nexport const DEFAULT_CREDENTIALS: Record<string, { email: string; password: string }> = {\n superadmin: {\n email: loadEnvValue('OM_INIT_SUPERADMIN_EMAIL') || 'superadmin@acme.com',\n password: loadEnvValue('OM_INIT_SUPERADMIN_PASSWORD') || 'secret',\n },\n admin: { email: 'admin@acme.com', password: 'secret' },\n employee: { email: 'employee@acme.com', password: 'secret' },\n};\n\nexport type Role = 'superadmin' | 'admin' | 'employee';\n\nasync function acknowledgeGlobalNotices(page: Page): Promise<void> {\n const baseUrl = process.env.BASE_URL || 'http://localhost:3000';\n await page.context().addCookies([\n {\n name: 'om_demo_notice_ack',\n value: 'ack',\n url: baseUrl,\n sameSite: 'Lax',\n },\n {\n name: 'om_cookie_notice_ack',\n value: 'ack',\n url: baseUrl,\n sameSite: 'Lax',\n },\n ]);\n}\n\nasync function dismissGlobalNoticesIfPresent(page: Page): Promise<void> {\n const cookieAcceptButton = page.getByRole('button', { name: /accept cookies/i }).first();\n if (await cookieAcceptButton.isVisible().catch(() => false)) {\n await cookieAcceptButton.click();\n }\n\n const demoNotice = page.getByText(/this instance is provided for demo purposes only/i).first();\n if (await demoNotice.isVisible().catch(() => false)) {\n const noticeContainer = demoNotice.locator('xpath=ancestor::div[contains(@class,\"pointer-events-auto\")]').first();\n const dismissButton = noticeContainer.locator('button').first();\n if (await dismissButton.isVisible().catch(() => false)) {\n await dismissButton.click();\n }\n }\n}\n\nexport async function login(page: Page, role: Role = 'admin'): Promise<void> {\n const creds = DEFAULT_CREDENTIALS[role];\n const hasBackendUrl = (): boolean => /\\/backend(?:\\/.*)?$/.test(page.url());\n const waitForBackend = async (timeout: number): Promise<boolean> => {\n try {\n await page.waitForURL(/\\/backend(?:\\/.*)?$/, { timeout });\n return true;\n } catch {\n return hasBackendUrl();\n }\n };\n\n await acknowledgeGlobalNotices(page);\n await page.goto('/login');\n await dismissGlobalNoticesIfPresent(page);\n await page.getByLabel('Email').fill(creds.email);\n const passwordInput = page.getByLabel('Password');\n await passwordInput.fill(creds.password);\n await passwordInput.press('Enter');\n\n if (await waitForBackend(7_000)) return;\n\n const loginButton = page.getByRole('button', { name: /login|sign in/i }).first();\n if (await loginButton.isVisible().catch(() => false)) {\n await loginButton.click({ force: true });\n }\n if (await waitForBackend(8_000)) return;\n\n await page.goto('/backend');\n if (await waitForBackend(8_000)) return;\n\n throw new Error(`Login did not reach backend for role: ${role}; current URL: ${page.url()}`);\n}\n"],
5
- "mappings": "AACA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AAExB,SAAS,qBAAoC;AAC3C,QAAM,iBAAiB;AAAA,IACrB,QAAQ,QAAQ,IAAI,GAAG,mBAAmB;AAAA,IAC1C,QAAQ,QAAQ,IAAI,GAAG,MAAM;AAAA,EAC/B;AAEA,aAAW,WAAW,gBAAgB;AACpC,QAAI;AACF,YAAM,UAAU,aAAa,SAAS,OAAO;AAC7C,UAAI,QAAQ,KAAK,EAAE,SAAS,GAAG;AAC7B,eAAO;AAAA,MACT;AAAA,IACF,QAAQ;AACN;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,aAAa,KAAiC;AACrD,MAAI,QAAQ,IAAI,GAAG,EAAG,QAAO,QAAQ,IAAI,GAAG;AAC5C,QAAM,UAAU,mBAAmB;AACnC,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,QAAQ,QAAQ,MAAM,IAAI,OAAO,IAAI,GAAG,UAAU,GAAG,CAAC;AAC5D,SAAO,QAAQ,CAAC,GAAG,KAAK;AAC1B;AAEO,MAAM,sBAA2E;AAAA,EACtF,YAAY;AAAA,IACV,OAAO,aAAa,0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EAAE,QAAQ,CAAC;AACxD,aAAO;AAAA,IACT,QAAQ;AACN,aAAO,cAAc;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,yBAAyB,IAAI;AACnC,QAAM,KAAK,KAAK,QAAQ;AACxB,QAAM,8BAA8B,IAAI;AACxC,QAAM,KAAK,WAAW,OAAO,EAAE,KAAK,MAAM,KAAK;AAC/C,QAAM,gBAAgB,KAAK,WAAW,UAAU;AAChD,QAAM,cAAc,KAAK,MAAM,QAAQ;AACvC,QAAM,cAAc,MAAM,OAAO;AAEjC,MAAI,MAAM,eAAe,GAAK,EAAG;AAEjC,QAAM,cAAc,KAAK,UAAU,UAAU,EAAE,MAAM,iBAAiB,CAAC,EAAE,MAAM;AAC/E,MAAI,MAAM,YAAY,UAAU,EAAE,MAAM,MAAM,KAAK,GAAG;AACpD,UAAM,YAAY,MAAM,EAAE,OAAO,KAAK,CAAC;AAAA,EACzC;AACA,MAAI,MAAM,eAAe,GAAK,EAAG;AAEjC,QAAM,KAAK,KAAK,UAAU;AAC1B,MAAI,MAAM,eAAe,GAAK,EAAG;AAEjC,QAAM,IAAI,MAAM,yCAAyC,IAAI,kBAAkB,KAAK,IAAI,CAAC,EAAE;AAC7F;",
6
- "names": []
7
- }
@@ -1,31 +0,0 @@
1
- import { expect } from "@playwright/test";
2
- async function createUserViaUi(page, input) {
3
- const role = input.role ?? "employee";
4
- await page.goto("/backend/users/create");
5
- await expect(page.getByText("Create User")).toBeVisible();
6
- await page.getByRole("textbox").nth(0).fill(input.email);
7
- await page.getByRole("textbox").nth(1).fill(input.password);
8
- const orgSelect = page.locator("main").locator("select").first();
9
- await expect(orgSelect).toBeEnabled();
10
- const orgValue = await orgSelect.evaluate((element) => {
11
- const select = element;
12
- for (const option of Array.from(select.options)) {
13
- if (option.value && option.value.trim().length > 0) return option.value;
14
- }
15
- return "";
16
- });
17
- if (orgValue) {
18
- await orgSelect.selectOption(orgValue);
19
- }
20
- const rolesInput = page.getByRole("textbox", { name: /add tag and press enter/i });
21
- await rolesInput.fill(role);
22
- await rolesInput.press("Enter");
23
- await page.getByRole("button", { name: "Create" }).first().click();
24
- await expect(page).toHaveURL(/\/backend\/users(?:\?.*)?$/);
25
- await page.getByRole("textbox", { name: "Search" }).fill(input.email);
26
- await expect(page.getByRole("row", { name: new RegExp(input.email, "i") })).toBeVisible();
27
- }
28
- export {
29
- createUserViaUi
30
- };
31
- //# sourceMappingURL=authUi.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/helpers/authUi.ts"],
4
- "sourcesContent": ["import { expect, type Page } from '@playwright/test';\n\nexport async function createUserViaUi(page: Page, input: { email: string; password: string; role?: string }) {\n const role = input.role ?? 'employee';\n\n await page.goto('/backend/users/create');\n await expect(page.getByText('Create User')).toBeVisible();\n\n await page.getByRole('textbox').nth(0).fill(input.email);\n await page.getByRole('textbox').nth(1).fill(input.password);\n\n const orgSelect = page.locator('main').locator('select').first();\n await expect(orgSelect).toBeEnabled();\n const orgValue = await orgSelect.evaluate((element) => {\n const select = element as HTMLSelectElement;\n for (const option of Array.from(select.options)) {\n if (option.value && option.value.trim().length > 0) return option.value;\n }\n return '';\n });\n if (orgValue) {\n await orgSelect.selectOption(orgValue);\n }\n\n const rolesInput = page.getByRole('textbox', { name: /add tag and press enter/i });\n await rolesInput.fill(role);\n await rolesInput.press('Enter');\n\n await page.getByRole('button', { name: 'Create' }).first().click();\n await expect(page).toHaveURL(/\\/backend\\/users(?:\\?.*)?$/);\n await page.getByRole('textbox', { name: 'Search' }).fill(input.email);\n await expect(page.getByRole('row', { name: new RegExp(input.email, 'i') })).toBeVisible();\n}\n"],
5
- "mappings": "AAAA,SAAS,cAAyB;AAElC,eAAsB,gBAAgB,MAAY,OAA2D;AAC3G,QAAM,OAAO,MAAM,QAAQ;AAE3B,QAAM,KAAK,KAAK,uBAAuB;AACvC,QAAM,OAAO,KAAK,UAAU,aAAa,CAAC,EAAE,YAAY;AAExD,QAAM,KAAK,UAAU,SAAS,EAAE,IAAI,CAAC,EAAE,KAAK,MAAM,KAAK;AACvD,QAAM,KAAK,UAAU,SAAS,EAAE,IAAI,CAAC,EAAE,KAAK,MAAM,QAAQ;AAE1D,QAAM,YAAY,KAAK,QAAQ,MAAM,EAAE,QAAQ,QAAQ,EAAE,MAAM;AAC/D,QAAM,OAAO,SAAS,EAAE,YAAY;AACpC,QAAM,WAAW,MAAM,UAAU,SAAS,CAAC,YAAY;AACrD,UAAM,SAAS;AACf,eAAW,UAAU,MAAM,KAAK,OAAO,OAAO,GAAG;AAC/C,UAAI,OAAO,SAAS,OAAO,MAAM,KAAK,EAAE,SAAS,EAAG,QAAO,OAAO;AAAA,IACpE;AACA,WAAO;AAAA,EACT,CAAC;AACD,MAAI,UAAU;AACZ,UAAM,UAAU,aAAa,QAAQ;AAAA,EACvC;AAEA,QAAM,aAAa,KAAK,UAAU,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACjF,QAAM,WAAW,KAAK,IAAI;AAC1B,QAAM,WAAW,MAAM,OAAO;AAE9B,QAAM,KAAK,UAAU,UAAU,EAAE,MAAM,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM;AACjE,QAAM,OAAO,IAAI,EAAE,UAAU,4BAA4B;AACzD,QAAM,KAAK,UAAU,WAAW,EAAE,MAAM,SAAS,CAAC,EAAE,KAAK,MAAM,KAAK;AACpE,QAAM,OAAO,KAAK,UAAU,OAAO,EAAE,MAAM,IAAI,OAAO,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC,EAAE,YAAY;AAC1F;",
6
- "names": []
7
- }
@@ -1,49 +0,0 @@
1
- import { expect } from "@playwright/test";
2
- import { apiRequest } from "./api.js";
3
- async function createProductFixture(request, token, input) {
4
- const response = await apiRequest(request, "POST", "/api/catalog/products", {
5
- token,
6
- data: {
7
- title: input.title,
8
- sku: input.sku,
9
- description: "Long enough description for SEO checks in QA automation flows. This text keeps the create validation satisfied."
10
- }
11
- });
12
- expect(response.ok(), `Failed to create product fixture: ${response.status()}`).toBeTruthy();
13
- const body = await response.json();
14
- expect(typeof body.id === "string" && body.id.length > 0).toBeTruthy();
15
- return body.id;
16
- }
17
- async function createCategoryFixture(request, token, input) {
18
- const response = await apiRequest(request, "POST", "/api/catalog/categories", {
19
- token,
20
- data: { name: input.name }
21
- });
22
- expect(response.ok(), `Failed to create category fixture: ${response.status()}`).toBeTruthy();
23
- const body = await response.json();
24
- expect(typeof body.id === "string" && body.id.length > 0).toBeTruthy();
25
- return body.id;
26
- }
27
- async function deleteCatalogCategoryIfExists(request, token, categoryId) {
28
- if (!token || !categoryId) return;
29
- try {
30
- await apiRequest(request, "DELETE", `/api/catalog/categories?id=${encodeURIComponent(categoryId)}`, { token });
31
- } catch {
32
- return;
33
- }
34
- }
35
- async function deleteCatalogProductIfExists(request, token, productId) {
36
- if (!token || !productId) return;
37
- try {
38
- await apiRequest(request, "DELETE", `/api/catalog/products?id=${encodeURIComponent(productId)}`, { token });
39
- } catch {
40
- return;
41
- }
42
- }
43
- export {
44
- createCategoryFixture,
45
- createProductFixture,
46
- deleteCatalogCategoryIfExists,
47
- deleteCatalogProductIfExists
48
- };
49
- //# sourceMappingURL=catalogFixtures.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/helpers/catalogFixtures.ts"],
4
- "sourcesContent": ["import { expect, type APIRequestContext } from '@playwright/test';\nimport { apiRequest } from './api';\n\ntype ProductFixtureInput = {\n title: string;\n sku: string;\n};\n\nexport async function createProductFixture(\n request: APIRequestContext,\n token: string,\n input: ProductFixtureInput,\n): Promise<string> {\n const response = await apiRequest(request, 'POST', '/api/catalog/products', {\n token,\n data: {\n title: input.title,\n sku: input.sku,\n description:\n 'Long enough description for SEO checks in QA automation flows. This text keeps the create validation satisfied.',\n },\n });\n expect(response.ok(), `Failed to create product fixture: ${response.status()}`).toBeTruthy();\n const body = (await response.json()) as { id?: string };\n expect(typeof body.id === 'string' && body.id.length > 0).toBeTruthy();\n return body.id as string;\n}\n\ntype CategoryFixtureInput = {\n name: string;\n};\n\nexport async function createCategoryFixture(\n request: APIRequestContext,\n token: string,\n input: CategoryFixtureInput,\n): Promise<string> {\n const response = await apiRequest(request, 'POST', '/api/catalog/categories', {\n token,\n data: { name: input.name },\n });\n expect(response.ok(), `Failed to create category fixture: ${response.status()}`).toBeTruthy();\n const body = (await response.json()) as { id?: string };\n expect(typeof body.id === 'string' && body.id.length > 0).toBeTruthy();\n return body.id as string;\n}\n\nexport async function deleteCatalogCategoryIfExists(\n request: APIRequestContext,\n token: string | null,\n categoryId: string | null,\n): Promise<void> {\n if (!token || !categoryId) return;\n try {\n await apiRequest(request, 'DELETE', `/api/catalog/categories?id=${encodeURIComponent(categoryId)}`, { token });\n } catch {\n return;\n }\n}\n\nexport async function deleteCatalogProductIfExists(\n request: APIRequestContext,\n token: string | null,\n productId: string | null,\n): Promise<void> {\n if (!token || !productId) return;\n try {\n await apiRequest(request, 'DELETE', `/api/catalog/products?id=${encodeURIComponent(productId)}`, { token });\n } catch {\n return;\n }\n}\n\n"],
5
- "mappings": "AAAA,SAAS,cAAsC;AAC/C,SAAS,kBAAkB;AAO3B,eAAsB,qBACpB,SACA,OACA,OACiB;AACjB,QAAM,WAAW,MAAM,WAAW,SAAS,QAAQ,yBAAyB;AAAA,IAC1E;AAAA,IACA,MAAM;AAAA,MACJ,OAAO,MAAM;AAAA,MACb,KAAK,MAAM;AAAA,MACX,aACE;AAAA,IACJ;AAAA,EACF,CAAC;AACD,SAAO,SAAS,GAAG,GAAG,qCAAqC,SAAS,OAAO,CAAC,EAAE,EAAE,WAAW;AAC3F,QAAM,OAAQ,MAAM,SAAS,KAAK;AAClC,SAAO,OAAO,KAAK,OAAO,YAAY,KAAK,GAAG,SAAS,CAAC,EAAE,WAAW;AACrE,SAAO,KAAK;AACd;AAMA,eAAsB,sBACpB,SACA,OACA,OACiB;AACjB,QAAM,WAAW,MAAM,WAAW,SAAS,QAAQ,2BAA2B;AAAA,IAC5E;AAAA,IACA,MAAM,EAAE,MAAM,MAAM,KAAK;AAAA,EAC3B,CAAC;AACD,SAAO,SAAS,GAAG,GAAG,sCAAsC,SAAS,OAAO,CAAC,EAAE,EAAE,WAAW;AAC5F,QAAM,OAAQ,MAAM,SAAS,KAAK;AAClC,SAAO,OAAO,KAAK,OAAO,YAAY,KAAK,GAAG,SAAS,CAAC,EAAE,WAAW;AACrE,SAAO,KAAK;AACd;AAEA,eAAsB,8BACpB,SACA,OACA,YACe;AACf,MAAI,CAAC,SAAS,CAAC,WAAY;AAC3B,MAAI;AACF,UAAM,WAAW,SAAS,UAAU,8BAA8B,mBAAmB,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC;AAAA,EAC/G,QAAQ;AACN;AAAA,EACF;AACF;AAEA,eAAsB,6BACpB,SACA,OACA,WACe;AACf,MAAI,CAAC,SAAS,CAAC,UAAW;AAC1B,MAAI;AACF,UAAM,WAAW,SAAS,UAAU,4BAA4B,mBAAmB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;AAAA,EAC5G,QAAQ;AACN;AAAA,EACF;AACF;",
6
- "names": []
7
- }
@@ -1,73 +0,0 @@
1
- import { expect } from "@playwright/test";
2
- import { apiRequest } from "./api.js";
3
- async function readJsonSafe(response) {
4
- const raw = await response.text();
5
- if (!raw) return null;
6
- try {
7
- return JSON.parse(raw);
8
- } catch {
9
- return null;
10
- }
11
- }
12
- function isRecord(value) {
13
- return typeof value === "object" && value !== null;
14
- }
15
- function findStringByKeys(value, keys) {
16
- if (!isRecord(value)) return null;
17
- for (const key of keys) {
18
- const candidate = value[key];
19
- if (typeof candidate === "string" && candidate.trim().length > 0) {
20
- return candidate.trim();
21
- }
22
- }
23
- for (const nested of Object.values(value)) {
24
- if (Array.isArray(nested)) continue;
25
- const found = findStringByKeys(nested, keys);
26
- if (found) return found;
27
- }
28
- return null;
29
- }
30
- async function createEntity(request, token, path, data, idKeys) {
31
- const response = await apiRequest(request, "POST", path, { token, data });
32
- const payload = await readJsonSafe(response);
33
- expect(response.ok(), `Failed POST ${path}: ${response.status()}`).toBeTruthy();
34
- const id = findStringByKeys(payload, idKeys);
35
- expect(id, `No id in ${path} response`).toBeTruthy();
36
- return id;
37
- }
38
- async function createCompanyFixture(request, token, displayName) {
39
- return createEntity(request, token, "/api/customers/companies", { displayName }, ["id", "entityId", "companyId"]);
40
- }
41
- async function createPersonFixture(request, token, input) {
42
- const data = {
43
- firstName: input.firstName,
44
- lastName: input.lastName,
45
- displayName: input.displayName
46
- };
47
- if (input.companyEntityId) {
48
- data.companyEntityId = input.companyEntityId;
49
- }
50
- return createEntity(request, token, "/api/customers/people", data, ["id", "entityId", "personId"]);
51
- }
52
- async function createDealFixture(request, token, input) {
53
- const data = { title: input.title };
54
- if (input.companyIds?.length) data.companyIds = input.companyIds;
55
- if (input.personIds?.length) data.personIds = input.personIds;
56
- return createEntity(request, token, "/api/customers/deals", data, ["dealId", "id", "entityId"]);
57
- }
58
- async function deleteEntityIfExists(request, token, path, id) {
59
- if (!token || !id) return;
60
- try {
61
- await apiRequest(request, "DELETE", `${path}?id=${encodeURIComponent(id)}`, { token });
62
- } catch {
63
- return;
64
- }
65
- }
66
- export {
67
- createCompanyFixture,
68
- createDealFixture,
69
- createPersonFixture,
70
- deleteEntityIfExists,
71
- readJsonSafe
72
- };
73
- //# sourceMappingURL=crmFixtures.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/helpers/crmFixtures.ts"],
4
- "sourcesContent": ["import { expect, type APIRequestContext, type APIResponse } from '@playwright/test';\nimport { apiRequest } from './api';\n\ntype JsonRecord = Record<string, unknown>;\n\nexport async function readJsonSafe<T = unknown>(response: APIResponse): Promise<T | null> {\n const raw = await response.text();\n if (!raw) return null;\n try {\n return JSON.parse(raw) as T;\n } catch {\n return null;\n }\n}\n\nfunction isRecord(value: unknown): value is JsonRecord {\n return typeof value === 'object' && value !== null;\n}\n\nfunction findStringByKeys(value: unknown, keys: readonly string[]): string | null {\n if (!isRecord(value)) return null;\n\n for (const key of keys) {\n const candidate = value[key];\n if (typeof candidate === 'string' && candidate.trim().length > 0) {\n return candidate.trim();\n }\n }\n\n for (const nested of Object.values(value)) {\n if (Array.isArray(nested)) continue;\n const found = findStringByKeys(nested, keys);\n if (found) return found;\n }\n\n return null;\n}\n\nasync function createEntity(\n request: APIRequestContext,\n token: string,\n path: string,\n data: Record<string, unknown>,\n idKeys: readonly string[],\n): Promise<string> {\n const response = await apiRequest(request, 'POST', path, { token, data });\n const payload = await readJsonSafe(response);\n expect(response.ok(), `Failed POST ${path}: ${response.status()}`).toBeTruthy();\n const id = findStringByKeys(payload, idKeys);\n expect(id, `No id in ${path} response`).toBeTruthy();\n return id as string;\n}\n\nexport async function createCompanyFixture(\n request: APIRequestContext,\n token: string,\n displayName: string,\n): Promise<string> {\n return createEntity(request, token, '/api/customers/companies', { displayName }, ['id', 'entityId', 'companyId']);\n}\n\nexport async function createPersonFixture(\n request: APIRequestContext,\n token: string,\n input: { firstName: string; lastName: string; displayName: string; companyEntityId?: string },\n): Promise<string> {\n const data: Record<string, unknown> = {\n firstName: input.firstName,\n lastName: input.lastName,\n displayName: input.displayName,\n };\n if (input.companyEntityId) {\n data.companyEntityId = input.companyEntityId;\n }\n return createEntity(request, token, '/api/customers/people', data, ['id', 'entityId', 'personId']);\n}\n\nexport async function createDealFixture(\n request: APIRequestContext,\n token: string,\n input: { title: string; companyIds?: string[]; personIds?: string[] },\n): Promise<string> {\n const data: Record<string, unknown> = { title: input.title };\n if (input.companyIds?.length) data.companyIds = input.companyIds;\n if (input.personIds?.length) data.personIds = input.personIds;\n return createEntity(request, token, '/api/customers/deals', data, ['dealId', 'id', 'entityId']);\n}\n\nexport async function deleteEntityIfExists(\n request: APIRequestContext,\n token: string | null,\n path: string,\n id: string | null,\n): Promise<void> {\n if (!token || !id) return;\n try {\n await apiRequest(request, 'DELETE', `${path}?id=${encodeURIComponent(id)}`, { token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pB,SACA,OACA,OACiB;AACjB,QAAM,OAAgC;AAAA,IACpC,WAAW,MAAM;AAAA,IACjB,UAAU,MAAM;AAAA,IAChB,aAAa,MAAM;AAAA,EACrB;AACA,MAAI,MAAM,iBAAiB;AACzB,SAAK,kBAAkB,MAAM;AAAA,EAC/B;AACA,SAAO,aAAa,SAAS,OAAO,yBAAyB,MAAM,CAAC,MAAM,YAAY,UAAU,CAAC;AACnG;AAEA,eAAsB,kBACpB,SACA,OACA,OACiB;AACjB,QAAM,OAAgC,EAAE,OAAO,MAAM,MAAM;AAC3D,MAAI,MAAM,YAAY,OAAQ,MAAK,aAAa,MAAM;AACtD,MAAI,MAAM,WAAW,OAAQ,MAAK,YAAY,MAAM;AACpD,SAAO,aAAa,SAAS,OAAO,wBAAwB,MAAM,CAAC,UAAU,MAAM,UAAU,CAAC;AAChG;AAEA,eAAsB,qBACpB,SACA,OACA,MACA,IACe;AACf,MAAI,CAAC,SAAS,CAAC,GAAI;AACnB,MAAI;AACF,UAAM,WAAW,SAAS,UAAU,GAAG,IAAI,OAAO,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;AAAA,EACvF,QAAQ;AACN;AAAA,EACF;AACF;",
6
- "names": []
7
- }
@@ -1,63 +0,0 @@
1
- import { expect } from "@playwright/test";
2
- import { apiRequest } from "./api.js";
3
- function readId(payload, keys) {
4
- if (!payload || typeof payload !== "object") return null;
5
- const map = payload;
6
- for (const key of keys) {
7
- const value = map[key];
8
- if (typeof value === "string" && value.length > 0) return value;
9
- }
10
- for (const value of Object.values(map)) {
11
- if (value && typeof value === "object" && !Array.isArray(value)) {
12
- const nested = readId(value, keys);
13
- if (nested) return nested;
14
- }
15
- }
16
- return null;
17
- }
18
- async function createEntity(request, token, path, data, idKeys) {
19
- const response = await apiRequest(request, "POST", path, { token, data });
20
- const body = await response.json();
21
- expect(response.ok(), `Failed POST ${path}: ${response.status()}`).toBeTruthy();
22
- const id = readId(body, idKeys);
23
- expect(id, `No id in POST ${path} response`).toBeTruthy();
24
- return id;
25
- }
26
- async function createSalesQuoteFixture(request, token, currencyCode = "USD") {
27
- return createEntity(request, token, "/api/sales/quotes", { currencyCode }, ["id", "quoteId"]);
28
- }
29
- async function createSalesOrderFixture(request, token, currencyCode = "USD") {
30
- return createEntity(request, token, "/api/sales/orders", { currencyCode }, ["id", "orderId"]);
31
- }
32
- async function createOrderLineFixture(request, token, orderId, data) {
33
- return createEntity(
34
- request,
35
- token,
36
- "/api/sales/order-lines",
37
- {
38
- orderId,
39
- currencyCode: "USD",
40
- quantity: 1,
41
- name: `QA line ${Date.now()}`,
42
- unitPriceNet: 10,
43
- unitPriceGross: 12,
44
- ...data ?? {}
45
- },
46
- ["id", "lineId"]
47
- );
48
- }
49
- async function deleteSalesEntityIfExists(request, token, path, id) {
50
- if (!token || !id) return;
51
- try {
52
- await apiRequest(request, "DELETE", `${path}?id=${encodeURIComponent(id)}`, { token });
53
- } catch {
54
- return;
55
- }
56
- }
57
- export {
58
- createOrderLineFixture,
59
- createSalesOrderFixture,
60
- createSalesQuoteFixture,
61
- deleteSalesEntityIfExists
62
- };
63
- //# sourceMappingURL=salesFixtures.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/modules/core/__integration__/helpers/salesFixtures.ts"],
4
- "sourcesContent": ["import { expect, type APIRequestContext } from '@playwright/test';\nimport { apiRequest } from './api';\n\ntype JsonMap = Record<string, unknown>;\n\nfunction readId(payload: unknown, keys: string[]): string | null {\n if (!payload || typeof payload !== 'object') return null;\n const map = payload as JsonMap;\n for (const key of keys) {\n const value = map[key];\n if (typeof value === 'string' && value.length > 0) return value;\n }\n for (const value of Object.values(map)) {\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n const nested = readId(value, keys);\n if (nested) return nested;\n }\n }\n return null;\n}\n\nasync function createEntity(\n request: APIRequestContext,\n token: string,\n path: string,\n data: Record<string, unknown>,\n idKeys: string[],\n): Promise<string> {\n const response = await apiRequest(request, 'POST', path, { token, data });\n const body = (await response.json()) as unknown;\n expect(response.ok(), `Failed POST ${path}: ${response.status()}`).toBeTruthy();\n const id = readId(body, idKeys);\n expect(id, `No id in POST ${path} response`).toBeTruthy();\n return id as string;\n}\n\nexport async function createSalesQuoteFixture(\n request: APIRequestContext,\n token: string,\n currencyCode = 'USD',\n): Promise<string> {\n return createEntity(request, token, '/api/sales/quotes', { currencyCode }, ['id', 'quoteId']);\n}\n\nexport async function createSalesOrderFixture(\n request: APIRequestContext,\n token: string,\n currencyCode = 'USD',\n): Promise<string> {\n return createEntity(request, token, '/api/sales/orders', { currencyCode }, ['id', 'orderId']);\n}\n\nexport async function createOrderLineFixture(\n request: APIRequestContext,\n token: string,\n orderId: string,\n data?: Record<string, unknown>,\n): Promise<string> {\n return createEntity(\n request,\n token,\n '/api/sales/order-lines',\n {\n orderId,\n currencyCode: 'USD',\n quantity: 1,\n name: `QA line ${Date.now()}`,\n unitPriceNet: 10,\n unitPriceGross: 12,\n ...(data ?? {}),\n },\n ['id', 'lineId'],\n );\n}\n\nexport async function deleteSalesEntityIfExists(\n request: APIRequestContext,\n token: string | null,\n path: string,\n id: string | null,\n): Promise<void> {\n if (!token || !id) return;\n try {\n await apiRequest(request, 'DELETE', `${path}?id=${encodeURIComponent(id)}`, { token });\n } catch {\n return;\n }\n}\n\n"],
5
- "mappings": "AAAA,SAAS,cAAsC;AAC/C,SAAS,kBAAkB;AAI3B,SAAS,OAAO,SAAkB,MAA+B;AAC/D,MAAI,CAAC,WAAW,OAAO,YAAY,SAAU,QAAO;AACpD,QAAM,MAAM;AACZ,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,IAAI,GAAG;AACrB,QAAI,OAAO,UAAU,YAAY,MAAM,SAAS,EAAG,QAAO;AAAA,EAC5D;AACA,aAAW,SAAS,OAAO,OAAO,GAAG,GAAG;AACtC,QAAI,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC/D,YAAM,SAAS,OA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