@mercurjs/core 2.2.0-canary.9 → 2.2.0-rc.0

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 (642) hide show
  1. package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.d.ts +13 -0
  2. package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.js +59 -0
  3. package/.medusa/server/src/api/admin/claims/[id]/request/route.d.ts +4 -0
  4. package/.medusa/server/src/api/admin/claims/[id]/request/route.js +74 -0
  5. package/.medusa/server/src/api/admin/collections/[id]/route.d.ts +7 -0
  6. package/.medusa/server/src/api/admin/collections/[id]/route.js +48 -0
  7. package/.medusa/server/src/api/admin/collections/middlewares.d.ts +2 -0
  8. package/.medusa/server/src/api/admin/collections/middlewares.js +49 -0
  9. package/.medusa/server/src/api/admin/collections/query-config.d.ts +12 -0
  10. package/.medusa/server/src/api/admin/collections/query-config.js +29 -0
  11. package/.medusa/server/src/api/admin/collections/route.d.ts +6 -0
  12. package/.medusa/server/src/api/admin/collections/route.js +36 -0
  13. package/.medusa/server/src/api/admin/collections/validators.d.ts +262 -0
  14. package/.medusa/server/src/api/admin/collections/validators.js +42 -0
  15. package/.medusa/server/src/api/admin/commission-rates/query-config.js +6 -4
  16. package/.medusa/server/src/api/admin/commission-rates/route.js +4 -1
  17. package/.medusa/server/src/api/admin/commission-rates/validators.d.ts +89 -58
  18. package/.medusa/server/src/api/admin/commission-rates/validators.js +16 -9
  19. package/.medusa/server/src/api/admin/customer-groups/middlewares.d.ts +2 -0
  20. package/.medusa/server/src/api/admin/customer-groups/middlewares.js +43 -0
  21. package/.medusa/server/src/api/admin/customer-groups/validators.d.ts +257 -0
  22. package/.medusa/server/src/api/admin/customer-groups/validators.js +12 -0
  23. package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.d.ts +14 -0
  24. package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.js +60 -0
  25. package/.medusa/server/src/api/admin/exchanges/[id]/request/route.d.ts +4 -0
  26. package/.medusa/server/src/api/admin/exchanges/[id]/request/route.js +75 -0
  27. package/.medusa/server/src/api/admin/members/validators.d.ts +14 -15
  28. package/.medusa/server/src/api/admin/middlewares.js +31 -36
  29. package/.medusa/server/src/api/admin/offers/middlewares.js +3 -1
  30. package/.medusa/server/src/api/admin/offers/query-config.js +3 -1
  31. package/.medusa/server/src/api/admin/offers/validators.d.ts +74 -55
  32. package/.medusa/server/src/api/admin/offers/validators.js +8 -1
  33. package/.medusa/server/src/api/admin/order-edits/[id]/confirm/route.d.ts +3 -0
  34. package/.medusa/server/src/api/admin/order-edits/[id]/confirm/route.js +18 -0
  35. package/.medusa/server/src/api/admin/order-edits/[id]/items/route.d.ts +15 -0
  36. package/.medusa/server/src/api/admin/order-edits/[id]/items/route.js +46 -0
  37. package/.medusa/server/src/api/admin/order-groups/helpers.d.ts +2 -0
  38. package/.medusa/server/src/api/admin/order-groups/helpers.js +53 -0
  39. package/.medusa/server/src/api/admin/order-groups/middlewares.js +3 -1
  40. package/.medusa/server/src/api/admin/order-groups/route.js +4 -2
  41. package/.medusa/server/src/api/admin/order-groups/validators.d.ts +20 -21
  42. package/.medusa/server/src/api/admin/orders/[id]/commission-lines/route.d.ts +7 -0
  43. package/.medusa/server/src/api/admin/orders/[id]/commission-lines/route.js +17 -0
  44. package/.medusa/server/src/api/admin/orders/middlewares.d.ts +2 -0
  45. package/.medusa/server/src/api/admin/orders/middlewares.js +42 -0
  46. package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.d.ts +2 -0
  47. package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.js +15 -0
  48. package/.medusa/server/src/api/admin/orders/validators.d.ts +1 -287
  49. package/.medusa/server/src/api/admin/orders/validators.js +9 -29
  50. package/.medusa/server/src/api/admin/payouts/validators.d.ts +18 -19
  51. package/.medusa/server/src/api/admin/product-attributes/[id]/route.js +2 -2
  52. package/.medusa/server/src/api/admin/product-attributes/[id]/values/[value_id]/route.js +2 -2
  53. package/.medusa/server/src/api/admin/product-attributes/middlewares.js +1 -3
  54. package/.medusa/server/src/api/admin/product-attributes/query-config.js +4 -1
  55. package/.medusa/server/src/api/admin/product-attributes/route.d.ts +2 -2
  56. package/.medusa/server/src/api/admin/product-attributes/route.js +2 -5
  57. package/.medusa/server/src/api/admin/product-attributes/validators.d.ts +129 -140
  58. package/.medusa/server/src/api/admin/product-attributes/validators.js +1 -3
  59. package/.medusa/server/src/api/admin/product-categories/[id]/route.js +8 -11
  60. package/.medusa/server/src/api/admin/product-categories/query-config.js +7 -1
  61. package/.medusa/server/src/api/admin/product-categories/route.js +5 -8
  62. package/.medusa/server/src/api/admin/product-categories/validators.d.ts +153 -93
  63. package/.medusa/server/src/api/admin/product-categories/validators.js +11 -1
  64. package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.d.ts +0 -7
  65. package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.js +1 -8
  66. package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.d.ts +0 -7
  67. package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.js +1 -8
  68. package/.medusa/server/src/api/admin/products/[id]/attributes/batch/route.js +6 -9
  69. package/.medusa/server/src/api/admin/products/[id]/confirm/route.d.ts +0 -12
  70. package/.medusa/server/src/api/admin/products/[id]/confirm/route.js +1 -13
  71. package/.medusa/server/src/api/admin/products/[id]/preview/route.d.ts +0 -7
  72. package/.medusa/server/src/api/admin/products/[id]/preview/route.js +1 -8
  73. package/.medusa/server/src/api/admin/products/[id]/reject/route.d.ts +0 -8
  74. package/.medusa/server/src/api/admin/products/[id]/reject/route.js +1 -9
  75. package/.medusa/server/src/api/admin/products/[id]/request-changes/route.d.ts +0 -9
  76. package/.medusa/server/src/api/admin/products/[id]/request-changes/route.js +1 -10
  77. package/.medusa/server/src/api/admin/products/[id]/route.js +9 -3
  78. package/.medusa/server/src/api/admin/products/[id]/sellers/route.d.ts +3 -0
  79. package/.medusa/server/src/api/admin/products/[id]/sellers/route.js +13 -0
  80. package/.medusa/server/src/api/admin/products/middlewares.js +6 -42
  81. package/.medusa/server/src/api/admin/products/query-config.js +41 -16
  82. package/.medusa/server/src/api/admin/products/route.js +9 -1
  83. package/.medusa/server/src/api/admin/products/validators.d.ts +558 -1324
  84. package/.medusa/server/src/api/admin/products/validators.js +59 -93
  85. package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.d.ts +3 -0
  86. package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.js +29 -0
  87. package/.medusa/server/src/api/admin/sellers/middlewares.js +1 -20
  88. package/.medusa/server/src/api/admin/sellers/validators.d.ts +75 -96
  89. package/.medusa/server/src/api/admin/sellers/validators.js +3 -4
  90. package/.medusa/server/src/api/admin/shipping-options/middlewares.d.ts +2 -0
  91. package/.medusa/server/src/api/admin/shipping-options/middlewares.js +46 -0
  92. package/.medusa/server/src/api/admin/shipping-profiles/middlewares.d.ts +2 -0
  93. package/.medusa/server/src/api/admin/shipping-profiles/middlewares.js +46 -0
  94. package/.medusa/server/src/api/admin/stock-locations/middlewares.d.ts +2 -0
  95. package/.medusa/server/src/api/admin/stock-locations/middlewares.js +46 -0
  96. package/.medusa/server/src/api/store/carts/[id]/complete/route.js +1 -5
  97. package/.medusa/server/src/api/store/carts/[id]/complete/validators.d.ts +1 -1
  98. package/.medusa/server/src/api/store/carts/[id]/line-items/route.js +13 -1
  99. package/.medusa/server/src/api/store/carts/[id]/line-items/validators.d.ts +0 -3
  100. package/.medusa/server/src/api/store/carts/[id]/line-items/validators.js +1 -2
  101. package/.medusa/server/src/api/store/carts/[id]/shipping-methods/route.js +6 -2
  102. package/.medusa/server/src/api/store/middlewares.js +15 -11
  103. package/.medusa/server/src/api/store/offers/[id]/route.d.ts +3 -0
  104. package/.medusa/server/src/api/store/offers/[id]/route.js +28 -0
  105. package/.medusa/server/src/api/store/offers/helpers.d.ts +43 -0
  106. package/.medusa/server/src/api/store/offers/helpers.js +191 -0
  107. package/.medusa/server/src/api/store/offers/middlewares.d.ts +2 -0
  108. package/.medusa/server/src/api/store/offers/middlewares.js +64 -0
  109. package/.medusa/server/src/api/store/offers/query-config.d.ts +12 -0
  110. package/.medusa/server/src/api/store/offers/query-config.js +50 -0
  111. package/.medusa/server/src/api/store/offers/route.d.ts +3 -0
  112. package/.medusa/server/src/api/store/offers/route.js +30 -0
  113. package/.medusa/server/src/api/store/offers/validators.d.ts +158 -0
  114. package/.medusa/server/src/api/store/offers/validators.js +29 -0
  115. package/.medusa/server/src/api/store/order-groups/validators.d.ts +16 -17
  116. package/.medusa/server/src/api/store/product-attributes/validators.d.ts +50 -46
  117. package/.medusa/server/src/api/store/product-categories/validators.d.ts +59 -53
  118. package/.medusa/server/src/api/store/products/[id]/route.js +9 -5
  119. package/.medusa/server/src/api/store/products/helpers.d.ts +10 -0
  120. package/.medusa/server/src/api/store/products/helpers.js +20 -0
  121. package/.medusa/server/src/api/store/products/middlewares.js +37 -24
  122. package/.medusa/server/src/api/store/products/query-config.js +23 -7
  123. package/.medusa/server/src/api/store/products/route.js +9 -1
  124. package/.medusa/server/src/api/store/products/validators.d.ts +69 -65
  125. package/.medusa/server/src/api/store/search/middlewares.d.ts +2 -0
  126. package/.medusa/server/src/api/store/search/middlewares.js +73 -0
  127. package/.medusa/server/src/api/store/search/route.d.ts +8 -0
  128. package/.medusa/server/src/api/store/search/route.js +25 -0
  129. package/.medusa/server/src/api/store/search/validators.d.ts +27 -0
  130. package/.medusa/server/src/api/store/search/validators.js +17 -0
  131. package/.medusa/server/src/api/store/sellers/validators.d.ts +35 -34
  132. package/.medusa/server/src/api/utils/filter-attributes-by-category-link.d.ts +0 -15
  133. package/.medusa/server/src/api/utils/filter-attributes-by-category-link.js +22 -26
  134. package/.medusa/server/src/api/utils/format-product-attributes.d.ts +5 -50
  135. package/.medusa/server/src/api/utils/format-product-attributes.js +90 -166
  136. package/.medusa/server/src/api/utils/index.d.ts +2 -0
  137. package/.medusa/server/src/api/utils/index.js +3 -1
  138. package/.medusa/server/src/api/utils/offers.d.ts +50 -0
  139. package/.medusa/server/src/api/utils/offers.js +286 -0
  140. package/.medusa/server/src/api/utils/order-commission-lines.d.ts +11 -0
  141. package/.medusa/server/src/api/utils/order-commission-lines.js +71 -0
  142. package/.medusa/server/src/api/utils/product-attribute-fields.d.ts +5 -0
  143. package/.medusa/server/src/api/utils/product-attribute-fields.js +35 -0
  144. package/.medusa/server/src/api/utils/sellers.d.ts +2 -0
  145. package/.medusa/server/src/api/utils/sellers.js +23 -0
  146. package/.medusa/server/src/api/vendor/campaigns/validators.d.ts +14 -15
  147. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.d.ts +0 -6
  148. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.js +1 -7
  149. package/.medusa/server/src/api/vendor/claims/[id]/request/route.js +1 -4
  150. package/.medusa/server/src/api/vendor/claims/validators.d.ts +32 -33
  151. package/.medusa/server/src/api/vendor/collections/query-config.js +7 -1
  152. package/.medusa/server/src/api/vendor/collections/validators.d.ts +22 -23
  153. package/.medusa/server/src/api/vendor/currencies/validators.d.ts +14 -15
  154. package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.d.ts +4 -0
  155. package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.js +20 -0
  156. package/.medusa/server/src/api/vendor/customer-groups/[id]/route.d.ts +6 -0
  157. package/.medusa/server/src/api/vendor/customer-groups/[id]/route.js +43 -0
  158. package/.medusa/server/src/api/vendor/customer-groups/helpers.d.ts +3 -0
  159. package/.medusa/server/src/api/vendor/customer-groups/helpers.js +38 -0
  160. package/.medusa/server/src/api/vendor/customer-groups/middlewares.d.ts +2 -0
  161. package/.medusa/server/src/api/vendor/customer-groups/middlewares.js +62 -0
  162. package/.medusa/server/src/api/vendor/customer-groups/query-config.d.ts +11 -0
  163. package/.medusa/server/src/api/vendor/customer-groups/query-config.js +22 -0
  164. package/.medusa/server/src/api/vendor/customer-groups/route.d.ts +5 -0
  165. package/.medusa/server/src/api/vendor/customer-groups/route.js +35 -0
  166. package/.medusa/server/src/api/vendor/customer-groups/validators.d.ts +156 -0
  167. package/.medusa/server/src/api/vendor/customer-groups/validators.js +35 -0
  168. package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.d.ts +4 -0
  169. package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.js +27 -0
  170. package/.medusa/server/src/api/vendor/customers/[id]/route.js +13 -1
  171. package/.medusa/server/src/api/vendor/customers/middlewares.js +9 -1
  172. package/.medusa/server/src/api/vendor/customers/validators.d.ts +47 -32
  173. package/.medusa/server/src/api/vendor/customers/validators.js +9 -2
  174. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.d.ts +0 -6
  175. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.js +1 -7
  176. package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.js +1 -4
  177. package/.medusa/server/src/api/vendor/exchanges/validators.d.ts +29 -30
  178. package/.medusa/server/src/api/vendor/fulfillment-providers/validators.d.ts +24 -23
  179. package/.medusa/server/src/api/vendor/fulfillment-sets/validators.d.ts +18 -18
  180. package/.medusa/server/src/api/vendor/inventory-items/validators.d.ts +104 -110
  181. package/.medusa/server/src/api/vendor/middlewares.js +17 -17
  182. package/.medusa/server/src/api/vendor/offers/query-config.js +2 -1
  183. package/.medusa/server/src/api/vendor/offers/validators.d.ts +54 -59
  184. package/.medusa/server/src/api/vendor/offers/validators.js +4 -8
  185. package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.d.ts +0 -6
  186. package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.js +3 -9
  187. package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.d.ts +0 -9
  188. package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.js +1 -10
  189. package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.d.ts +0 -6
  190. package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.js +1 -7
  191. package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.d.ts +0 -12
  192. package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.js +1 -13
  193. package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.d.ts +0 -7
  194. package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.js +1 -8
  195. package/.medusa/server/src/api/vendor/order-edits/[id]/route.d.ts +0 -7
  196. package/.medusa/server/src/api/vendor/order-edits/[id]/route.js +1 -8
  197. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.d.ts +0 -9
  198. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.js +1 -10
  199. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.d.ts +0 -5
  200. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.js +1 -6
  201. package/.medusa/server/src/api/vendor/order-edits/middlewares.js +1 -13
  202. package/.medusa/server/src/api/vendor/order-edits/route.d.ts +0 -6
  203. package/.medusa/server/src/api/vendor/order-edits/route.js +1 -7
  204. package/.medusa/server/src/api/vendor/order-edits/validators.d.ts +12 -18
  205. package/.medusa/server/src/api/vendor/order-edits/validators.js +1 -1
  206. package/.medusa/server/src/api/vendor/orders/[id]/commission-lines/route.d.ts +7 -0
  207. package/.medusa/server/src/api/vendor/orders/[id]/commission-lines/route.js +18 -0
  208. package/.medusa/server/src/api/vendor/orders/middlewares.js +1 -3
  209. package/.medusa/server/src/api/vendor/orders/resolve-offer-items.d.ts +2 -13
  210. package/.medusa/server/src/api/vendor/orders/resolve-offer-items.js +11 -2
  211. package/.medusa/server/src/api/vendor/orders/validators.d.ts +21 -25
  212. package/.medusa/server/src/api/vendor/orders/validators.js +1 -7
  213. package/.medusa/server/src/api/vendor/payments/helpers.d.ts +0 -9
  214. package/.medusa/server/src/api/vendor/payments/helpers.js +1 -10
  215. package/.medusa/server/src/api/vendor/payments/validators.d.ts +38 -38
  216. package/.medusa/server/src/api/vendor/payout-accounts/validators.d.ts +11 -12
  217. package/.medusa/server/src/api/vendor/payouts/validators.d.ts +18 -19
  218. package/.medusa/server/src/api/vendor/price-lists/validators.d.ts +38 -40
  219. package/.medusa/server/src/api/vendor/price-preferences/validators.d.ts +14 -15
  220. package/.medusa/server/src/api/vendor/product-attributes/query-config.js +4 -2
  221. package/.medusa/server/src/api/vendor/product-attributes/route.js +1 -3
  222. package/.medusa/server/src/api/vendor/product-attributes/validators.d.ts +92 -104
  223. package/.medusa/server/src/api/vendor/product-attributes/validators.js +1 -1
  224. package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.js +2 -2
  225. package/.medusa/server/src/api/vendor/product-categories/query-config.js +7 -1
  226. package/.medusa/server/src/api/vendor/product-categories/validators.d.ts +89 -83
  227. package/.medusa/server/src/api/vendor/product-tags/validators.d.ts +2 -2
  228. package/.medusa/server/src/api/vendor/product-types/validators.d.ts +14 -15
  229. package/.medusa/server/src/api/vendor/product-variants/middlewares.js +11 -19
  230. package/.medusa/server/src/api/vendor/product-variants/query-config.js +1 -3
  231. package/.medusa/server/src/api/vendor/product-variants/validators.d.ts +103 -97
  232. package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.d.ts +2 -9
  233. package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.js +3 -27
  234. package/.medusa/server/src/api/vendor/products/[id]/cancel/route.d.ts +0 -6
  235. package/.medusa/server/src/api/vendor/products/[id]/cancel/route.js +1 -7
  236. package/.medusa/server/src/api/vendor/products/[id]/preview/route.d.ts +0 -9
  237. package/.medusa/server/src/api/vendor/products/[id]/preview/route.js +1 -10
  238. package/.medusa/server/src/api/vendor/products/[id]/route.d.ts +0 -14
  239. package/.medusa/server/src/api/vendor/products/[id]/route.js +10 -17
  240. package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.d.ts +0 -8
  241. package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.js +3 -11
  242. package/.medusa/server/src/api/vendor/products/[id]/variants/route.d.ts +0 -7
  243. package/.medusa/server/src/api/vendor/products/[id]/variants/route.js +2 -9
  244. package/.medusa/server/src/api/vendor/products/helpers.d.ts +6 -5
  245. package/.medusa/server/src/api/vendor/products/helpers.js +54 -10
  246. package/.medusa/server/src/api/vendor/products/middlewares.js +14 -63
  247. package/.medusa/server/src/api/vendor/products/query-config.js +52 -15
  248. package/.medusa/server/src/api/vendor/products/route.d.ts +0 -9
  249. package/.medusa/server/src/api/vendor/products/route.js +14 -17
  250. package/.medusa/server/src/api/vendor/products/validators.d.ts +436 -838
  251. package/.medusa/server/src/api/vendor/products/validators.js +65 -103
  252. package/.medusa/server/src/api/vendor/promotions/validators.d.ts +47 -49
  253. package/.medusa/server/src/api/vendor/refund-reasons/validators.d.ts +18 -19
  254. package/.medusa/server/src/api/vendor/regions/validators.d.ts +20 -21
  255. package/.medusa/server/src/api/vendor/reservations/[id]/route.js +1 -1
  256. package/.medusa/server/src/api/vendor/reservations/helpers.js +1 -4
  257. package/.medusa/server/src/api/vendor/reservations/middlewares.js +1 -18
  258. package/.medusa/server/src/api/vendor/reservations/query-config.js +1 -4
  259. package/.medusa/server/src/api/vendor/reservations/route.js +1 -1
  260. package/.medusa/server/src/api/vendor/reservations/validators.d.ts +24 -25
  261. package/.medusa/server/src/api/vendor/reservations/validators.js +1 -1
  262. package/.medusa/server/src/api/vendor/return-reasons/validators.d.ts +18 -19
  263. package/.medusa/server/src/api/vendor/returns/validators.d.ts +25 -26
  264. package/.medusa/server/src/api/vendor/sales-channels/[id]/products/route.js +2 -1
  265. package/.medusa/server/src/api/vendor/sales-channels/helpers.d.ts +1 -0
  266. package/.medusa/server/src/api/vendor/sales-channels/helpers.js +25 -2
  267. package/.medusa/server/src/api/vendor/sales-channels/validators.d.ts +25 -24
  268. package/.medusa/server/src/api/vendor/sellers/middlewares.js +1 -18
  269. package/.medusa/server/src/api/vendor/sellers/route.js +6 -2
  270. package/.medusa/server/src/api/vendor/sellers/validators.d.ts +25 -46
  271. package/.medusa/server/src/api/vendor/sellers/validators.js +2 -2
  272. package/.medusa/server/src/api/vendor/shipping-option-types/validators.d.ts +18 -19
  273. package/.medusa/server/src/api/vendor/shipping-options/validators.d.ts +97 -98
  274. package/.medusa/server/src/api/vendor/shipping-profiles/validators.d.ts +20 -21
  275. package/.medusa/server/src/api/vendor/stock-locations/validators.d.ts +18 -19
  276. package/.medusa/server/src/api/vendor/stores/validators.d.ts +14 -15
  277. package/.medusa/server/src/links/media-product-category-link.d.ts +20 -0
  278. package/.medusa/server/src/links/media-product-category-link.js +34 -0
  279. package/.medusa/server/src/links/media-product-collection-link.d.ts +18 -0
  280. package/.medusa/server/src/links/media-product-collection-link.js +32 -0
  281. package/.medusa/server/src/links/offer-product-link.js +15 -0
  282. package/.medusa/server/src/links/product-attribute-category-link.d.ts +0 -14
  283. package/.medusa/server/src/links/product-attribute-category-link.js +4 -21
  284. package/.medusa/server/src/links/product-attribute-option-mirror-link.d.ts +6 -0
  285. package/.medusa/server/src/links/product-attribute-option-mirror-link.js +24 -0
  286. package/.medusa/server/src/links/product-attribute-product-link.d.ts +0 -5
  287. package/.medusa/server/src/links/product-attribute-product-link.js +2 -7
  288. package/.medusa/server/src/links/product-attribute-value-option-value-mirror-link.d.ts +6 -0
  289. package/.medusa/server/src/links/product-attribute-value-option-value-mirror-link.js +24 -0
  290. package/.medusa/server/src/links/{product-variant-attribute-value-link.d.ts → product-attribute-value-pivot-link.d.ts} +3 -0
  291. package/.medusa/server/src/links/product-attribute-value-pivot-link.js +23 -0
  292. package/.medusa/server/src/links/seller-customer-group-link.js +15 -0
  293. package/.medusa/server/src/migration-scripts/drop-fulfillment-global-unique-indexes.js +6 -1
  294. package/.medusa/server/src/migration-scripts/rename-default-store.d.ts +2 -0
  295. package/.medusa/server/src/migration-scripts/rename-default-store.js +12 -0
  296. package/.medusa/server/src/modules/commission/index.d.ts +14 -0
  297. package/.medusa/server/src/modules/commission/index.js +3 -1
  298. package/.medusa/server/src/modules/commission/loaders/seed-default-commission-rate.d.ts +11 -0
  299. package/.medusa/server/src/modules/commission/loaders/seed-default-commission-rate.js +35 -0
  300. package/.medusa/server/src/modules/commission/migrations/Migration20260615120000.d.ts +5 -0
  301. package/.medusa/server/src/modules/commission/migrations/Migration20260615120000.js +46 -0
  302. package/.medusa/server/src/modules/commission/models/commission-line.d.ts +2 -1
  303. package/.medusa/server/src/modules/commission/models/commission-line.js +3 -2
  304. package/.medusa/server/src/modules/commission/models/commission-rate-value.d.ts +25 -0
  305. package/.medusa/server/src/modules/commission/models/commission-rate-value.js +17 -0
  306. package/.medusa/server/src/modules/commission/models/commission-rate.d.ts +9 -4
  307. package/.medusa/server/src/modules/commission/models/commission-rate.js +9 -6
  308. package/.medusa/server/src/modules/commission/models/commission-rule.d.ts +8 -3
  309. package/.medusa/server/src/modules/commission/models/index.d.ts +1 -0
  310. package/.medusa/server/src/modules/commission/models/index.js +4 -2
  311. package/.medusa/server/src/modules/commission/service.d.ts +170 -10
  312. package/.medusa/server/src/modules/commission/service.js +270 -114
  313. package/.medusa/server/src/modules/media/index.d.ts +21 -0
  314. package/.medusa/server/src/modules/media/index.js +12 -0
  315. package/.medusa/server/src/modules/media/migrations/Migration20260616000000.d.ts +5 -0
  316. package/.medusa/server/src/modules/media/migrations/Migration20260616000000.js +16 -0
  317. package/.medusa/server/src/modules/media/models/index.d.ts +1 -0
  318. package/.medusa/server/src/modules/media/models/index.js +9 -0
  319. package/.medusa/server/src/modules/media/models/media-image.d.ts +32 -0
  320. package/.medusa/server/src/modules/media/models/media-image.js +41 -0
  321. package/.medusa/server/src/modules/media/service.d.ts +17 -0
  322. package/.medusa/server/src/modules/media/service.js +10 -0
  323. package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.d.ts +5 -0
  324. package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.js +16 -0
  325. package/.medusa/server/src/modules/offer/models/offer.d.ts +2 -0
  326. package/.medusa/server/src/modules/offer/models/offer.js +8 -1
  327. package/.medusa/server/src/modules/offer/service.d.ts +10 -0
  328. package/.medusa/server/src/modules/offer/service.js +100 -1
  329. package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000002.d.ts +14 -0
  330. package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000002.js +31 -0
  331. package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.d.ts +2 -0
  332. package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.js +2 -1
  333. package/.medusa/server/src/modules/product-attribute/models/product-attribute.d.ts +2 -0
  334. package/.medusa/server/src/modules/product-attribute/models/product-attribute.js +2 -1
  335. package/.medusa/server/src/modules/product-attribute/service.d.ts +18 -3
  336. package/.medusa/server/src/modules/product-attribute/service.js +213 -1
  337. package/.medusa/server/src/modules/search/abstract-search-provider.d.ts +9 -0
  338. package/.medusa/server/src/modules/search/abstract-search-provider.js +20 -0
  339. package/.medusa/server/src/modules/search/index.d.ts +10 -0
  340. package/.medusa/server/src/modules/search/index.js +31 -0
  341. package/.medusa/server/src/modules/search/lib/build-docs.d.ts +84 -0
  342. package/.medusa/server/src/modules/search/lib/build-docs.js +207 -0
  343. package/.medusa/server/src/modules/search/lib/reindex.d.ts +7 -0
  344. package/.medusa/server/src/modules/search/lib/reindex.js +61 -0
  345. package/.medusa/server/src/modules/search/lib/sync.d.ts +9 -0
  346. package/.medusa/server/src/modules/search/lib/sync.js +73 -0
  347. package/.medusa/server/src/modules/search/loaders/providers.d.ts +5 -0
  348. package/.medusa/server/src/modules/search/loaders/providers.js +26 -0
  349. package/.medusa/server/src/modules/search/providers/index.d.ts +1 -0
  350. package/.medusa/server/src/modules/search/providers/index.js +6 -0
  351. package/.medusa/server/src/modules/search/providers/orama/index.d.ts +4 -0
  352. package/.medusa/server/src/modules/search/providers/orama/index.js +12 -0
  353. package/.medusa/server/src/modules/search/providers/orama/service.d.ts +19 -0
  354. package/.medusa/server/src/modules/search/providers/orama/service.js +148 -0
  355. package/.medusa/server/src/modules/search/providers/orama/types.d.ts +10 -0
  356. package/.medusa/server/src/modules/search/providers/orama/types.js +3 -0
  357. package/.medusa/server/src/modules/search/services/index.d.ts +2 -0
  358. package/.medusa/server/src/modules/search/services/index.js +24 -0
  359. package/.medusa/server/src/modules/search/services/search-module-service.d.ts +25 -0
  360. package/.medusa/server/src/modules/search/services/search-module-service.js +60 -0
  361. package/.medusa/server/src/modules/search/services/search-provider-service.d.ts +15 -0
  362. package/.medusa/server/src/modules/search/services/search-provider-service.js +30 -0
  363. package/.medusa/server/src/modules/seller/migrations/Migration20260616120000.d.ts +5 -0
  364. package/.medusa/server/src/modules/seller/migrations/Migration20260616120000.js +16 -0
  365. package/.medusa/server/src/modules/seller/models/address.d.ts +2 -2
  366. package/.medusa/server/src/modules/seller/models/member-invite.d.ts +2 -2
  367. package/.medusa/server/src/modules/seller/models/member.d.ts +2 -2
  368. package/.medusa/server/src/modules/seller/models/payment-details.d.ts +2 -2
  369. package/.medusa/server/src/modules/seller/models/payment-details.js +3 -3
  370. package/.medusa/server/src/modules/seller/models/professional-details.d.ts +2 -2
  371. package/.medusa/server/src/modules/seller/models/seller-member.d.ts +4 -4
  372. package/.medusa/server/src/modules/seller/models/seller.d.ts +2 -2
  373. package/.medusa/server/src/modules/seller/repositories/order-group.js +1 -11
  374. package/.medusa/server/src/modules/seller/service.d.ts +16 -16
  375. package/.medusa/server/src/modules/seller/service.js +1 -2
  376. package/.medusa/server/src/subscribers/order-edit-confirmed.d.ts +9 -2
  377. package/.medusa/server/src/subscribers/order-edit-confirmed.js +18 -6
  378. package/.medusa/server/src/subscribers/search-offer-changed.d.ts +6 -0
  379. package/.medusa/server/src/subscribers/search-offer-changed.js +34 -0
  380. package/.medusa/server/src/subscribers/search-product-changed.d.ts +5 -0
  381. package/.medusa/server/src/subscribers/search-product-changed.js +29 -0
  382. package/.medusa/server/src/subscribers/search-product-deleted.d.ts +5 -0
  383. package/.medusa/server/src/subscribers/search-product-deleted.js +23 -0
  384. package/.medusa/server/src/subscribers/search-reindex.d.ts +3 -0
  385. package/.medusa/server/src/subscribers/search-reindex.js +23 -0
  386. package/.medusa/server/src/subscribers/search-seller-changed.d.ts +5 -0
  387. package/.medusa/server/src/subscribers/search-seller-changed.js +44 -0
  388. package/.medusa/server/src/utils/dashboard/dashboard-base.js +6 -2
  389. package/.medusa/server/src/utils/disable-medusa-middlewares.js +7 -1
  390. package/.medusa/server/src/workflows/cart/hooks/validate.js +1 -12
  391. package/.medusa/server/src/workflows/cart/steps/prepare-adjustments-from-promotion-actions.js +3 -5
  392. package/.medusa/server/src/workflows/cart/utils/fields.js +1 -13
  393. package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.js +1 -3
  394. package/.medusa/server/src/workflows/cart/workflows/add-seller-shipping-method-to-cart.js +1 -2
  395. package/.medusa/server/src/workflows/cart/workflows/complete-cart-with-split-orders.js +1 -24
  396. package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.d.ts +2 -2
  397. package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.js +1 -2
  398. package/.medusa/server/src/workflows/commission/steps/create-commission-rates.d.ts +1 -28
  399. package/.medusa/server/src/workflows/commission/steps/create-commission-rules.d.ts +13 -4
  400. package/.medusa/server/src/workflows/commission/steps/index.d.ts +1 -0
  401. package/.medusa/server/src/workflows/commission/steps/index.js +2 -1
  402. package/.medusa/server/src/workflows/commission/steps/update-commission-rates.d.ts +13 -4
  403. package/.medusa/server/src/workflows/commission/steps/update-commission-rules.d.ts +13 -4
  404. package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.d.ts +2 -2
  405. package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.js +1 -1
  406. package/.medusa/server/src/workflows/commission/steps/validate-commission-rates-deletable.d.ts +2 -0
  407. package/.medusa/server/src/workflows/commission/steps/validate-commission-rates-deletable.js +19 -0
  408. package/.medusa/server/src/workflows/commission/workflows/create-commission-rates.d.ts +1 -28
  409. package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.d.ts +1 -2
  410. package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.js +3 -1
  411. package/.medusa/server/src/workflows/commission/workflows/refresh-order-commission-lines.js +2 -1
  412. package/.medusa/server/src/workflows/commission/workflows/update-commission-rates.d.ts +13 -4
  413. package/.medusa/server/src/workflows/customer-group/index.d.ts +2 -0
  414. package/.medusa/server/src/workflows/customer-group/index.js +19 -0
  415. package/.medusa/server/src/workflows/customer-group/steps/index.d.ts +1 -0
  416. package/.medusa/server/src/workflows/customer-group/steps/index.js +18 -0
  417. package/.medusa/server/src/workflows/customer-group/steps/link-seller-customer-group.d.ts +6 -0
  418. package/.medusa/server/src/workflows/customer-group/steps/link-seller-customer-group.js +38 -0
  419. package/.medusa/server/src/workflows/customer-group/workflows/create-seller-customer-groups.d.ts +7 -0
  420. package/.medusa/server/src/workflows/customer-group/workflows/create-seller-customer-groups.js +20 -0
  421. package/.medusa/server/src/workflows/customer-group/workflows/index.d.ts +1 -0
  422. package/.medusa/server/src/workflows/customer-group/workflows/index.js +18 -0
  423. package/.medusa/server/src/workflows/index.d.ts +2 -0
  424. package/.medusa/server/src/workflows/index.js +3 -1
  425. package/.medusa/server/src/workflows/media/index.d.ts +2 -0
  426. package/.medusa/server/src/workflows/media/index.js +19 -0
  427. package/.medusa/server/src/workflows/media/steps/create-images.d.ts +20 -0
  428. package/.medusa/server/src/workflows/media/steps/create-images.js +21 -0
  429. package/.medusa/server/src/workflows/media/steps/delete-images.d.ts +3 -0
  430. package/.medusa/server/src/workflows/media/steps/delete-images.js +21 -0
  431. package/.medusa/server/src/workflows/media/steps/index.d.ts +2 -0
  432. package/.medusa/server/src/workflows/media/steps/index.js +19 -0
  433. package/.medusa/server/src/workflows/media/workflows/create-product-category-with-images.d.ts +8 -0
  434. package/.medusa/server/src/workflows/media/workflows/create-product-category-with-images.js +23 -0
  435. package/.medusa/server/src/workflows/media/workflows/create-product-collection-with-images.d.ts +8 -0
  436. package/.medusa/server/src/workflows/media/workflows/create-product-collection-with-images.js +23 -0
  437. package/.medusa/server/src/workflows/media/workflows/delete-product-category-with-images.d.ts +5 -0
  438. package/.medusa/server/src/workflows/media/workflows/delete-product-category-with-images.js +21 -0
  439. package/.medusa/server/src/workflows/media/workflows/delete-product-collection-with-images.d.ts +5 -0
  440. package/.medusa/server/src/workflows/media/workflows/delete-product-collection-with-images.js +21 -0
  441. package/.medusa/server/src/workflows/media/workflows/index.d.ts +8 -0
  442. package/.medusa/server/src/workflows/media/workflows/index.js +25 -0
  443. package/.medusa/server/src/workflows/media/workflows/set-category-images.d.ts +13 -0
  444. package/.medusa/server/src/workflows/media/workflows/set-category-images.js +71 -0
  445. package/.medusa/server/src/workflows/media/workflows/set-collection-images.d.ts +13 -0
  446. package/.medusa/server/src/workflows/media/workflows/set-collection-images.js +71 -0
  447. package/.medusa/server/src/workflows/media/workflows/update-product-category-with-images.d.ts +9 -0
  448. package/.medusa/server/src/workflows/media/workflows/update-product-category-with-images.js +22 -0
  449. package/.medusa/server/src/workflows/media/workflows/update-product-collection-with-images.d.ts +9 -0
  450. package/.medusa/server/src/workflows/media/workflows/update-product-collection-with-images.js +22 -0
  451. package/.medusa/server/src/workflows/offer/steps/add-offer-prices.d.ts +0 -12
  452. package/.medusa/server/src/workflows/offer/steps/add-offer-prices.js +1 -16
  453. package/.medusa/server/src/workflows/offer/steps/create-offers.d.ts +2 -0
  454. package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.d.ts +0 -9
  455. package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.js +1 -10
  456. package/.medusa/server/src/workflows/offer/steps/update-offers.d.ts +2 -5
  457. package/.medusa/server/src/workflows/offer/steps/update-offers.js +1 -1
  458. package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.d.ts +0 -11
  459. package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.js +1 -12
  460. package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.d.ts +0 -10
  461. package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.js +1 -19
  462. package/.medusa/server/src/workflows/offer/workflows/create-offers.js +4 -16
  463. package/.medusa/server/src/workflows/offer/workflows/delete-offers.js +7 -2
  464. package/.medusa/server/src/workflows/offer/workflows/update-offers.d.ts +0 -11
  465. package/.medusa/server/src/workflows/offer/workflows/update-offers.js +2 -23
  466. package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.d.ts +1 -2
  467. package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.js +1 -2
  468. package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.js +1 -3
  469. package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.js +1 -8
  470. package/.medusa/server/src/workflows/order/workflows/confirm-order-edit-request.d.ts +7 -0
  471. package/.medusa/server/src/workflows/order/workflows/confirm-order-edit-request.js +165 -0
  472. package/.medusa/server/src/workflows/order/workflows/confirm-return-receive.js +1 -9
  473. package/.medusa/server/src/workflows/order/workflows/create-order-fulfillment.js +2 -3
  474. package/.medusa/server/src/workflows/order/workflows/index.d.ts +1 -0
  475. package/.medusa/server/src/workflows/order/workflows/index.js +2 -1
  476. package/.medusa/server/src/workflows/order-group/utils/aggregate-status.js +1 -7
  477. package/.medusa/server/src/workflows/order-group/workflows/get-order-groups-list.d.ts +1 -0
  478. package/.medusa/server/src/workflows/order-group/workflows/get-order-groups-list.js +11 -2
  479. package/.medusa/server/src/workflows/payout/workflows/create-payout.js +34 -21
  480. package/.medusa/server/src/workflows/product/events.d.ts +0 -6
  481. package/.medusa/server/src/workflows/product/events.js +1 -7
  482. package/.medusa/server/src/workflows/product/steps/index.d.ts +0 -2
  483. package/.medusa/server/src/workflows/product/steps/index.js +1 -3
  484. package/.medusa/server/src/workflows/product/steps/validate-products-status.d.ts +0 -8
  485. package/.medusa/server/src/workflows/product/steps/validate-products-status.js +1 -9
  486. package/.medusa/server/src/workflows/product/steps/validate-seller-product-permissions.js +1 -3
  487. package/.medusa/server/src/workflows/product/workflows/confirm-products.d.ts +0 -16
  488. package/.medusa/server/src/workflows/product/workflows/confirm-products.js +1 -13
  489. package/.medusa/server/src/workflows/product/workflows/create-products.d.ts +4 -52
  490. package/.medusa/server/src/workflows/product/workflows/create-products.js +69 -158
  491. package/.medusa/server/src/workflows/product/workflows/index.d.ts +0 -1
  492. package/.medusa/server/src/workflows/product/workflows/index.js +1 -2
  493. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.d.ts +0 -7
  494. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.js +1 -1
  495. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.d.ts +0 -7
  496. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.js +1 -1
  497. package/.medusa/server/src/workflows/product/workflows/reject-product.d.ts +0 -7
  498. package/.medusa/server/src/workflows/product/workflows/reject-product.js +1 -8
  499. package/.medusa/server/src/workflows/product/workflows/request-product-change.d.ts +0 -14
  500. package/.medusa/server/src/workflows/product/workflows/request-product-change.js +1 -15
  501. package/.medusa/server/src/workflows/product-attribute/events.d.ts +0 -9
  502. package/.medusa/server/src/workflows/product-attribute/events.js +1 -10
  503. package/.medusa/server/src/workflows/product-attribute/steps/create-product-attribute-values.d.ts +1 -31
  504. package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.d.ts +1 -41
  505. package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.js +1 -1
  506. package/.medusa/server/src/workflows/product-attribute/steps/detach-product-option-values-from-product.d.ts +14 -0
  507. package/.medusa/server/src/workflows/product-attribute/steps/detach-product-option-values-from-product.js +40 -0
  508. package/.medusa/server/src/workflows/product-attribute/steps/index.d.ts +3 -4
  509. package/.medusa/server/src/workflows/product-attribute/steps/index.js +4 -5
  510. package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.d.ts +6 -3
  511. package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.js +17 -2
  512. package/.medusa/server/src/workflows/product-attribute/steps/update-product-attributes.d.ts +1 -31
  513. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-linked.d.ts +2 -0
  514. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-linked.js +28 -0
  515. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-required.d.ts +7 -0
  516. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-required.js +16 -0
  517. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attributes-to-product.d.ts +9 -0
  518. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attributes-to-product.js +242 -0
  519. package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-product-attributes.d.ts +14 -0
  520. package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-product-attributes.js +27 -0
  521. package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attribute-values.js +44 -3
  522. package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attributes.js +41 -17
  523. package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attribute-values.js +36 -15
  524. package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.d.ts +0 -7
  525. package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.js +11 -8
  526. package/.medusa/server/src/workflows/product-attribute/workflows/index.d.ts +4 -6
  527. package/.medusa/server/src/workflows/product-attribute/workflows/index.js +5 -7
  528. package/.medusa/server/src/workflows/product-attribute/workflows/remove-product-attributes-from-product.d.ts +10 -0
  529. package/.medusa/server/src/workflows/product-attribute/workflows/remove-product-attributes-from-product.js +83 -0
  530. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute-values.js +34 -1
  531. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes-on-product.d.ts +11 -0
  532. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes-on-product.js +285 -0
  533. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes.js +15 -1
  534. package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.d.ts +4 -11
  535. package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.js +19 -19
  536. package/.medusa/server/src/workflows/product-edit/events.d.ts +0 -7
  537. package/.medusa/server/src/workflows/product-edit/events.js +1 -8
  538. package/.medusa/server/src/workflows/product-edit/steps/apply-variant-image-links.d.ts +16 -0
  539. package/.medusa/server/src/workflows/product-edit/steps/apply-variant-image-links.js +35 -0
  540. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.d.ts +0 -4
  541. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.js +1 -5
  542. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.d.ts +0 -6
  543. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.js +1 -7
  544. package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.d.ts +0 -5
  545. package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.js +1 -6
  546. package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.d.ts +0 -6
  547. package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.js +1 -1
  548. package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.d.ts +0 -5
  549. package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.js +1 -6
  550. package/.medusa/server/src/workflows/product-edit/steps/index.d.ts +1 -0
  551. package/.medusa/server/src/workflows/product-edit/steps/index.js +2 -1
  552. package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.d.ts +0 -5
  553. package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.js +1 -6
  554. package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.d.ts +0 -6
  555. package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.js +2 -8
  556. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.d.ts +5 -19
  557. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.js +11 -128
  558. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.d.ts +0 -31
  559. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.js +43 -50
  560. package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.d.ts +1 -9
  561. package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.js +3 -11
  562. package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.d.ts +0 -11
  563. package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.js +1 -12
  564. package/.medusa/server/src/workflows/product-edit/workflows/index.d.ts +1 -1
  565. package/.medusa/server/src/workflows/product-edit/workflows/index.js +2 -2
  566. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.d.ts +0 -7
  567. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.js +10 -9
  568. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.d.ts +4 -46
  569. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.js +11 -162
  570. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-product.d.ts +11 -0
  571. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-product.js +133 -0
  572. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.d.ts +0 -10
  573. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.js +71 -17
  574. package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.d.ts +0 -24
  575. package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.js +1 -15
  576. package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.d.ts +1 -25
  577. package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.js +2 -15
  578. package/.medusa/server/src/workflows/promotion/steps/register-usage.d.ts +0 -3
  579. package/.medusa/server/src/workflows/promotion/steps/register-usage.js +1 -4
  580. package/.medusa/server/src/workflows/seller/steps/create-seller-member.d.ts +4 -4
  581. package/.medusa/server/src/workflows/seller/steps/update-member.d.ts +2 -2
  582. package/.medusa/server/src/workflows/seller/steps/update-seller-member.d.ts +4 -4
  583. package/.medusa/server/src/workflows/seller/workflows/accept-member-invite.js +1 -2
  584. package/.medusa/server/src/workflows/seller/workflows/add-seller-member.d.ts +4 -4
  585. package/.medusa/server/src/workflows/seller/workflows/create-sellers.js +1 -2
  586. package/.medusa/server/src/workflows/seller/workflows/update-member.d.ts +2 -2
  587. package/package.json +19 -18
  588. package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.d.ts +0 -13
  589. package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.js +0 -90
  590. package/.medusa/server/src/api/admin/products/[id]/attributes/route.d.ts +0 -5
  591. package/.medusa/server/src/api/admin/products/[id]/attributes/route.js +0 -63
  592. package/.medusa/server/src/api/vendor/orders/apply-request-filter.d.ts +0 -2
  593. package/.medusa/server/src/api/vendor/orders/apply-request-filter.js +0 -99
  594. package/.medusa/server/src/api/vendor/payment-collections/[id]/mark-as-paid/route.d.ts +0 -3
  595. package/.medusa/server/src/api/vendor/payment-collections/[id]/mark-as-paid/route.js +0 -25
  596. package/.medusa/server/src/api/vendor/payment-collections/helpers.d.ts +0 -3
  597. package/.medusa/server/src/api/vendor/payment-collections/helpers.js +0 -30
  598. package/.medusa/server/src/api/vendor/payment-collections/middlewares.d.ts +0 -2
  599. package/.medusa/server/src/api/vendor/payment-collections/middlewares.js +0 -17
  600. package/.medusa/server/src/api/vendor/payment-collections/query-config.d.ts +0 -7
  601. package/.medusa/server/src/api/vendor/payment-collections/query-config.js +0 -26
  602. package/.medusa/server/src/api/vendor/payment-collections/validators.d.ts +0 -17
  603. package/.medusa/server/src/api/vendor/payment-collections/validators.js +0 -12
  604. package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.d.ts +0 -22
  605. package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.js +0 -97
  606. package/.medusa/server/src/api/vendor/products/[id]/attributes/route.d.ts +0 -15
  607. package/.medusa/server/src/api/vendor/products/[id]/attributes/route.js +0 -80
  608. package/.medusa/server/src/links/line-item-commission-line-link.js +0 -21
  609. package/.medusa/server/src/links/product-attribute-value-link.d.ts +0 -22
  610. package/.medusa/server/src/links/product-attribute-value-link.js +0 -46
  611. package/.medusa/server/src/links/product-variant-attribute-link.js +0 -21
  612. package/.medusa/server/src/links/product-variant-attribute-value-link.js +0 -21
  613. package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.d.ts +0 -28
  614. package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.js +0 -72
  615. package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.d.ts +0 -90
  616. package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.js +0 -185
  617. package/.medusa/server/src/workflows/product/workflows/update-products.d.ts +0 -39
  618. package/.medusa/server/src/workflows/product/workflows/update-products.js +0 -161
  619. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.d.ts +0 -43
  620. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.js +0 -51
  621. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.d.ts +0 -7
  622. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.js +0 -59
  623. package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.d.ts +0 -6
  624. package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.js +0 -20
  625. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.d.ts +0 -7
  626. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.js +0 -20
  627. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.d.ts +0 -52
  628. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.js +0 -120
  629. package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.d.ts +0 -23
  630. package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.js +0 -252
  631. package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.d.ts +0 -17
  632. package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.js +0 -62
  633. package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.d.ts +0 -135
  634. package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.js +0 -43
  635. package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.d.ts +0 -24
  636. package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.js +0 -27
  637. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute.d.ts +0 -23
  638. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute.js +0 -67
  639. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.d.ts +0 -25
  640. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.js +0 -148
  641. /package/.medusa/server/src/links/{line-item-commission-line-link.d.ts → offer-product-link.d.ts} +0 -0
  642. /package/.medusa/server/src/links/{product-variant-attribute-link.d.ts → seller-customer-group-link.d.ts} +0 -0
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = renameDefaultStore;
4
+ const utils_1 = require("@medusajs/framework/utils");
5
+ const DEFAULT_STORE_NAME = "Medusa Store";
6
+ const MERCUR_STORE_NAME = "Mercur Marketplace";
7
+ async function renameDefaultStore({ container }) {
8
+ const storeService = container.resolve(utils_1.Modules.STORE);
9
+ const stores = await storeService.listStores({ name: DEFAULT_STORE_NAME });
10
+ await storeService.updateStores(stores[0].id, { name: MERCUR_STORE_NAME });
11
+ }
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVuYW1lLWRlZmF1bHQtc3RvcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWlncmF0aW9uLXNjcmlwdHMvcmVuYW1lLWRlZmF1bHQtc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFNQSxxQ0FNQztBQVhELHFEQUFtRDtBQUVuRCxNQUFNLGtCQUFrQixHQUFHLGNBQWMsQ0FBQTtBQUN6QyxNQUFNLGlCQUFpQixHQUFHLG9CQUFvQixDQUFBO0FBRS9CLEtBQUssVUFBVSxrQkFBa0IsQ0FBQyxFQUFFLFNBQVMsRUFBWTtJQUN0RSxNQUFNLFlBQVksR0FBRyxTQUFTLENBQUMsT0FBTyxDQUFzQixlQUFPLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFMUUsTUFBTSxNQUFNLEdBQUcsTUFBTSxZQUFZLENBQUMsVUFBVSxDQUFDLEVBQUUsSUFBSSxFQUFFLGtCQUFrQixFQUFFLENBQUMsQ0FBQTtJQUUxRSxNQUFNLFlBQVksQ0FBQyxZQUFZLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxFQUFFLElBQUksRUFBRSxpQkFBaUIsRUFBRSxDQUFDLENBQUE7QUFDNUUsQ0FBQyJ9
@@ -30,6 +30,20 @@ declare const _default: import("@mercurjs/types").ModuleExports<typeof Commissio
30
30
  primaryKey: "id";
