@open-mercato/core 0.6.6-develop.6094.1.28b081ea16 → 0.6.6-develop.6121.1.5797a901b3

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 (317) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/generated/entities/catalog_product/index.js +52 -0
  3. package/dist/generated/entities/catalog_product/index.js.map +2 -2
  4. package/dist/generated/entities/catalog_product_variant/index.js +4 -0
  5. package/dist/generated/entities/catalog_product_variant/index.js.map +2 -2
  6. package/dist/generated/entity-fields-registry.js +28 -0
  7. package/dist/generated/entity-fields-registry.js.map +2 -2
  8. package/dist/modules/catalog/api/products/route.js +103 -33
  9. package/dist/modules/catalog/api/products/route.js.map +2 -2
  10. package/dist/modules/catalog/api/variants/route.js +4 -0
  11. package/dist/modules/catalog/api/variants/route.js.map +2 -2
  12. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +46 -2
  13. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  14. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +4 -0
  15. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
  16. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js +2 -0
  17. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js.map +2 -2
  18. package/dist/modules/catalog/backend/catalog/products/create/page.js +42 -2
  19. package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
  20. package/dist/modules/catalog/commands/products.js +251 -14
  21. package/dist/modules/catalog/commands/products.js.map +2 -2
  22. package/dist/modules/catalog/commands/variants.js +72 -1
  23. package/dist/modules/catalog/commands/variants.js.map +2 -2
  24. package/dist/modules/catalog/components/products/ProductComplianceSection.js +500 -0
  25. package/dist/modules/catalog/components/products/ProductComplianceSection.js.map +7 -0
  26. package/dist/modules/catalog/components/products/VariantBuilder.js +39 -1
  27. package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
  28. package/dist/modules/catalog/components/products/productForm.js +164 -2
  29. package/dist/modules/catalog/components/products/productForm.js.map +2 -2
  30. package/dist/modules/catalog/components/products/variantForm.js +2 -0
  31. package/dist/modules/catalog/components/products/variantForm.js.map +2 -2
  32. package/dist/modules/catalog/data/entities.js +93 -0
  33. package/dist/modules/catalog/data/entities.js.map +2 -2
  34. package/dist/modules/catalog/data/types.js +28 -0
  35. package/dist/modules/catalog/data/types.js.map +2 -2
  36. package/dist/modules/catalog/data/validators.js +100 -5
  37. package/dist/modules/catalog/data/validators.js.map +2 -2
  38. package/dist/modules/catalog/lib/gtin.js +61 -0
  39. package/dist/modules/catalog/lib/gtin.js.map +7 -0
  40. package/dist/modules/catalog/migrations/Migration20260611090000.js +17 -0
  41. package/dist/modules/catalog/migrations/Migration20260611090000.js.map +7 -0
  42. package/dist/modules/catalog/translations.js +1 -1
  43. package/dist/modules/catalog/translations.js.map +2 -2
  44. package/dist/modules/configs/api/cache/route.js +60 -10
  45. package/dist/modules/configs/api/cache/route.js.map +3 -3
  46. package/dist/modules/configs/components/CachePanel.js +52 -29
  47. package/dist/modules/configs/components/CachePanel.js.map +2 -2
  48. package/dist/modules/currencies/api/currencies/options/route.js +18 -4
  49. package/dist/modules/currencies/api/currencies/options/route.js.map +2 -2
  50. package/dist/modules/currencies/services/rateFetchingService.js +35 -18
  51. package/dist/modules/currencies/services/rateFetchingService.js.map +2 -2
  52. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +16 -16
  53. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
  54. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +1 -1
  55. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
  56. package/dist/modules/customers/backend/calendar/page.js +10 -0
  57. package/dist/modules/customers/backend/calendar/page.js.map +7 -0
  58. package/dist/modules/customers/backend/calendar/page.meta.js +25 -0
  59. package/dist/modules/customers/backend/calendar/page.meta.js.map +7 -0
  60. package/dist/modules/customers/cli.js +1 -0
  61. package/dist/modules/customers/cli.js.map +2 -2
  62. package/dist/modules/customers/components/calendar/AgendaList.js +182 -0
  63. package/dist/modules/customers/components/calendar/AgendaList.js.map +7 -0
  64. package/dist/modules/customers/components/calendar/CalendarEventEditor.js +331 -0
  65. package/dist/modules/customers/components/calendar/CalendarEventEditor.js.map +7 -0
  66. package/dist/modules/customers/components/calendar/CalendarFooter.js +48 -0
  67. package/dist/modules/customers/components/calendar/CalendarFooter.js.map +7 -0
  68. package/dist/modules/customers/components/calendar/CalendarHeader.js +36 -0
  69. package/dist/modules/customers/components/calendar/CalendarHeader.js.map +7 -0
  70. package/dist/modules/customers/components/calendar/CalendarScreen.js +516 -0
  71. package/dist/modules/customers/components/calendar/CalendarScreen.js.map +7 -0
  72. package/dist/modules/customers/components/calendar/CalendarSettingsModal.js +163 -0
  73. package/dist/modules/customers/components/calendar/CalendarSettingsModal.js.map +7 -0
  74. package/dist/modules/customers/components/calendar/CalendarTabs.js +60 -0
  75. package/dist/modules/customers/components/calendar/CalendarTabs.js.map +7 -0
  76. package/dist/modules/customers/components/calendar/CalendarToolbar.js +262 -0
  77. package/dist/modules/customers/components/calendar/CalendarToolbar.js.map +7 -0
  78. package/dist/modules/customers/components/calendar/EventBlock.js +149 -0
  79. package/dist/modules/customers/components/calendar/EventBlock.js.map +7 -0
  80. package/dist/modules/customers/components/calendar/EventPeekPopover.js +72 -0
  81. package/dist/modules/customers/components/calendar/EventPeekPopover.js.map +7 -0
  82. package/dist/modules/customers/components/calendar/MonthGrid.js +214 -0
  83. package/dist/modules/customers/components/calendar/MonthGrid.js.map +7 -0
  84. package/dist/modules/customers/components/calendar/ShortcutsDialog.js +44 -0
  85. package/dist/modules/customers/components/calendar/ShortcutsDialog.js.map +7 -0
  86. package/dist/modules/customers/components/calendar/TimeGrid.js +410 -0
  87. package/dist/modules/customers/components/calendar/TimeGrid.js.map +7 -0
  88. package/dist/modules/customers/components/calendar/UpcomingCards.js +175 -0
  89. package/dist/modules/customers/components/calendar/UpcomingCards.js.map +7 -0
  90. package/dist/modules/customers/components/calendar/editor/CategoryField.js +75 -0
  91. package/dist/modules/customers/components/calendar/editor/CategoryField.js.map +7 -0
  92. package/dist/modules/customers/components/calendar/editor/LocationField.js +30 -0
  93. package/dist/modules/customers/components/calendar/editor/LocationField.js.map +7 -0
  94. package/dist/modules/customers/components/calendar/editor/PeopleField.js +135 -0
  95. package/dist/modules/customers/components/calendar/editor/PeopleField.js.map +7 -0
  96. package/dist/modules/customers/components/calendar/editor/RelatedToField.js +218 -0
  97. package/dist/modules/customers/components/calendar/editor/RelatedToField.js.map +7 -0
  98. package/dist/modules/customers/components/calendar/editor/RepeatField.js +119 -0
  99. package/dist/modules/customers/components/calendar/editor/RepeatField.js.map +7 -0
  100. package/dist/modules/customers/components/calendar/editor/ScheduleSection.js +83 -0
  101. package/dist/modules/customers/components/calendar/editor/ScheduleSection.js.map +7 -0
  102. package/dist/modules/customers/components/calendar/editor/SegmentGroup.js +44 -0
  103. package/dist/modules/customers/components/calendar/editor/SegmentGroup.js.map +7 -0
  104. package/dist/modules/customers/components/calendar/editor/hooks.js +132 -0
  105. package/dist/modules/customers/components/calendar/editor/hooks.js.map +7 -0
  106. package/dist/modules/customers/components/calendar/editor/inputs.js +160 -0
  107. package/dist/modules/customers/components/calendar/editor/inputs.js.map +7 -0
  108. package/dist/modules/customers/components/calendar/editor/lookups.js +107 -0
  109. package/dist/modules/customers/components/calendar/editor/lookups.js.map +7 -0
  110. package/dist/modules/customers/components/calendar/types.js +30 -0
  111. package/dist/modules/customers/components/calendar/types.js.map +7 -0
  112. package/dist/modules/customers/components/calendar/useCalendarItems.js +131 -0
  113. package/dist/modules/customers/components/calendar/useCalendarItems.js.map +7 -0
  114. package/dist/modules/customers/components/calendar/useCalendarPreferences.js +41 -0
  115. package/dist/modules/customers/components/calendar/useCalendarPreferences.js.map +7 -0
  116. package/dist/modules/customers/lib/calendar/categories.js +28 -0
  117. package/dist/modules/customers/lib/calendar/categories.js.map +7 -0
  118. package/dist/modules/customers/lib/calendar/conflicts.js +72 -0
  119. package/dist/modules/customers/lib/calendar/conflicts.js.map +7 -0
  120. package/dist/modules/customers/lib/calendar/editorPayload.js +271 -0
  121. package/dist/modules/customers/lib/calendar/editorPayload.js.map +7 -0
  122. package/dist/modules/customers/lib/calendar/grid.js +48 -0
  123. package/dist/modules/customers/lib/calendar/grid.js.map +7 -0
  124. package/dist/modules/customers/lib/calendar/layout.js +39 -0
  125. package/dist/modules/customers/lib/calendar/layout.js.map +7 -0
  126. package/dist/modules/customers/lib/calendar/mapItem.js +79 -0
  127. package/dist/modules/customers/lib/calendar/mapItem.js.map +7 -0
  128. package/dist/modules/customers/lib/calendar/preferences.js +71 -0
  129. package/dist/modules/customers/lib/calendar/preferences.js.map +7 -0
  130. package/dist/modules/customers/lib/calendar/range.js +46 -0
  131. package/dist/modules/customers/lib/calendar/range.js.map +7 -0
  132. package/dist/modules/customers/lib/calendar/recurrence.js +113 -0
  133. package/dist/modules/customers/lib/calendar/recurrence.js.map +7 -0
  134. package/dist/modules/dashboards/services/widgetDataService.js +5 -5
  135. package/dist/modules/dashboards/services/widgetDataService.js.map +2 -2
  136. package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js +61 -1
  137. package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js.map +2 -2
  138. package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +33 -1
  139. package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
  140. package/dist/modules/dictionaries/api/[dictionaryId]/route.js +61 -1
  141. package/dist/modules/dictionaries/api/[dictionaryId]/route.js.map +2 -2
  142. package/dist/modules/dictionaries/api/route.js +33 -1
  143. package/dist/modules/dictionaries/api/route.js.map +2 -2
  144. package/dist/modules/feature_toggles/lib/queries.js +36 -52
  145. package/dist/modules/feature_toggles/lib/queries.js.map +2 -2
  146. package/dist/modules/perspectives/api/[tableId]/[perspectiveId]/route.js +32 -1
  147. package/dist/modules/perspectives/api/[tableId]/[perspectiveId]/route.js.map +2 -2
  148. package/dist/modules/perspectives/api/[tableId]/roles/[roleId]/route.js +32 -1
  149. package/dist/modules/perspectives/api/[tableId]/roles/[roleId]/route.js.map +2 -2
  150. package/dist/modules/perspectives/api/[tableId]/route.js +73 -2
  151. package/dist/modules/perspectives/api/[tableId]/route.js.map +2 -2
  152. package/dist/modules/perspectives/services/perspectiveService.js +5 -3
  153. package/dist/modules/perspectives/services/perspectiveService.js.map +2 -2
  154. package/dist/modules/planner/api/access.js +9 -0
  155. package/dist/modules/planner/api/access.js.map +2 -2
  156. package/dist/modules/planner/api/availability-date-specific.js +22 -1
  157. package/dist/modules/planner/api/availability-date-specific.js.map +2 -2
  158. package/dist/modules/planner/api/availability-weekly.js +22 -1
  159. package/dist/modules/planner/api/availability-weekly.js.map +2 -2
  160. package/dist/modules/resources/api/resources/tags/assign/route.js +39 -0
  161. package/dist/modules/resources/api/resources/tags/assign/route.js.map +2 -2
  162. package/dist/modules/resources/api/resources/tags/unassign/route.js +39 -0
  163. package/dist/modules/resources/api/resources/tags/unassign/route.js.map +2 -2
  164. package/dist/modules/sales/api/settings/document-numbers/route.js +33 -1
  165. package/dist/modules/sales/api/settings/document-numbers/route.js.map +2 -2
  166. package/dist/modules/sales/api/settings/order-editing/route.js +35 -3
  167. package/dist/modules/sales/api/settings/order-editing/route.js.map +2 -2
  168. package/dist/modules/staff/api/leave-requests/accept/route.js +41 -0
  169. package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
  170. package/dist/modules/staff/api/leave-requests/reject/route.js +41 -0
  171. package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
  172. package/dist/modules/staff/api/team-members/self/route.js +40 -0
  173. package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
  174. package/dist/modules/staff/api/team-members/tags/assign/route.js +41 -0
  175. package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
  176. package/dist/modules/staff/api/team-members/tags/unassign/route.js +41 -0
  177. package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
  178. package/dist/modules/translations/api/[entityType]/[entityId]/route.js +61 -1
  179. package/dist/modules/translations/api/[entityType]/[entityId]/route.js.map +2 -2
  180. package/dist/modules/translations/api/context.js +7 -0
  181. package/dist/modules/translations/api/context.js.map +2 -2
  182. package/dist/modules/translations/api/put/locales.js +33 -1
  183. package/dist/modules/translations/api/put/locales.js.map +2 -2
  184. package/dist/modules/workflows/backend/definitions/visual-editor/page.js +6 -7
  185. package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
  186. package/dist/modules/workflows/backend/instances/[id]/page.js.map +1 -1
  187. package/dist/modules/workflows/components/EdgeEditDialog.js.map +1 -1
  188. package/dist/modules/workflows/components/EdgeEditDialogCrudForm.js.map +1 -1
  189. package/dist/modules/workflows/components/NodeEditDialog.js.map +1 -1
  190. package/dist/modules/workflows/components/NodeEditDialogCrudForm.js.map +1 -1
  191. package/dist/modules/workflows/components/WorkflowGraph.js.map +1 -1
  192. package/dist/modules/workflows/components/WorkflowGraphImpl.js +17 -9
  193. package/dist/modules/workflows/components/WorkflowGraphImpl.js.map +2 -2
  194. package/dist/modules/workflows/components/mobile/MobileVisualEditor.js.map +1 -1
  195. package/dist/modules/workflows/frontend/checkout-demo/deriveCurrentStep.js +8 -0
  196. package/dist/modules/workflows/frontend/checkout-demo/deriveCurrentStep.js.map +7 -0
  197. package/dist/modules/workflows/frontend/checkout-demo/page.js +2 -20
  198. package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
  199. package/dist/modules/workflows/lib/graph-utils.js +8 -0
  200. package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
  201. package/generated/entities/catalog_product/index.ts +26 -0
  202. package/generated/entities/catalog_product_variant/index.ts +2 -0
  203. package/generated/entity-fields-registry.ts +28 -0
  204. package/package.json +7 -7
  205. package/src/modules/catalog/api/products/route.ts +123 -39
  206. package/src/modules/catalog/api/variants/route.ts +4 -0
  207. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +43 -0
  208. package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +14 -0
  209. package/src/modules/catalog/backend/catalog/products/[productId]/variants/create/page.tsx +2 -0
  210. package/src/modules/catalog/backend/catalog/products/create/page.tsx +41 -0
  211. package/src/modules/catalog/commands/products.ts +307 -2
  212. package/src/modules/catalog/commands/variants.ts +90 -1
  213. package/src/modules/catalog/components/products/ProductComplianceSection.tsx +497 -0
  214. package/src/modules/catalog/components/products/VariantBuilder.tsx +43 -0
  215. package/src/modules/catalog/components/products/productForm.ts +262 -0
  216. package/src/modules/catalog/components/products/variantForm.ts +4 -0
  217. package/src/modules/catalog/data/entities.ts +97 -0
  218. package/src/modules/catalog/data/types.ts +36 -0
  219. package/src/modules/catalog/data/validators.ts +159 -3
  220. package/src/modules/catalog/i18n/de.json +64 -0
  221. package/src/modules/catalog/i18n/en.json +64 -0
  222. package/src/modules/catalog/i18n/es.json +64 -0
  223. package/src/modules/catalog/i18n/pl.json +64 -0
  224. package/src/modules/catalog/lib/gtin.ts +66 -0
  225. package/src/modules/catalog/migrations/.snapshot-open-mercato.json +457 -0
  226. package/src/modules/catalog/migrations/Migration20260611090000.ts +17 -0
  227. package/src/modules/catalog/translations.ts +1 -1
  228. package/src/modules/configs/api/cache/route.ts +72 -10
  229. package/src/modules/configs/components/CachePanel.tsx +59 -29
  230. package/src/modules/currencies/api/currencies/options/route.ts +22 -4
  231. package/src/modules/currencies/services/rateFetchingService.ts +63 -26
  232. package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +18 -18
  233. package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +1 -1
  234. package/src/modules/customer_accounts/i18n/de.json +1 -1
  235. package/src/modules/customer_accounts/i18n/en.json +1 -1
  236. package/src/modules/customer_accounts/i18n/es.json +1 -1
  237. package/src/modules/customer_accounts/i18n/pl.json +1 -1
  238. package/src/modules/customers/backend/calendar/page.meta.ts +23 -0
  239. package/src/modules/customers/backend/calendar/page.tsx +12 -0
  240. package/src/modules/customers/cli.ts +1 -0
  241. package/src/modules/customers/components/calendar/AgendaList.tsx +219 -0
  242. package/src/modules/customers/components/calendar/CalendarEventEditor.tsx +386 -0
  243. package/src/modules/customers/components/calendar/CalendarFooter.tsx +61 -0
  244. package/src/modules/customers/components/calendar/CalendarHeader.tsx +40 -0
  245. package/src/modules/customers/components/calendar/CalendarScreen.tsx +590 -0
  246. package/src/modules/customers/components/calendar/CalendarSettingsModal.tsx +207 -0
  247. package/src/modules/customers/components/calendar/CalendarTabs.tsx +63 -0
  248. package/src/modules/customers/components/calendar/CalendarToolbar.tsx +295 -0
  249. package/src/modules/customers/components/calendar/EventBlock.tsx +205 -0
  250. package/src/modules/customers/components/calendar/EventPeekPopover.tsx +100 -0
  251. package/src/modules/customers/components/calendar/MonthGrid.tsx +236 -0
  252. package/src/modules/customers/components/calendar/ShortcutsDialog.tsx +57 -0
  253. package/src/modules/customers/components/calendar/TimeGrid.tsx +510 -0
  254. package/src/modules/customers/components/calendar/UpcomingCards.tsx +220 -0
  255. package/src/modules/customers/components/calendar/editor/CategoryField.tsx +79 -0
  256. package/src/modules/customers/components/calendar/editor/LocationField.tsx +37 -0
  257. package/src/modules/customers/components/calendar/editor/PeopleField.tsx +148 -0
  258. package/src/modules/customers/components/calendar/editor/RelatedToField.tsx +242 -0
  259. package/src/modules/customers/components/calendar/editor/RepeatField.tsx +132 -0
  260. package/src/modules/customers/components/calendar/editor/ScheduleSection.tsx +110 -0
  261. package/src/modules/customers/components/calendar/editor/SegmentGroup.tsx +50 -0
  262. package/src/modules/customers/components/calendar/editor/hooks.ts +162 -0
  263. package/src/modules/customers/components/calendar/editor/inputs.tsx +158 -0
  264. package/src/modules/customers/components/calendar/editor/lookups.ts +160 -0
  265. package/src/modules/customers/components/calendar/types.ts +163 -0
  266. package/src/modules/customers/components/calendar/useCalendarItems.ts +162 -0
  267. package/src/modules/customers/components/calendar/useCalendarPreferences.ts +52 -0
  268. package/src/modules/customers/i18n/de.json +195 -0
  269. package/src/modules/customers/i18n/en.json +195 -0
  270. package/src/modules/customers/i18n/es.json +195 -0
  271. package/src/modules/customers/i18n/pl.json +195 -0
  272. package/src/modules/customers/lib/calendar/categories.ts +26 -0
  273. package/src/modules/customers/lib/calendar/conflicts.ts +117 -0
  274. package/src/modules/customers/lib/calendar/editorPayload.ts +388 -0
  275. package/src/modules/customers/lib/calendar/grid.ts +50 -0
  276. package/src/modules/customers/lib/calendar/layout.ts +47 -0
  277. package/src/modules/customers/lib/calendar/mapItem.ts +94 -0
  278. package/src/modules/customers/lib/calendar/preferences.ts +95 -0
  279. package/src/modules/customers/lib/calendar/range.ts +45 -0
  280. package/src/modules/customers/lib/calendar/recurrence.ts +137 -0
  281. package/src/modules/dashboards/services/widgetDataService.ts +8 -6
  282. package/src/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.ts +61 -1
  283. package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +33 -1
  284. package/src/modules/dictionaries/api/[dictionaryId]/route.ts +65 -1
  285. package/src/modules/dictionaries/api/route.ts +36 -1
  286. package/src/modules/feature_toggles/lib/queries.ts +41 -60
  287. package/src/modules/perspectives/api/[tableId]/[perspectiveId]/route.ts +34 -1
  288. package/src/modules/perspectives/api/[tableId]/roles/[roleId]/route.ts +34 -1
  289. package/src/modules/perspectives/api/[tableId]/route.ts +107 -32
  290. package/src/modules/perspectives/services/perspectiveService.ts +9 -5
  291. package/src/modules/planner/api/access.ts +9 -0
  292. package/src/modules/planner/api/availability-date-specific.ts +22 -1
  293. package/src/modules/planner/api/availability-weekly.ts +22 -1
  294. package/src/modules/resources/api/resources/tags/assign/route.ts +42 -0
  295. package/src/modules/resources/api/resources/tags/unassign/route.ts +42 -0
  296. package/src/modules/sales/api/settings/document-numbers/route.ts +35 -1
  297. package/src/modules/sales/api/settings/order-editing/route.ts +37 -3
  298. package/src/modules/staff/api/leave-requests/accept/route.ts +45 -0
  299. package/src/modules/staff/api/leave-requests/reject/route.ts +45 -0
  300. package/src/modules/staff/api/team-members/self/route.ts +43 -0
  301. package/src/modules/staff/api/team-members/tags/assign/route.ts +45 -0
  302. package/src/modules/staff/api/team-members/tags/unassign/route.ts +45 -0
  303. package/src/modules/translations/api/[entityType]/[entityId]/route.ts +65 -1
  304. package/src/modules/translations/api/context.ts +7 -0
  305. package/src/modules/translations/api/put/locales.ts +35 -1
  306. package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +11 -9
  307. package/src/modules/workflows/backend/instances/[id]/page.tsx +1 -1
  308. package/src/modules/workflows/components/EdgeEditDialog.tsx +1 -1
  309. package/src/modules/workflows/components/EdgeEditDialogCrudForm.tsx +1 -1
  310. package/src/modules/workflows/components/NodeEditDialog.tsx +1 -1
  311. package/src/modules/workflows/components/NodeEditDialogCrudForm.tsx +1 -1
  312. package/src/modules/workflows/components/WorkflowGraph.tsx +2 -2
  313. package/src/modules/workflows/components/WorkflowGraphImpl.tsx +27 -13
  314. package/src/modules/workflows/components/mobile/MobileVisualEditor.tsx +3 -3
  315. package/src/modules/workflows/frontend/checkout-demo/deriveCurrentStep.ts +12 -0
  316. package/src/modules/workflows/frontend/checkout-demo/page.tsx +3 -23
  317. package/src/modules/workflows/lib/graph-utils.ts +21 -1