31
31
  };
32
32
  };
33
+ readonly commissionRateValue: {
34
+ id: {
35
+ serviceName: MercurModules.COMMISSION;
36
+ field: "commissionRateValue";
37
+ linkable: "commission_rate_value_id";
38
+ primaryKey: "id";
39
+ };
40
+ toJSON: () => {
41
+ serviceName: MercurModules.COMMISSION;
42
+ field: "commissionRateValue";
43
+ linkable: "commission_rate_value_id";
44
+ primaryKey: "id";
45
+ };
46
+ };
33
47
  readonly commissionLine: {
34
48
  id: {
35
49
  serviceName: MercurModules.COMMISSION;
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const utils_1 = require("@medusajs/framework/utils");
7
7
  const types_1 = require("@mercurjs/types");
8
8
  const service_1 = __importDefault(require("./service"));
9
+ const seed_default_commission_rate_1 = __importDefault(require("./loaders/seed-default-commission-rate"));
9
10
  exports.default = (0, utils_1.Module)(types_1.MercurModules.COMMISSION, {
10
11
  service: service_1.default,
12
+ loaders: [seed_default_commission_rate_1.default],
11
13
  });
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEscURBQWtEO0FBQ2xELDJDQUErQztBQUUvQyx3REFBK0M7QUFFL0Msa0JBQWUsSUFBQSxjQUFNLEVBQUMscUJBQWEsQ0FBQyxVQUFVLEVBQUU7SUFDOUMsT0FBTyxFQUFFLGlCQUF1QjtDQUNqQyxDQUFDLENBQUEifQ==
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEscURBQWtEO0FBQ2xELDJDQUErQztBQUUvQyx3REFBK0M7QUFDL0MsMEdBQW9GO0FBRXBGLGtCQUFlLElBQUEsY0FBTSxFQUFDLHFCQUFhLENBQUMsVUFBVSxFQUFFO0lBQzlDLE9BQU8sRUFBRSxpQkFBdUI7SUFDaEMsT0FBTyxFQUFFLENBQUMsc0NBQStCLENBQUM7Q0FDM0MsQ0FBQyxDQUFBIn0=
@@ -0,0 +1,11 @@
1
+ import { LoaderOptions } from "@medusajs/framework/types";
2
+ /**
3
+ * Ensures the Global Commission (the `is_default` rate) always exists.
4
+ *
5
+ * The migration seeds it too, but the test infra applies schema from the
6
+ * models (not the migration data steps), so a boot-time loader is the
7
+ * reliable mechanism. It is idempotent — it only creates the row when no
8
+ * `is_default` rate is present — and guarded by the same flag as the
9
+ * migration seed, so the two never both create.
10
+ */
11
+ export default function seedDefaultCommissionRateLoader({ container, logger, }: LoaderOptions): Promise<void>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = seedDefaultCommissionRateLoader;
4
+ /**
5
+ * Ensures the Global Commission (the `is_default` rate) always exists.
6
+ *
7
+ * The migration seeds it too, but the test infra applies schema from the
8
+ * models (not the migration data steps), so a boot-time loader is the
9
+ * reliable mechanism. It is idempotent — it only creates the row when no
10
+ * `is_default` rate is present — and guarded by the same flag as the
11
+ * migration seed, so the two never both create.
12
+ */
13
+ async function seedDefaultCommissionRateLoader({ container, logger, }) {
14
+ try {
15
+ const rateService = container.resolve("commissionRateService");
16
+ const existing = await rateService.list({ is_default: true }, { take: 1 });
17
+ if (existing.length) {
18
+ return;
19
+ }
20
+ await rateService.create({
21
+ name: "Default",
22
+ code: "default",
23
+ type: "percentage",
24
+ value: 0,
25
+ is_enabled: true,
26
+ is_default: true,
27
+ include_tax: false,
28
+ include_shipping: false,
29
+ });
30
+ }
31
+ catch (error) {
32
+ logger?.warn(`Failed to seed the default commission rate: ${error?.message ?? error}`);
33
+ }
34
+ }
35
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VlZC1kZWZhdWx0LWNvbW1pc3Npb24tcmF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tb2R1bGVzL2NvbW1pc3Npb24vbG9hZGVycy9zZWVkLWRlZmF1bHQtY29tbWlzc2lvbi1yYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBV0Esa0RBNEJDO0FBckNEOzs7Ozs7OztHQVFHO0FBQ1ksS0FBSyxVQUFVLCtCQUErQixDQUFDLEVBQzVELFNBQVMsRUFDVCxNQUFNLEdBQ1E7SUFDZCxJQUFJLENBQUM7UUFDSCxNQUFNLFdBQVcsR0FBUSxTQUFTLENBQUMsT0FBTyxDQUFDLHVCQUF1QixDQUFDLENBQUE7UUFFbkUsTUFBTSxRQUFRLEdBQUcsTUFBTSxXQUFXLENBQUMsSUFBSSxDQUFDLEVBQUUsVUFBVSxFQUFFLElBQUksRUFBRSxFQUFFLEVBQUUsSUFBSSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUE7UUFDMUUsSUFBSSxRQUFRLENBQUMsTUFBTSxFQUFFLENBQUM7WUFDcEIsT0FBTTtRQUNSLENBQUM7UUFFRCxNQUFNLFdBQVcsQ0FBQyxNQUFNLENBQUM7WUFDdkIsSUFBSSxFQUFFLFNBQVM7WUFDZixJQUFJLEVBQUUsU0FBUztZQUNmLElBQUksRUFBRSxZQUFZO1lBQ2xCLEtBQUssRUFBRSxDQUFDO1lBQ1IsVUFBVSxFQUFFLElBQUk7WUFDaEIsVUFBVSxFQUFFLElBQUk7WUFDaEIsV0FBVyxFQUFFLEtBQUs7WUFDbEIsZ0JBQWdCLEVBQUUsS0FBSztTQUN4QixDQUFDLENBQUE7SUFDSixDQUFDO0lBQUMsT0FBTyxLQUFLLEVBQUUsQ0FBQztRQUNmLE1BQU0sRUFBRSxJQUFJLENBQ1YsK0NBQWdELEtBQWUsRUFBRSxPQUFPLElBQUksS0FDNUUsRUFBRSxDQUNILENBQUE7SUFDSCxDQUFDO0FBQ0gsQ0FBQyJ9
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260615120000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260615120000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260615120000 extends migrations_1.Migration {
6
+ async up() {
7
+ // commission_rate: add include_shipping + is_default; drop target, priority, min_amount
8
+ this.addSql(`alter table if exists "commission_rate" add column if not exists "include_shipping" boolean not null default false;`);
9
+ this.addSql(`alter table if exists "commission_rate" add column if not exists "is_default" boolean not null default false;`);
10
+ this.addSql(`alter table if exists "commission_rate" drop column if exists "priority";`);
11
+ this.addSql(`alter table if exists "commission_rate" drop column if exists "target";`);
12
+ this.addSql(`alter table if exists "commission_rate" drop column if exists "min_amount";`);
13
+ this.addSql(`alter table if exists "commission_rate" drop column if exists "raw_min_amount";`);
14
+ // commission_rate_value: per-currency Fixed amounts
15
+ this.addSql(`create table if not exists "commission_rate_value" ("id" text not null, "currency_code" text not null, "amount" numeric not null, "raw_amount" jsonb not null, "commission_rate_id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "commission_rate_value_pkey" primary key ("id"));`);
16
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_commission_rate_value_commission_rate_id" ON "commission_rate_value" ("commission_rate_id") WHERE deleted_at IS NULL;`);
17
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_commission_rate_value_currency_code" ON "commission_rate_value" ("currency_code") WHERE deleted_at IS NULL;`);
18
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_commission_rate_value_deleted_at" ON "commission_rate_value" ("deleted_at") WHERE deleted_at IS NULL;`);
19
+ this.addSql(`alter table if exists "commission_rate_value" add constraint "commission_rate_value_commission_rate_id_foreign" foreign key ("commission_rate_id") references "commission_rate" ("id") on update cascade;`);
20
+ // commission_line: item_id nullable + new shipping_method_id (exactly one set)
21
+ this.addSql(`alter table if exists "commission_line" alter column "item_id" drop not null;`);
22
+ this.addSql(`alter table if exists "commission_line" add column if not exists "shipping_method_id" text null;`);
23
+ this.addSql(`alter table if exists "commission_line" drop constraint if exists "commission_line_item_or_shipping_check";`);
24
+ this.addSql(`alter table if exists "commission_line" add constraint "commission_line_item_or_shipping_check" check (num_nonnulls("item_id", "shipping_method_id") = 1);`);
25
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_commission_line_item_id" ON "commission_line" ("item_id") WHERE deleted_at IS NULL;`);
26
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_commission_line_shipping_method_id" ON "commission_line" ("shipping_method_id") WHERE deleted_at IS NULL;`);
27
+ // seed exactly one default (Global Commission) rate
28
+ this.addSql(`insert into "commission_rate" ("id", "is_enabled", "is_default", "currency_code", "name", "code", "type", "value", "raw_value", "include_tax", "include_shipping", "created_at", "updated_at") select 'comrate_default', true, true, null, 'Default', 'default', 'percentage', 0, '{"value":"0"}'::jsonb, false, false, now(), now() where not exists (select 1 from "commission_rate" where "is_default" = true and "deleted_at" is null);`);
29
+ }
30
+ async down() {
31
+ this.addSql(`alter table if exists "commission_line" drop constraint if exists "commission_line_item_or_shipping_check";`);
32
+ this.addSql(`alter table if exists "commission_line" drop column if exists "shipping_method_id";`);
33
+ this.addSql(`alter table if exists "commission_line" alter column "item_id" set not null;`);
34
+ this.addSql(`alter table if exists "commission_rate_value" drop constraint if exists "commission_rate_value_commission_rate_id_foreign";`);
35
+ this.addSql(`drop table if exists "commission_rate_value" cascade;`);
36
+ this.addSql(`delete from "commission_rate" where "id" = 'comrate_default';`);
37
+ this.addSql(`alter table if exists "commission_rate" drop column if exists "include_shipping";`);
38
+ this.addSql(`alter table if exists "commission_rate" drop column if exists "is_default";`);
39
+ this.addSql(`alter table if exists "commission_rate" add column if not exists "priority" integer not null default 0;`);
40
+ this.addSql(`alter table if exists "commission_rate" add column if not exists "target" text not null default 'item';`);
41
+ this.addSql(`alter table if exists "commission_rate" add column if not exists "min_amount" numeric null;`);
42
+ this.addSql(`alter table if exists "commission_rate" add column if not exists "raw_min_amount" jsonb null;`);
43
+ }
44
+ }
45
+ exports.Migration20260615120000 = Migration20260615120000;
46
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNjA2MTUxMjAwMDAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNjA2MTUxMjAwMDAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZix3RkFBd0Y7UUFDeEYsSUFBSSxDQUFDLE1BQU0sQ0FBQyxxSEFBcUgsQ0FBQyxDQUFDO1FBQ25JLElBQUksQ0FBQyxNQUFNLENBQUMsK0dBQStHLENBQUMsQ0FBQztRQUM3SCxJQUFJLENBQUMsTUFBTSxDQUFDLDJFQUEyRSxDQUFDLENBQUM7UUFDekYsSUFBSSxDQUFDLE1BQU0sQ0FBQyx5RUFBeUUsQ0FBQyxDQUFDO1FBQ3ZGLElBQUksQ0FBQyxNQUFNLENBQUMsNkVBQTZFLENBQUMsQ0FBQztRQUMzRixJQUFJLENBQUMsTUFBTSxDQUFDLGlGQUFpRixDQUFDLENBQUM7UUFFL0Ysb0RBQW9EO1FBQ3BELElBQUksQ0FBQyxNQUFNLENBQUMsa1lBQWtZLENBQUMsQ0FBQztRQUNoWixJQUFJLENBQUMsTUFBTSxDQUFDLHVKQUF1SixDQUFDLENBQUM7UUFDckssSUFBSSxDQUFDLE1BQU0sQ0FBQyw2SUFBNkksQ0FBQyxDQUFDO1FBQzNKLElBQUksQ0FBQyxNQUFNLENBQUMsdUlBQXVJLENBQUMsQ0FBQztRQUNySixJQUFJLENBQUMsTUFBTSxDQUFDLDJNQUEyTSxDQUFDLENBQUM7UUFFek4sK0VBQStFO1FBQy9FLElBQUksQ0FBQyxNQUFNLENBQUMsK0VBQStFLENBQUMsQ0FBQztRQUM3RixJQUFJLENBQUMsTUFBTSxDQUFDLGtHQUFrRyxDQUFDLENBQUM7UUFDaEgsSUFBSSxDQUFDLE1BQU0sQ0FBQyw2R0FBNkcsQ0FBQyxDQUFDO1FBQzNILElBQUksQ0FBQyxNQUFNLENBQUMsNEpBQTRKLENBQUMsQ0FBQztRQUMxSyxJQUFJLENBQUMsTUFBTSxDQUFDLHFIQUFxSCxDQUFDLENBQUM7UUFDbkksSUFBSSxDQUFDLE1BQU0sQ0FBQywySUFBMkksQ0FBQyxDQUFDO1FBRXpKLG9EQUFvRDtRQUNwRCxJQUFJLENBQUMsTUFBTSxDQUFDLDZhQUE2YSxDQUFDLENBQUM7SUFDN2IsQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQUMsNkdBQTZHLENBQUMsQ0FBQztRQUMzSCxJQUFJLENBQUMsTUFBTSxDQUFDLHFGQUFxRixDQUFDLENBQUM7UUFDbkcsSUFBSSxDQUFDLE1BQU0sQ0FBQyw4RUFBOEUsQ0FBQyxDQUFDO1FBRTVGLElBQUksQ0FBQyxNQUFNLENBQUMsNkhBQTZILENBQUMsQ0FBQztRQUMzSSxJQUFJLENBQUMsTUFBTSxDQUFDLHVEQUF1RCxDQUFDLENBQUM7UUFFckUsSUFBSSxDQUFDLE1BQU0sQ0FBQywrREFBK0QsQ0FBQyxDQUFDO1FBQzdFLElBQUksQ0FBQyxNQUFNLENBQUMsbUZBQW1GLENBQUMsQ0FBQztRQUNqRyxJQUFJLENBQUMsTUFBTSxDQUFDLDZFQUE2RSxDQUFDLENBQUM7UUFDM0YsSUFBSSxDQUFDLE1BQU0sQ0FBQyx5R0FBeUcsQ0FBQyxDQUFDO1FBQ3ZILElBQUksQ0FBQyxNQUFNLENBQUMseUdBQXlHLENBQUMsQ0FBQztRQUN2SCxJQUFJLENBQUMsTUFBTSxDQUFDLDZGQUE2RixDQUFDLENBQUM7UUFDM0csSUFBSSxDQUFDLE1BQU0sQ0FBQywrRkFBK0YsQ0FBQyxDQUFDO0lBQy9HLENBQUM7Q0FFRjtBQS9DRCwwREErQ0MifQ==
@@ -1,6 +1,7 @@
1
1
  declare const CommissionLine: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
2
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
- item_id: import("@medusajs/framework/utils").TextProperty;
3
+ item_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
4
+ shipping_method_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
4
5
  commission_rate_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
5
6
  code: import("@medusajs/framework/utils").TextProperty;
6
7
  rate: import("@medusajs/framework/utils").FloatProperty;
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/framework/utils");
4
4
  const CommissionLine = utils_1.model.define("commission_line", {
5
5
  id: utils_1.model.id({ prefix: "comline" }).primaryKey(),
6
- item_id: utils_1.model.text(),
6
+ item_id: utils_1.model.text().nullable(),
7
+ shipping_method_id: utils_1.model.text().nullable(),
7
8
  commission_rate_id: utils_1.model.text().nullable(),
8
9
  code: utils_1.model.text(),
9
10
  rate: utils_1.model.float(),
@@ -11,4 +12,4 @@ const CommissionLine = utils_1.model.define("commission_line", {
11
12
  description: utils_1.model.text().nullable(),
12
13
  });
13
14
  exports.default = CommissionLine;
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbi1saW5lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbi1saW5lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEscURBQWlEO0FBRWpELE1BQU0sY0FBYyxHQUFHLGFBQUssQ0FBQyxNQUFNLENBQUMsaUJBQWlCLEVBQUU7SUFDckQsRUFBRSxFQUFFLGFBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxVQUFVLEVBQUU7SUFDaEQsT0FBTyxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUU7SUFDckIsa0JBQWtCLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUMzQyxJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRTtJQUNsQixJQUFJLEVBQUUsYUFBSyxDQUFDLEtBQUssRUFBRTtJQUNuQixNQUFNLEVBQUUsYUFBSyxDQUFDLFNBQVMsRUFBRTtJQUN6QixXQUFXLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtDQUNyQyxDQUFDLENBQUE7QUFFRixrQkFBZSxjQUFjLENBQUEifQ==
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbi1saW5lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbi1saW5lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEscURBQWlEO0FBRWpELE1BQU0sY0FBYyxHQUFHLGFBQUssQ0FBQyxNQUFNLENBQUMsaUJBQWlCLEVBQUU7SUFDckQsRUFBRSxFQUFFLGFBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxVQUFVLEVBQUU7SUFDaEQsT0FBTyxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDaEMsa0JBQWtCLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUMzQyxrQkFBa0IsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQzNDLElBQUksRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ2xCLElBQUksRUFBRSxhQUFLLENBQUMsS0FBSyxFQUFFO0lBQ25CLE1BQU0sRUFBRSxhQUFLLENBQUMsU0FBUyxFQUFFO0lBQ3pCLFdBQVcsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0NBQ3JDLENBQUMsQ0FBQTtBQUVGLGtCQUFlLGNBQWMsQ0FBQSJ9
@@ -0,0 +1,25 @@
1
+ declare const CommissionRateValue: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ currency_code: import("@medusajs/framework/utils").TextProperty;
4
+ amount: import("@medusajs/framework/utils").BigNumberProperty;
5
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
6
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
7
+ is_enabled: import("@medusajs/framework/utils").BooleanProperty;
8
+ is_default: import("@medusajs/framework/utils").BooleanProperty;
9
+ currency_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
10
+ name: import("@medusajs/framework/utils").TextProperty;
11
+ code: import("@medusajs/framework/utils").TextProperty;
12
+ type: import("@medusajs/framework/utils").EnumProperty<typeof import("@mercurjs/types").CommissionRateType>;
13
+ value: import("@medusajs/framework/utils").BigNumberProperty;
14
+ include_tax: import("@medusajs/framework/utils").BooleanProperty;
15
+ include_shipping: import("@medusajs/framework/utils").BooleanProperty;
16
+ rules: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
17
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
18
+ reference: import("@medusajs/framework/utils").TextProperty;
19
+ reference_id: import("@medusajs/framework/utils").TextProperty;
20
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
21
+ }>, "commission_rule">>;
22
+ values: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate_value">>;
23
+ }>, "commission_rate">, undefined>;
24
+ }>, "commission_rate_value">;
25
+ export default CommissionRateValue;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("@medusajs/framework/utils");
7
+ const commission_rate_1 = __importDefault(require("./commission-rate"));
8
+ const CommissionRateValue = utils_1.model.define("commission_rate_value", {
9
+ id: utils_1.model.id({ prefix: "comval" }).primaryKey(),
10
+ currency_code: utils_1.model.text(),
11
+ amount: utils_1.model.bigNumber(),
12
+ commission_rate: utils_1.model.belongsTo(() => commission_rate_1.default, {
13
+ mappedBy: "values",
14
+ }),
15
+ });
16
+ exports.default = CommissionRateValue;
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbi1yYXRlLXZhbHVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbi1yYXRlLXZhbHVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEscURBQWlEO0FBRWpELHdFQUE4QztBQUU5QyxNQUFNLG1CQUFtQixHQUFHLGFBQUssQ0FBQyxNQUFNLENBQUMsdUJBQXVCLEVBQUU7SUFDaEUsRUFBRSxFQUFFLGFBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxNQUFNLEVBQUUsUUFBUSxFQUFFLENBQUMsQ0FBQyxVQUFVLEVBQUU7SUFDL0MsYUFBYSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUU7SUFDM0IsTUFBTSxFQUFFLGFBQUssQ0FBQyxTQUFTLEVBQUU7SUFDekIsZUFBZSxFQUFFLGFBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMseUJBQWMsRUFBRTtRQUNyRCxRQUFRLEVBQUUsUUFBUTtLQUNuQixDQUFDO0NBQ0gsQ0FBQyxDQUFBO0FBRUYsa0JBQWUsbUJBQW1CLENBQUEifQ==
@@ -1,21 +1,26 @@
1
- import { CommissionRateType, CommissionRateTarget } from "@mercurjs/types";
1
+ import { CommissionRateType } from "@mercurjs/types";
2
2
  declare const CommissionRate: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
3
3
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
4
4
  is_enabled: import("@medusajs/framework/utils").BooleanProperty;
5
- priority: import("@medusajs/framework/utils").NumberProperty;
5
+ is_default: import("@medusajs/framework/utils").BooleanProperty;
6
6
  currency_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
7
7
  name: import("@medusajs/framework/utils").TextProperty;
8
8
  code: import("@medusajs/framework/utils").TextProperty;
9
9
  type: import("@medusajs/framework/utils").EnumProperty<typeof CommissionRateType>;
10
- target: import("@medusajs/framework/utils").EnumProperty<typeof CommissionRateTarget>;
11
10
  value: import("@medusajs/framework/utils").BigNumberProperty;
12
- min_amount: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").BigNumberProperty>;
13
11
  include_tax: import("@medusajs/framework/utils").BooleanProperty;
12
+ include_shipping: import("@medusajs/framework/utils").BooleanProperty;
14
13
  rules: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
15
14
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
16
15
  reference: import("@medusajs/framework/utils").TextProperty;
17
16
  reference_id: import("@medusajs/framework/utils").TextProperty;
18
17
  commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
19
18
  }>, "commission_rule">>;
19
+ values: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
20
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
21
+ currency_code: import("@medusajs/framework/utils").TextProperty;
22
+ amount: import("@medusajs/framework/utils").BigNumberProperty;
23
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
24
+ }>, "commission_rate_value">>;
20
25
  }>, "commission_rate">;
21
26
  export default CommissionRate;
@@ -6,21 +6,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const utils_1 = require("@medusajs/framework/utils");
7
7
  const types_1 = require("@mercurjs/types");
8
8
  const commission_rule_1 = __importDefault(require("./commission-rule"));
9
+ const commission_rate_value_1 = __importDefault(require("./commission-rate-value"));
9
10
  const CommissionRate = utils_1.model.define("commission_rate", {
10
11
  id: utils_1.model.id({ prefix: "comrate" }).primaryKey(),
11
12
  is_enabled: utils_1.model.boolean().default(true),
12
- priority: utils_1.model.number().default(0),
13
+ is_default: utils_1.model.boolean().default(false),
13
14
  currency_code: utils_1.model.text().nullable(),
14
- name: utils_1.model.text(),
15
- code: utils_1.model.text().unique(),
15
+ name: utils_1.model.text().searchable(),
16
+ code: utils_1.model.text().unique().searchable(),
16
17
  type: utils_1.model.enum(types_1.CommissionRateType),
17
- target: utils_1.model.enum(types_1.CommissionRateTarget).default(types_1.CommissionRateTarget.ITEM),
18
18
  value: utils_1.model.bigNumber(),
19
- min_amount: utils_1.model.bigNumber().nullable(),
20
19
  include_tax: utils_1.model.boolean().default(false),
20
+ include_shipping: utils_1.model.boolean().default(false),
21
21
  rules: utils_1.model.hasMany(() => commission_rule_1.default, {
22
22
  mappedBy: "commission_rate",
23
23
  }),
24
+ values: utils_1.model.hasMany(() => commission_rate_value_1.default, {
25
+ mappedBy: "commission_rate",
26
+ }),
24
27
  });