@@ -2701,6 +2701,38 @@
2701
2701
  "enumItems": [],
2702
2702
  "mappedType": "text"
2703
2703
  },
2704
+ "gtin_type": {
2705
+ "name": "gtin_type",
2706
+ "type": "text",
2707
+ "mappedType": "text",
2708
+ "unsigned": false,
2709
+ "autoincrement": false,
2710
+ "primary": false,
2711
+ "nullable": true,
2712
+ "length": null,
2713
+ "precision": null,
2714
+ "scale": null,
2715
+ "default": null,
2716
+ "unique": false,
2717
+ "enumItems": [],
2718
+ "comment": null
2719
+ },
2720
+ "hs_code": {
2721
+ "name": "hs_code",
2722
+ "type": "text",
2723
+ "mappedType": "text",
2724
+ "unsigned": false,
2725
+ "autoincrement": false,
2726
+ "primary": false,
2727
+ "nullable": true,
2728
+ "length": null,
2729
+ "precision": null,
2730
+ "scale": null,
2731
+ "default": null,
2732
+ "unique": false,
2733
+ "enumItems": [],
2734
+ "comment": null
2735
+ },
2704
2736
  "created_at": {
2705
2737
  "name": "created_at",
2706
2738
  "type": "timestamptz(6)",
@@ -3088,6 +3120,15 @@
3088
3120
  "keyName": "catalog_product_variants_sku_unique",
3089
3121
  "primary": false,
3090
3122
  "unique": true
3123
+ },
3124
+ {
3125
+ "keyName": "catalog_product_variants_gtin_scope_unique",
3126
+ "columnNames": [],
3127
+ "composite": false,
3128
+ "constraint": false,
3129
+ "primary": false,
3130
+ "unique": false,
3131
+ "expression": "create unique index \"catalog_product_variants_gtin_scope_unique\" on \"catalog_product_variants\" (\"tenant_id\", \"organization_id\", \"gtin_type\", \"barcode\") where deleted_at is null and gtin_type is not null and barcode is not null"
3091
3132
  }