25
28
  exports.default = CommissionRate;
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbi1yYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbi1yYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEscURBQWlEO0FBQ2pELDJDQUEwRTtBQUUxRSx3RUFBOEM7QUFFOUMsTUFBTSxjQUFjLEdBQUcsYUFBSyxDQUFDLE1BQU0sQ0FBQyxpQkFBaUIsRUFBRTtJQUNyRCxFQUFFLEVBQUUsYUFBSyxDQUFDLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUUsQ0FBQyxDQUFDLFVBQVUsRUFBRTtJQUNoRCxVQUFVLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUM7SUFDekMsUUFBUSxFQUFFLGFBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDO0lBQ25DLGFBQWEsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQ3RDLElBQUksRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ2xCLElBQUksRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsTUFBTSxFQUFFO0lBQzNCLElBQUksRUFBRSxhQUFLLENBQUMsSUFBSSxDQUFDLDBCQUFrQixDQUFDO0lBQ3BDLE1BQU0sRUFBRSxhQUFLLENBQUMsSUFBSSxDQUFDLDRCQUFvQixDQUFDLENBQUMsT0FBTyxDQUFDLDRCQUFvQixDQUFDLElBQUksQ0FBQztJQUMzRSxLQUFLLEVBQUUsYUFBSyxDQUFDLFNBQVMsRUFBRTtJQUN4QixVQUFVLEVBQUUsYUFBSyxDQUFDLFNBQVMsRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUN4QyxXQUFXLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUM7SUFDM0MsS0FBSyxFQUFFLGFBQUssQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUMseUJBQWMsRUFBRTtRQUN6QyxRQUFRLEVBQUUsaUJBQWlCO0tBQzVCLENBQUM7Q0FDSCxDQUFDLENBQUE7QUFFRixrQkFBZSxjQUFjLENBQUEifQ==
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWlzc2lvbi1yYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvY29tbWlzc2lvbi9tb2RlbHMvY29tbWlzc2lvbi1yYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEscURBQWlEO0FBQ2pELDJDQUFvRDtBQUVwRCx3RUFBOEM7QUFDOUMsb0ZBQXlEO0FBRXpELE1BQU0sY0FBYyxHQUFHLGFBQUssQ0FBQyxNQUFNLENBQUMsaUJBQWlCLEVBQUU7SUFDckQsRUFBRSxFQUFFLGFBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxVQUFVLEVBQUU7SUFDaEQsVUFBVSxFQUFFLGFBQUssQ0FBQyxPQUFPLEVBQUUsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDO0lBQ3pDLFVBQVUsRUFBRSxhQUFLLENBQUMsT0FBTyxFQUFFLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQztJQUMxQyxhQUFhLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUN0QyxJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFVBQVUsRUFBRTtJQUMvQixJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLE1BQU0sRUFBRSxDQUFDLFVBQVUsRUFBRTtJQUN4QyxJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksQ0FBQywwQkFBa0IsQ0FBQztJQUNwQyxLQUFLLEVBQUUsYUFBSyxDQUFDLFNBQVMsRUFBRTtJQUN4QixXQUFXLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUM7SUFDM0MsZ0JBQWdCLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUM7SUFDaEQsS0FBSyxFQUFFLGFBQUssQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUMseUJBQWMsRUFBRTtRQUN6QyxRQUFRLEVBQUUsaUJBQWlCO0tBQzVCLENBQUM7SUFDRixNQUFNLEVBQUUsYUFBSyxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQywrQkFBbUIsRUFBRTtRQUMvQyxRQUFRLEVBQUUsaUJBQWlCO0tBQzVCLENBQUM7Q0FDSCxDQUFDLENBQUE7QUFFRixrQkFBZSxjQUFjLENBQUEifQ==
@@ -5,16 +5,21 @@ declare const CommissionRule: import("@medusajs/framework/utils").DmlEntity<impo
5
5
  commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
6
6
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
7
7
  is_enabled: import("@medusajs/framework/utils").BooleanProperty;
8
- priority: import("@medusajs/framework/utils").NumberProperty;
8
+ is_default: import("@medusajs/framework/utils").BooleanProperty;
9
9
  currency_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
10
10
  name: import("@medusajs/framework/utils").TextProperty;
11
11
  code: import("@medusajs/framework/utils").TextProperty;
12
12
  type: import("@medusajs/framework/utils").EnumProperty<typeof import("@mercurjs/types").CommissionRateType>;
13
- target: import("@medusajs/framework/utils").EnumProperty<typeof import("@mercurjs/types").CommissionRateTarget>;
14
13
  value: import("@medusajs/framework/utils").BigNumberProperty;
15
- min_amount: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").BigNumberProperty>;
16
14
  include_tax: import("@medusajs/framework/utils").BooleanProperty;
15
+ include_shipping: import("@medusajs/framework/utils").BooleanProperty;
17
16
  rules: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rule">>;
17
+ values: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
18
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
19
+ currency_code: import("@medusajs/framework/utils").TextProperty;
20
+ amount: import("@medusajs/framework/utils").BigNumberProperty;
21
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
22
+ }>, "commission_rate_value">>;
18
23
  }>, "commission_rate">, undefined>;