3092
3133
  ],
3093
3134
  "checks": [],
@@ -3334,6 +3375,422 @@
3334
3375
  "enumItems": [],
3335
3376
  "mappedType": "boolean"
3336
3377
  },
3378
+ "country_of_origin_code": {
3379
+ "name": "country_of_origin_code",
3380
+ "type": "text",
3381
+ "mappedType": "text",
3382
+ "unsigned": false,
3383
+ "autoincrement": false,
3384
+ "primary": false,
3385
+ "nullable": true,
3386
+ "length": null,
3387
+ "precision": null,
3388
+ "scale": null,
3389
+ "default": null,
3390
+ "unique": false,
3391
+ "enumItems": [],
3392
+ "comment": null
3393
+ },
3394
+ "pkwiu_code": {
3395
+ "name": "pkwiu_code",
3396
+ "type": "text",
3397
+ "mappedType": "text",
3398
+ "unsigned": false,
3399
+ "autoincrement": false,
3400
+ "primary": false,
3401
+ "nullable": true,
3402
+ "length": null,
3403
+ "precision": null,
3404
+ "scale": null,
3405
+ "default": null,
3406
+ "unique": false,
3407
+ "enumItems": [],
3408
+ "comment": null
3409
+ },
3410
+ "cn_code": {
3411
+ "name": "cn_code",
3412
+ "type": "text",
3413
+ "mappedType": "text",
3414
+ "unsigned": false,
3415
+ "autoincrement": false,
3416
+ "primary": false,
3417
+ "nullable": true,
3418
+ "length": null,
3419
+ "precision": null,
3420
+ "scale": null,
3421
+ "default": null,
3422
+ "unique": false,
3423
+ "enumItems": [],
3424
+ "comment": null
3425
+ },
3426
+ "hs_code": {
3427
+ "name": "hs_code",
3428
+ "type": "text",
3429
+ "mappedType": "text",
3430
+ "unsigned": false,
3431
+ "autoincrement": false,
3432
+ "primary": false,
3433
+ "nullable": true,
3434
+ "length": null,
3435
+ "precision": null,
3436
+ "scale": null,
3437
+ "default": null,
3438
+ "unique": false,
3439
+ "enumItems": [],
3440
+ "comment": null
3441
+ },
3442
+ "tax_classification_code": {
3443
+ "name": "tax_classification_code",
3444
+ "type": "text",
3445
+ "mappedType": "text",
3446
+ "unsigned": false,
3447
+ "autoincrement": false,
3448
+ "primary": false,
3449
+ "nullable": true,
3450
+ "length": null,
3451
+ "precision": null,
3452
+ "scale": null,
3453
+ "default": null,
3454
+ "unique": false,
3455
+ "enumItems": [],
3456
+ "comment": null
3457
+ },
3458
+ "gtu_codes": {
3459
+ "name": "gtu_codes",
3460
+ "type": "text[]",
3461
+ "mappedType": "array",
3462
+ "unsigned": false,
3463
+ "autoincrement": false,
3464
+ "primary": false,
3465
+ "nullable": true,
3466
+ "length": null,
3467
+ "precision": null,
3468
+ "scale": null,
3469
+ "default": null,
3470
+ "unique": false,
3471
+ "enumItems": [],
3472
+ "comment": null
3473
+ },
3474
+ "age_min": {
3475
+ "name": "age_min",
3476
+ "type": "smallint",
3477
+ "mappedType": "smallint",
3478
+ "unsigned": false,
3479
+ "autoincrement": false,
3480
+ "primary": false,
3481
+ "nullable": true,
3482
+ "length": null,
3483
+ "precision": null,
3484
+ "scale": null,
3485
+ "default": null,
3486
+ "unique": false,
3487
+ "enumItems": [],
3488
+ "comment": null
3489
+ },
3490
+ "is_excise_good": {
3491
+ "name": "is_excise_good",
3492
+ "type": "boolean",
3493
+ "mappedType": "boolean",
3494
+ "unsigned": false,
3495
+ "autoincrement": false,
3496
+ "primary": false,
3497
+ "nullable": false,
3498
+ "length": null,
3499
+ "precision": null,
3500
+ "scale": null,
3501
+ "default": "false",
3502
+ "unique": false,
3503
+ "enumItems": [],
3504
+ "comment": null
3505
+ },
3506
+ "excise_category": {
3507
+ "name": "excise_category",
3508
+ "type": "text",
3509
+ "mappedType": "text",
3510
+ "unsigned": false,
3511
+ "autoincrement": false,
3512
+ "primary": false,
3513
+ "nullable": true,
3514
+ "length": null,
3515
+ "precision": null,
3516
+ "scale": null,
3517
+ "default": null,
3518
+ "unique": false,
3519
+ "enumItems": [],
3520
+ "comment": null
3521
+ },
3522
+ "requires_prescription": {
3523
+ "name": "requires_prescription",
3524
+ "type": "boolean",
3525
+ "mappedType": "boolean",
3526
+ "unsigned": false,
3527
+ "autoincrement": false,
3528
+ "primary": false,
3529
+ "nullable": false,
3530
+ "length": null,
3531
+ "precision": null,
3532
+ "scale": null,
3533
+ "default": "false",
3534
+ "unique": false,
3535
+ "enumItems": [],
3536
+ "comment": null
3537
+ },
3538
+ "hazmat_class": {
3539
+ "name": "hazmat_class",
3540
+ "type": "text",
3541
+ "mappedType": "text",
3542
+ "unsigned": false,
3543
+ "autoincrement": false,
3544
+ "primary": false,
3545
+ "nullable": true,
3546
+ "length": null,
3547
+ "precision": null,
3548
+ "scale": null,
3549
+ "default": null,
3550
+ "unique": false,
3551
+ "enumItems": [],
3552
+ "comment": null
3553
+ },
3554
+ "un_number": {
3555
+ "name": "un_number",
3556
+ "type": "text",
3557
+ "mappedType": "text",
3558
+ "unsigned": false,
3559
+ "autoincrement": false,
3560
+ "primary": false,
3561
+ "nullable": true,
3562
+ "length": null,
3563
+ "precision": null,
3564
+ "scale": null,
3565
+ "default": null,
3566
+ "unique": false,
3567
+ "enumItems": [],
3568
+ "comment": null
3569
+ },
3570
+ "hazmat_packing_group": {
3571
+ "name": "hazmat_packing_group",
3572
+ "type": "text",
3573
+ "mappedType": "text",
3574
+ "unsigned": false,
3575
+ "autoincrement": false,
3576
+ "primary": false,
3577
+ "nullable": true,
3578
+ "length": null,
3579
+ "precision": null,
3580
+ "scale": null,
3581
+ "default": null,
3582
+ "unique": false,
3583
+ "enumItems": [],
3584
+ "comment": null
3585
+ },
3586
+ "contains_lithium_battery": {
3587
+ "name": "contains_lithium_battery",
3588
+ "type": "boolean",
3589
+ "mappedType": "boolean",
3590
+ "unsigned": false,
3591
+ "autoincrement": false,
3592
+ "primary": false,
3593
+ "nullable": false,
3594
+ "length": null,
3595
+ "precision": null,
3596
+ "scale": null,
3597
+ "default": "false",
3598
+ "unique": false,
3599
+ "enumItems": [],
3600
+ "comment": null
3601
+ },
3602
+ "launch_at": {
3603
+ "name": "launch_at",
3604
+ "type": "timestamptz(6)",
3605
+ "mappedType": "datetime",
3606
+ "unsigned": false,
3607
+ "autoincrement": false,
3608
+ "primary": false,
3609
+ "nullable": true,
3610
+ "length": 6,
3611
+ "precision": null,
3612
+ "scale": null,
3613
+ "default": null,
3614
+ "unique": false,
3615
+ "enumItems": [],
3616
+ "comment": null
3617
+ },
3618
+ "end_of_life_at": {
3619
+ "name": "end_of_life_at",
3620
+ "type": "timestamptz(6)",
3621
+ "mappedType": "datetime",
3622
+ "unsigned": false,
3623
+ "autoincrement": false,
3624
+ "primary": false,
3625
+ "nullable": true,
3626
+ "length": 6,
3627
+ "precision": null,
3628
+ "scale": null,
3629
+ "default": null,
3630
+ "unique": false,
3631
+ "enumItems": [],
3632
+ "comment": null
3633
+ },
3634
+ "available_from": {
3635
+ "name": "available_from",
3636
+ "type": "timestamptz(6)",
3637
+ "mappedType": "datetime",
3638
+ "unsigned": false,
3639
+ "autoincrement": false,
3640
+ "primary": false,
3641
+ "nullable": true,
3642
+ "length": 6,
3643
+ "precision": null,
3644
+ "scale": null,
3645
+ "default": null,
3646
+ "unique": false,
3647
+ "enumItems": [],
3648
+ "comment": null
3649
+ },
3650
+ "available_until": {
3651
+ "name": "available_until",
3652
+ "type": "timestamptz(6)",
3653
+ "mappedType": "datetime",
3654
+ "unsigned": false,
3655
+ "autoincrement": false,
3656
+ "primary": false,
3657
+ "nullable": true,
3658
+ "length": 6,
3659
+ "precision": null,
3660
+ "scale": null,
3661
+ "default": null,
3662
+ "unique": false,
3663
+ "enumItems": [],
3664
+ "comment": null
3665
+ },
3666
+ "min_order_qty": {
3667
+ "name": "min_order_qty",
3668
+ "type": "int",
3669
+ "mappedType": "integer",
3670
+ "unsigned": false,
3671
+ "autoincrement": false,
3672
+ "primary": false,
3673
+ "nullable": true,
3674
+ "length": null,
3675
+ "precision": null,
3676
+ "scale": null,
3677
+ "default": null,
3678
+ "unique": false,
3679
+ "enumItems": [],
3680
+ "comment": null
3681
+ },
3682
+ "max_order_qty": {
3683
+ "name": "max_order_qty",
3684
+ "type": "int",
3685
+ "mappedType": "integer",
3686
+ "unsigned": false,
3687
+ "autoincrement": false,
3688
+ "primary": false,
3689
+ "nullable": true,
3690
+ "length": null,
3691
+ "precision": null,
3692
+ "scale": null,
3693
+ "default": null,
3694
+ "unique": false,
3695
+ "enumItems": [],
3696
+ "comment": null
3697
+ },
3698
+ "order_qty_increment": {
3699
+ "name": "order_qty_increment",
3700
+ "type": "int",
3701
+ "mappedType": "integer",
3702
+ "unsigned": false,
3703
+ "autoincrement": false,
3704
+ "primary": false,
3705
+ "nullable": true,
3706
+ "length": null,
3707
+ "precision": null,
3708
+ "scale": null,
3709
+ "default": null,
3710
+ "unique": false,
3711
+ "enumItems": [],
3712
+ "comment": null
3713
+ },
3714
+ "requires_shipping": {
3715
+ "name": "requires_shipping",
3716
+ "type": "boolean",
3717
+ "mappedType": "boolean",
3718
+ "unsigned": false,
3719
+ "autoincrement": false,
3720
+ "primary": false,
3721
+ "nullable": false,
3722
+ "length": null,
3723
+ "precision": null,
3724
+ "scale": null,
3725
+ "default": "true",
3726
+ "unique": false,
3727
+ "enumItems": [],
3728
+ "comment": null
3729
+ },
3730
+ "is_quote_only": {
3731
+ "name": "is_quote_only",
3732
+ "type": "boolean",
3733
+ "mappedType": "boolean",
3734
+ "unsigned": false,
3735
+ "autoincrement": false,
3736
+ "primary": false,
3737
+ "nullable": false,
3738
+ "length": null,
3739
+ "precision": null,
3740
+ "scale": null,
3741
+ "default": "false",
3742
+ "unique": false,
3743
+ "enumItems": [],
3744
+ "comment": null
3745
+ },
3746
+ "seo_title": {
3747
+ "name": "seo_title",
3748
+ "type": "text",
3749
+ "mappedType": "text",
3750
+ "unsigned": false,
3751
+ "autoincrement": false,
3752
+ "primary": false,
3753
+ "nullable": true,
3754
+ "length": null,
3755
+ "precision": null,
3756
+ "scale": null,
3757
+ "default": null,
3758
+ "unique": false,
3759
+ "enumItems": [],
3760
+ "comment": null
3761
+ },
3762
+ "seo_description": {
3763
+ "name": "seo_description",
3764
+ "type": "text",
3765
+ "mappedType": "text",
3766
+ "unsigned": false,
3767
+ "autoincrement": false,
3768
+ "primary": false,
3769
+ "nullable": true,
3770
+ "length": null,
3771
+ "precision": null,
3772
+ "scale": null,
3773
+ "default": null,
3774
+ "unique": false,
3775
+ "enumItems": [],
3776
+ "comment": null
3777
+ },
3778
+ "canonical_url": {
3779
+ "name": "canonical_url",
3780
+ "type": "text",
3781
+ "mappedType": "text",
3782
+ "unsigned": false,
3783
+ "autoincrement": false,
3784
+ "primary": false,
3785
+ "nullable": true,
3786
+ "length": null,
3787
+ "precision": null,
3788
+ "scale": null,
3789
+ "default": null,
3790
+ "unique": false,
3791
+ "enumItems": [],
3792
+ "comment": null
3793
+ },
3337
3794
  "metadata": {
3338
3795
  "name": "metadata",
3339
3796
  "type": "jsonb",
@@ -0,0 +1,17 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+
3
+ export class Migration20260611090000 extends Migration {
4
+
5
+ override async up(): Promise<void> {
6
+ this.addSql(`alter table "catalog_products" add column if not exists "country_of_origin_code" text null, add column if not exists "pkwiu_code" text null, add column if not exists "cn_code" text null, add column if not exists "hs_code" text null, add column if not exists "tax_classification_code" text null, add column if not exists "gtu_codes" text[] null, add column if not exists "age_min" smallint null, add column if not exists "is_excise_good" boolean not null default false, add column if not exists "excise_category" text null, add column if not exists "requires_prescription" boolean not null default false, add column if not exists "hazmat_class" text null, add column if not exists "un_number" text null, add column if not exists "hazmat_packing_group" text null, add column if not exists "contains_lithium_battery" boolean not null default false, add column if not exists "launch_at" timestamptz null, add column if not exists "end_of_life_at" timestamptz null, add column if not exists "available_from" timestamptz null, add column if not exists "available_until" timestamptz null, add column if not exists "min_order_qty" int null, add column if not exists "max_order_qty" int null, add column if not exists "order_qty_increment" int null, add column if not exists "requires_shipping" boolean not null default true, add column if not exists "is_quote_only" boolean not null default false, add column if not exists "seo_title" text null, add column if not exists "seo_description" text null, add column if not exists "canonical_url" text null;`);
7
+ this.addSql(`alter table "catalog_product_variants" add column if not exists "gtin_type" text null, add column if not exists "hs_code" text null;`);
8
+ this.addSql(`create unique index "catalog_product_variants_gtin_scope_unique" on "catalog_product_variants" ("tenant_id", "organization_id", "gtin_type", "barcode") where deleted_at is null and gtin_type is not null and barcode is not null;`);
9
+ }
10
+
11
+ override async down(): Promise<void> {
12
+ this.addSql(`drop index if exists "catalog_product_variants_gtin_scope_unique";`);
13
+ this.addSql(`alter table "catalog_product_variants" drop column if exists "gtin_type", drop column if exists "hs_code";`);
14
+ this.addSql(`alter table "catalog_products" drop column if exists "country_of_origin_code", drop column if exists "pkwiu_code", drop column if exists "cn_code", drop column if exists "hs_code", drop column if exists "tax_classification_code", drop column if exists "gtu_codes", drop column if exists "age_min", drop column if exists "is_excise_good", drop column if exists "excise_category", drop column if exists "requires_prescription", drop column if exists "hazmat_class", drop column if exists "un_number", drop column if exists "hazmat_packing_group", drop column if exists "contains_lithium_battery", drop column if exists "launch_at", drop column if exists "end_of_life_at", drop column if exists "available_from", drop column if exists "available_until", drop column if exists "min_order_qty", drop column if exists "max_order_qty", drop column if exists "order_qty_increment", drop column if exists "requires_shipping", drop column if exists "is_quote_only", drop column if exists "seo_title", drop column if exists "seo_description", drop column if exists "canonical_url";`);
15
+ }
16
+
17
+ }
@@ -1,5 +1,5 @@
1
1
  export const translatableFields: Record<string, string[]> = {
2
- 'catalog:catalog_product': ['title', 'subtitle', 'description'],
2
+ 'catalog:catalog_product': ['title', 'subtitle', 'description', 'seoTitle', 'seoDescription'],
3
3
  'catalog:catalog_product_variant': ['name'],
4
4
  'catalog:catalog_offer': ['title', 'subtitle', 'description'],
5
5
  'catalog:catalog_option_schema_template': ['name', 'description'],
@@ -5,6 +5,11 @@ import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
5
5
  import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
6
6
  import { runWithCacheTenant, type CacheStrategy } from '@open-mercato/cache'
7
7
  import { collectCrudCacheStats, purgeCrudCacheSegment } from '@open-mercato/shared/lib/crud/cache-stats'
8
+ import {
9
+ bridgeLegacyGuard,
10
+ runMutationGuards,
11
+ type MutationGuardInput,
12
+ } from '@open-mercato/shared/lib/crud/mutation-guard-registry'
8
13
  import {
9
14
  configsTag,
10
15
  cacheStatsResponseSchema,
@@ -19,6 +24,11 @@ export const metadata = {
19
24
  POST: { requireAuth: true, requireFeatures: ['configs.cache.manage'] },
20
25
  } as const
21
26
 
27
+ function resolveUserFeatures(auth: unknown): string[] {
28
+ const features = (auth as { features?: unknown } | null)?.features
29
+ return Array.isArray(features) ? features.filter((value): value is string => typeof value === 'string') : []
30
+ }
31
+
22
32
  export async function GET(req: Request) {
23
33
  const auth = await getAuthFromRequest(req)
24
34
  if (!auth?.sub) {
@@ -79,22 +89,74 @@ export async function POST(req: Request) {
79
89
  }
80
90
  const tenantScope = auth.tenantId ?? null
81
91
 
82
- if (action === 'purgeSegment') {
83
- const segment = typeof body?.segment === 'string' ? body.segment.trim() : ''
84
- if (!segment) {
92
+ const segment =
93
+ action === 'purgeSegment'
94
+ ? (typeof body?.segment === 'string' ? body.segment.trim() : '')
95
+ : null
96
+ if (action === 'purgeSegment' && !segment) {
97
+ return NextResponse.json(
98
+ { error: translate('configs.cache.purgeError', 'Failed to purge cache segment.') },
99
+ { status: 400 },
100
+ )
101
+ }
102
+
103
+ // Mutation-guard contract for this custom write route (packages/core/AGENTS.md
104
+ // → API Routes). A cache purge carries no per-record optimistic-lock version, so
105
+ // the default OSS guard short-circuits; wiring it keeps the route on the shared
106
+ // write-guard interception path for any tenant-registered guard.
107
+ const guardInput: MutationGuardInput = {
108
+ tenantId: tenantScope ?? '',
109
+ organizationId: auth.orgId ?? null,
110
+ userId: auth.sub,
111
+ resourceKind: 'configs.cache',
112
+ resourceId: segment ?? tenantScope ?? 'all',
113
+ operation: 'delete',
114
+ requestMethod: req.method,
115
+ requestHeaders: req.headers,
116
+ mutationPayload: { action, ...(segment ? { segment } : {}) },
117
+ }
118
+ const guard = bridgeLegacyGuard(container)
119
+ let afterSuccessCallbacks: Awaited<ReturnType<typeof runMutationGuards>>['afterSuccessCallbacks'] = []
120
+ if (guard) {
121
+ const guardResult = await runMutationGuards([guard], guardInput, {
122
+ userFeatures: resolveUserFeatures(auth),
123
+ })
124
+ if (!guardResult.ok) {
85
125
  return NextResponse.json(
86
- { error: translate('configs.cache.purgeError', 'Failed to purge cache segment.') },
87
- { status: 400 },
126
+ guardResult.errorBody ?? { error: translate('configs.cache.purgeError', 'Failed to purge cache segment.') },
127
+ { status: guardResult.errorStatus ?? 422 },
88
128
  )
89
129
  }
90
- const result = await runWithCacheTenant(tenantScope, () => purgeCrudCacheSegment(cache, segment))
130
+ afterSuccessCallbacks = guardResult.afterSuccessCallbacks
131
+ }
132
+
133
+ let responseBody: Record<string, unknown>
134
+ if (action === 'purgeSegment') {
135
+ const result = await runWithCacheTenant(tenantScope, () => purgeCrudCacheSegment(cache, segment!))
91
136
  const stats = await runWithCacheTenant(tenantScope, () => collectCrudCacheStats(cache))
92
- return NextResponse.json({ action: 'purgeSegment', segment, deleted: result.deleted, stats })
137
+ responseBody = { action: 'purgeSegment', segment, deleted: result.deleted, stats }
138
+ } else {
139
+ await runWithCacheTenant(tenantScope, () => cache.clear())
140
+ const stats = await runWithCacheTenant(tenantScope, () => collectCrudCacheStats(cache))
141
+ responseBody = { action: 'purgeAll', stats }
142
+ }
143
+
144
+ for (const callback of afterSuccessCallbacks) {
145
+ if (!callback.guard.afterSuccess) continue
146
+ await callback.guard.afterSuccess({
147
+ tenantId: tenantScope ?? '',
148
+ organizationId: auth.orgId ?? null,
149
+ userId: auth.sub,
150
+ resourceKind: 'configs.cache',
151
+ resourceId: segment ?? tenantScope ?? 'all',
152
+ operation: 'delete',
153
+ requestMethod: req.method,
154
+ requestHeaders: req.headers,
155
+ metadata: callback.metadata ?? null,
156
+ })
93
157
  }
94
158
 
95
- await runWithCacheTenant(tenantScope, () => cache.clear())
96
- const stats = await runWithCacheTenant(tenantScope, () => collectCrudCacheStats(cache))
97
- return NextResponse.json({ action: 'purgeAll', stats })
159
+ return NextResponse.json(responseBody)
98
160
  } catch (error) {
99
161
  console.error('[configs.cache] failed to purge cache', error)
100
162
  return NextResponse.json(