19
24
  }>, "commission_rule">;
20
25
  export default CommissionRule;
@@ -1,3 +1,4 @@
1
1
  export { default as CommissionRate } from "./commission-rate";
2
2
  export { default as CommissionRule } from "./commission-rule";
3
+ export { default as CommissionRateValue } from "./commission-rate-value";
3
4
  export { default as CommissionLine } from "./commission-line";
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CommissionLine = exports.CommissionRule = exports.CommissionRate = void 0;
6
+ exports.CommissionLine = exports.CommissionRateValue = exports.CommissionRule = exports.CommissionRate = void 0;
7
7
  var commission_rate_1 = require("./commission-rate");
8
8
  Object.defineProperty(exports, "CommissionRate", { enumerable: true, get: function () { return __importDefault(commission_rate_1).default; } });
9
9
  var commission_rule_1 = require("./commission-rule");
10
10
  Object.defineProperty(exports, "CommissionRule", { enumerable: true, get: function () { return __importDefault(commission_rule_1).default; } });
11
+ var commission_rate_value_1 = require("./commission-rate-value");
12
+ Object.defineProperty(exports, "CommissionRateValue", { enumerable: true, get: function () { return __importDefault(commission_rate_value_1).default; } });
11
13
  var commission_line_1 = require("./commission-line");
12
14
  Object.defineProperty(exports, "CommissionLine", { enumerable: true, get: function () { return __importDefault(commission_line_1).default; } });
13
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL21vZGVscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxxREFBNkQ7QUFBcEQsa0lBQUEsT0FBTyxPQUFrQjtBQUNsQyxxREFBNkQ7QUFBcEQsa0lBQUEsT0FBTyxPQUFrQjtBQUNsQyxxREFBNkQ7QUFBcEQsa0lBQUEsT0FBTyxPQUFrQiJ9
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9jb21taXNzaW9uL21vZGVscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxxREFBNkQ7QUFBcEQsa0lBQUEsT0FBTyxPQUFrQjtBQUNsQyxxREFBNkQ7QUFBcEQsa0lBQUEsT0FBTyxPQUFrQjtBQUNsQyxpRUFBd0U7QUFBL0QsNklBQUEsT0FBTyxPQUF1QjtBQUN2QyxxREFBNkQ7QUFBcEQsa0lBQUEsT0FBTyxPQUFrQiJ9
@@ -1,25 +1,30 @@
1
- import { Context, DAL, InferEntityType, ModulesSdkTypes } from "@medusajs/framework/types";
2
- import { CommissionCalculationContext, CommissionLineDTO, CommissionRateType, CommissionRateTarget, CreateCommissionLineDTO, UpdateCommissionLineDTO } from "@mercurjs/types";
1
+ import { Context, DAL, FindConfig, InferEntityType, ModulesSdkTypes } from "@medusajs/framework/types";
2
+ import { CommissionCalculationContext, CommissionLineDTO, CommissionRateType, CreateCommissionLineDTO } from "@mercurjs/types";
3
3
  import { CommissionLine } from "./models";
4
4
  declare const CommissionModuleService_base: import("@medusajs/framework/utils").MedusaServiceReturnType<import("@medusajs/framework/utils").ModelConfigurationsToConfigTemplate<{
5
5
  readonly CommissionRate: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
6
6
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
7
7
  is_enabled: import("@medusajs/framework/utils").BooleanProperty;
8
- priority: import("@medusajs/framework/utils").NumberProperty;
8
+ is_default: import("@medusajs/framework/utils").BooleanProperty;
9
9
  currency_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
10
10
  name: import("@medusajs/framework/utils").TextProperty;
11
11
  code: import("@medusajs/framework/utils").TextProperty;
12
12
  type: import("@medusajs/framework/utils").EnumProperty<typeof CommissionRateType>;
13
- target: import("@medusajs/framework/utils").EnumProperty<typeof CommissionRateTarget>;
14
13
  value: import("@medusajs/framework/utils").BigNumberProperty;
15
- min_amount: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").BigNumberProperty>;
16
14
  include_tax: import("@medusajs/framework/utils").BooleanProperty;
15
+ include_shipping: import("@medusajs/framework/utils").BooleanProperty;
17
16
  rules: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
18
17
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
19
18
  reference: import("@medusajs/framework/utils").TextProperty;
20
19
  reference_id: import("@medusajs/framework/utils").TextProperty;
21
20
  commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
22
21
  }>, "commission_rule">>;
22
+ values: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
23
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
24
+ currency_code: import("@medusajs/framework/utils").TextProperty;
25
+ amount: import("@medusajs/framework/utils").BigNumberProperty;
26
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
27
+ }>, "commission_rate_value">>;
23
28
  }>, "commission_rate">;
24
29
  readonly CommissionRule: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
25
30
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
@@ -28,21 +33,51 @@ declare const CommissionModuleService_base: import("@medusajs/framework/utils").
28
33
  commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
29
34
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
30
35
  is_enabled: import("@medusajs/framework/utils").BooleanProperty;
31
- priority: import("@medusajs/framework/utils").NumberProperty;
36
+ is_default: import("@medusajs/framework/utils").BooleanProperty;
32
37
  currency_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
33
38
  name: import("@medusajs/framework/utils").TextProperty;
34
39
  code: import("@medusajs/framework/utils").TextProperty;
35
40
  type: import("@medusajs/framework/utils").EnumProperty<typeof CommissionRateType>;
36
- target: import("@medusajs/framework/utils").EnumProperty<typeof CommissionRateTarget>;
37
41
  value: import("@medusajs/framework/utils").BigNumberProperty;
38
- min_amount: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").BigNumberProperty>;
39
42
  include_tax: import("@medusajs/framework/utils").BooleanProperty;
43
+ include_shipping: import("@medusajs/framework/utils").BooleanProperty;
40
44
  rules: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rule">>;
45
+ values: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
46
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
47
+ currency_code: import("@medusajs/framework/utils").TextProperty;
48
+ amount: import("@medusajs/framework/utils").BigNumberProperty;
49
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
50
+ }>, "commission_rate_value">>;
41
51
  }>, "commission_rate">, undefined>;
42
52
  }>, "commission_rule">;
53
+ readonly CommissionRateValue: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
54
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
55
+ currency_code: import("@medusajs/framework/utils").TextProperty;
56
+ amount: import("@medusajs/framework/utils").BigNumberProperty;
57
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
58
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
59
+ is_enabled: import("@medusajs/framework/utils").BooleanProperty;
60
+ is_default: import("@medusajs/framework/utils").BooleanProperty;
61
+ currency_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
62
+ name: import("@medusajs/framework/utils").TextProperty;
63
+ code: import("@medusajs/framework/utils").TextProperty;
64
+ type: import("@medusajs/framework/utils").EnumProperty<typeof CommissionRateType>;
65
+ value: import("@medusajs/framework/utils").BigNumberProperty;
66
+ include_tax: import("@medusajs/framework/utils").BooleanProperty;
67
+ include_shipping: import("@medusajs/framework/utils").BooleanProperty;
68
+ rules: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
69
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
70
+ reference: import("@medusajs/framework/utils").TextProperty;
71
+ reference_id: import("@medusajs/framework/utils").TextProperty;
72
+ commission_rate: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate">, undefined>;
73
+ }>, "commission_rule">>;
74
+ values: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "commission_rate_value">>;
75
+ }>, "commission_rate">, undefined>;
76
+ }>, "commission_rate_value">;
43
77
  readonly CommissionLine: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
44
78
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
45
- item_id: import("@medusajs/framework/utils").TextProperty;
79
+ item_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
80
+ shipping_method_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
46
81
  commission_rate_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
47
82
  code: import("@medusajs/framework/utils").TextProperty;
48
83
  rate: import("@medusajs/framework/utils").FloatProperty;
@@ -57,7 +92,132 @@ declare class CommissionModuleService extends CommissionModuleService_base {
57
92
  commissionLineService: any;
58
93
  baseRepository: any;
59
94
  });
95
+ /**
96
+ * Does a single rule match a product?
97
+ */
98
+ private ruleMatchesProduct;
99
+ /**
100
+ * A rate matches an item when **every** present dimension group (rules
101
+ * grouped by `reference`) has at least one matching rule
102
+ * (AND-across-dimension, OR-within-dimension). A rule-less rate is the
103
+ * default and matches everything.
104
+ */
105
+ private rateMatchesItem;
106
+ /**
107
+ * Specificity = number of distinct dimension groups a rate scopes on.
108
+ * More dimensions → higher specificity → wins the tie-break.
109
+ */
110
+ private rateSpecificity;
111
+ /**
112
+ * Resolve the commission amount + line `rate` for a base amount.
113
+ * Percentage uses the scalar `value`; Fixed reads the per-currency
114
+ * `values` (falling back to the legacy single `value`).
115
+ */
116
+ private computeCommission;
60
117
  getCommissionLines(context: CommissionCalculationContext, sharedContext?: Context): Promise<CreateCommissionLineDTO[]>;
61
- upsertCommissionLines(commissionLines: (CreateCommissionLineDTO | UpdateCommissionLineDTO)[], sharedContext?: Context): Promise<CommissionLineDTO[]>;
118
+ /**
119
+ * Overrides the auto-generated upsert with idempotent **replace**
120
+ * semantics keyed on the line's anchor (item_id / shipping_method_id):
121
+ * delete any existing lines for the incoming anchors, then insert the new
122
+ * set, in a single transaction. The computed lines carry no `id`, so a
123
+ * plain primary-key upsert would duplicate them on every refresh; deleting
124
+ * by anchor first makes re-running the refresh idempotent.
125
+ */
126
+ upsertCommissionLines(commissionLines: CreateCommissionLineDTO[], sharedContext?: Context): Promise<CommissionLineDTO[]>;
127
+ /**
128
+ * Build a DB-side predicate for the virtual `scope_type` filter (rule
129
+ * scope: "store", "product_type", "category", "store_product_type",
130
+ * "store_category"). Scope type is derived from the set of rule
131
+ * `reference`s rather than stored, so each option maps to an
132
+ * EXISTS / NOT EXISTS combination on `commission_rule` that mirrors the
133
+ * admin-side `deriveScopeType`. Multiple selected scopes are OR-ed.
134
+ */
135
+ private buildScopeTypeWhere_;
136
+ /**
137
+ * Strip the virtual `scope_type` key and rewrite it into a `raw()`
138
+ * correlated-subquery predicate so the filtering happens in the database,
139
+ * not in the route handler.
140
+ */
141
+ private applyScopeTypeFilter_;
142
+ /**
143
+ * Auto-generate a unique `code` from the rate `name` when one is not
144
+ * provided, before delegating to the generated create. Accepts a single
145
+ * payload or an array and preserves the caller's shape.
146
+ */
147
+ createCommissionRates(data: any, sharedContext?: Context): Promise<any>;
148
+ listCommissionRates(filters?: any, config?: FindConfig<any>, sharedContext?: Context): Promise<{
149
+ id: string;
150
+ is_enabled: boolean;
151
+ is_default: boolean;
152
+ currency_code: string | null;
153
+ name: string;
154
+ code: string;
155
+ type: CommissionRateType;
156
+ value: number;
157
+ include_tax: boolean;
158
+ include_shipping: boolean;
159
+ rules: {
160
+ id: string;
161
+ reference: string;
162
+ reference_id: string;
163
+ commission_rate: /*elided*/ any;
164
+ created_at: Date;
165
+ updated_at: Date;
166
+ deleted_at: Date | null;
167
+ commission_rate_id: string;
168
+ }[];
169
+ values: {
170
+ id: string;
171
+ currency_code: string;
172
+ amount: number;
173
+ commission_rate: /*elided*/ any;
174
+ raw_amount: Record<string, unknown>;
175
+ created_at: Date;
176
+ updated_at: Date;
177
+ deleted_at: Date | null;
178
+ commission_rate_id: string;
179
+ }[];
180
+ raw_value: Record<string, unknown>;
181
+ created_at: Date;
182
+ updated_at: Date;
183
+ deleted_at: Date | null;
184
+ }[]>;
185
+ listAndCountCommissionRates(filters?: any, config?: FindConfig<any>, sharedContext?: Context): Promise<[{
186
+ id: string;
187
+ is_enabled: boolean;
188
+ is_default: boolean;
189
+ currency_code: string | null;
190
+ name: string;
191
+ code: string;
192
+ type: CommissionRateType;
193
+ value: number;
194
+ include_tax: boolean;
195
+ include_shipping: boolean;
196
+ rules: {
197
+ id: string;
198
+ reference: string;
199
+ reference_id: string;
200
+ commission_rate: /*elided*/ any;
201
+ created_at: Date;
202
+ updated_at: Date;
203
+ deleted_at: Date | null;
204
+ commission_rate_id: string;
205
+ }[];
206
+ values: {
207
+ id: string;
208
+ currency_code: string;
209
+ amount: number;
210
+ commission_rate: /*elided*/ any;
211
+ raw_amount: Record<string, unknown>;
212
+ created_at: Date;
213
+ updated_at: Date;
214
+ deleted_at: Date | null;
215
+ commission_rate_id: string;
216
+ }[];
217
+ raw_value: Record<string, unknown>;
218
+ created_at: Date;
219
+ updated_at: Date;
220
+ deleted_at: Date | null;
221
+ }[], number]>;
62
222
  }
63
223
  export default CommissionModuleService;