@mercurjs/admin 2.2.0-canary.20 → 2.2.0-canary.22

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 (155) hide show
  1. package/dist/{add-campaign-promotions-BNLH6QN5.js → add-campaign-promotions-2IOKLEMG.js} +3 -3
  2. package/dist/{adjust-inventory-2LHBQAWK.js → adjust-inventory-KNHM7QEV.js} +6 -6
  3. package/dist/{api-key-management-detail-R5QQPNOD.js → api-key-management-detail-ELMPBXEB.js} +7 -7
  4. package/dist/{attribute-create-JW7OXOK2.js → attribute-create-Q3IEGYRG.js} +6 -6
  5. package/dist/{attribute-detail-3Z6MTMJT.js → attribute-detail-SDYWELHS.js} +6 -6
  6. package/dist/{attribute-list-WRTXTFED.js → attribute-list-HW3R6764.js} +6 -6
  7. package/dist/{campaign-detail-ROTJ4SWD.js → campaign-detail-5WNSQVKG.js} +10 -10
  8. package/dist/{categories-metadata-EPKUI3R4.js → categories-metadata-INVMU224.js} +6 -6
  9. package/dist/{category-detail-ICACLNJ3.js → category-detail-ABK4MEZP.js} +6 -6
  10. package/dist/{category-products-V4H3B6ML.js → category-products-HTNBFHSW.js} +6 -6
  11. package/dist/{chunk-A7RM5JXC.js → chunk-2H3KXP53.js} +1 -1
  12. package/dist/{chunk-KZB7LCF2.js → chunk-3EQOAHVG.js} +1 -1
  13. package/dist/{chunk-VKOE5J66.js → chunk-3XOE4NV5.js} +11 -2
  14. package/dist/{chunk-7XBB24GO.js → chunk-3ZCBTIIC.js} +1 -1
  15. package/dist/{chunk-SNCZQATG.js → chunk-4GRFDNQQ.js} +2 -2
  16. package/dist/{chunk-4Q5JHL4V.js → chunk-4O7GPTNJ.js} +1 -1
  17. package/dist/{chunk-AGXO2H4E.js → chunk-5PWXUMCA.js} +1 -1
  18. package/dist/{chunk-2HMWS5UW.js → chunk-67RX3M6X.js} +154 -23
  19. package/dist/{chunk-2MYHGOPY.js → chunk-7IVRL4AF.js} +1 -1
  20. package/dist/{chunk-7VPJ4C6F.js → chunk-7PAVVX2P.js} +1 -1
  21. package/dist/{chunk-HR7TFO2X.js → chunk-A3IFGUDD.js} +3 -3
  22. package/dist/{chunk-CMHI2RPL.js → chunk-AKSUGT5I.js} +21 -0
  23. package/dist/{chunk-7JZVZ5EX.js → chunk-ARN66CDK.js} +1 -1
  24. package/dist/{chunk-JEJQKTZO.js → chunk-ASNNJIW7.js} +2 -2
  25. package/dist/{chunk-RXRDZ47F.js → chunk-BHJFT3ST.js} +3 -3
  26. package/dist/chunk-BN6OOLJA.js +358 -0
  27. package/dist/{chunk-WETV577Q.js → chunk-CPWOVYZE.js} +1 -1
  28. package/dist/{chunk-JQV7CXEC.js → chunk-EDDKIVMF.js} +17 -2
  29. package/dist/{chunk-2NA54XKC.js → chunk-FP6YPFKF.js} +80 -7
  30. package/dist/{chunk-SJKLYS3R.js → chunk-IO5S4RFO.js} +3 -3
  31. package/dist/{chunk-HI6L7DXI.js → chunk-K7EOVKKV.js} +1 -1
  32. package/dist/{chunk-FFNSWUDC.js → chunk-LNPJFQWA.js} +11 -4
  33. package/dist/{chunk-KXIA66EJ.js → chunk-PAEKCYFU.js} +7 -3
  34. package/dist/{chunk-EG45GIE3.js → chunk-PAGH4K4C.js} +47 -14
  35. package/dist/{chunk-MHVZVF6O.js → chunk-PT3DTHQK.js} +1 -1
  36. package/dist/{chunk-PRBE5CM3.js → chunk-QYDWMBEX.js} +31 -0
  37. package/dist/{chunk-Z3SUMFDT.js → chunk-R2UDZINP.js} +214 -38
  38. package/dist/{chunk-Z2UBJXTU.js → chunk-RDTFLHYO.js} +1 -1
  39. package/dist/{chunk-IER5BQNC.js → chunk-RXZZEPW3.js} +1 -1
  40. package/dist/{chunk-BGQ7H2KL.js → chunk-SMQM5N45.js} +2 -2
  41. package/dist/{chunk-PN5C4AND.js → chunk-STPSVH3T.js} +1 -1
  42. package/dist/{chunk-I5THQVYP.js → chunk-XIFE4VUR.js} +1 -1
  43. package/dist/{chunk-4VXYPZMT.js → chunk-Z7AXFQPD.js} +2 -2
  44. package/dist/{chunk-PWFZCT6H.js → chunk-ZIIZGCTQ.js} +1 -1
  45. package/dist/{collection-add-products-PBCIG33C.js → collection-add-products-CKF2VFVK.js} +6 -6
  46. package/dist/{collection-create-7G3MHBVQ.js → collection-create-UNGPKT7H.js} +83 -12
  47. package/dist/{collection-detail-3OLBOV24.js → collection-detail-36QTD3ZU.js} +9 -7
  48. package/dist/collection-icon-edit-V4SNBMD5.js +117 -0
  49. package/dist/{collection-list-S4ICG5T6.js → collection-list-UN7C36DU.js} +15 -12
  50. package/dist/collection-media-ESJUYVF7.js +654 -0
  51. package/dist/{collection-metadata-VUOECEP4.js → collection-metadata-6SD67JUV.js} +6 -6
  52. package/dist/{commission-rule-commission-edit-TA3H3EEN.js → commission-rule-commission-edit-EAOSJNA2.js} +3 -3
  53. package/dist/{commission-rule-create-O7Z25SC7.js → commission-rule-create-X3AYVCQG.js} +183 -67
  54. package/dist/{commission-rule-detail-I7LVSNAM.js → commission-rule-detail-EITJYZG5.js} +3 -3
  55. package/dist/{commission-rule-edit-YSHDTYZY.js → commission-rule-edit-FZLHYL4A.js} +2 -2
  56. package/dist/{commissions-list-OUGVPED6.js → commissions-list-TT2ITT75.js} +4 -3
  57. package/dist/{customer-create-RW63XPQ6.js → customer-create-HZXLOIZH.js} +1 -1
  58. package/dist/{customer-create-address-SZCOIGDP.js → customer-create-address-AEZNVQOG.js} +1 -1
  59. package/dist/{customer-detail-MT2R7DFI.js → customer-detail-3OQ7RSDN.js} +9 -13
  60. package/dist/{customer-edit-ZBIZ4FKT.js → customer-edit-MMRTWOAF.js} +1 -1
  61. package/dist/customer-edit-address-AEYX2LMP.js +302 -0
  62. package/dist/{customer-group-add-customers-SG7EU4D7.js → customer-group-add-customers-4OAYSXWK.js} +2 -2
  63. package/dist/{customer-group-create-LFGY5HR6.js → customer-group-create-25JT74S3.js} +1 -1
  64. package/dist/{customer-group-detail-MCAEXZYM.js → customer-group-detail-CH4UIK3X.js} +8 -8
  65. package/dist/{customer-group-edit-CXWQSMDZ.js → customer-group-edit-AAI47MUL.js} +1 -1
  66. package/dist/{customer-group-list-V4PW33M5.js → customer-group-list-777C2B57.js} +9 -9
  67. package/dist/{customer-group-metadata-J622TR4I.js → customer-group-metadata-ELFKJMYK.js} +6 -6
  68. package/dist/{customer-list-MB6WZFMA.js → customer-list-U7VFBV7E.js} +3 -3
  69. package/dist/{customer-metadata-SFS5VRK5.js → customer-metadata-4H6ADARR.js} +6 -6
  70. package/dist/{customers-add-customer-group-G6FIKKUP.js → customers-add-customer-group-AZ3ILZMA.js} +8 -8
  71. package/dist/{edit-inventory-item-OFPVTJ4I.js → edit-inventory-item-NL5WNNI3.js} +6 -6
  72. package/dist/{edit-inventory-item-attributes-Z37AFIYM.js → edit-inventory-item-attributes-2JEH72WW.js} +6 -6
  73. package/dist/{edit-rules-JG62MLUS.js → edit-rules-XYTK7DQ2.js} +6 -6
  74. package/dist/{global-commission-edit-LCD6JJUX.js → global-commission-edit-3CEVUAAP.js} +46 -29
  75. package/dist/index.js +163 -151
  76. package/dist/{inventory-create-3IM54ZO3.js → inventory-create-7RQSCNCQ.js} +6 -6
  77. package/dist/{inventory-detail-POKYZVLA.js → inventory-detail-W7BGKWKL.js} +6 -6
  78. package/dist/{inventory-metadata-XXYKRUNP.js → inventory-metadata-ZGLTDSQB.js} +6 -6
  79. package/dist/{inventory-stock-CXPPGARO.js → inventory-stock-US7LGBC4.js} +6 -6
  80. package/dist/{location-detail-PHT367V5.js → location-detail-GAINHCV5.js} +6 -6
  81. package/dist/{location-fulfillment-providers-EZOVLJWL.js → location-fulfillment-providers-6DFBFALS.js} +8 -8
  82. package/dist/{location-list-HVSRDHOW.js → location-list-QXIHD6NJ.js} +6 -6
  83. package/dist/{location-service-zone-shipping-option-create-VZBL7MK6.js → location-service-zone-shipping-option-create-AUNZVIGU.js} +6 -6
  84. package/dist/{login-LJMTSRAG.js → login-NFPUZDAL.js} +6 -6
  85. package/dist/{marketplace-detail-WINAJJDB.js → marketplace-detail-M7DWNMIH.js} +6 -6
  86. package/dist/{marketplace-metadata-CCUK2B4Q.js → marketplace-metadata-FYJ7TJLZ.js} +6 -6
  87. package/dist/{offers-5LSNWJ6B.js → offers-PYM6LQSX.js} +6 -6
  88. package/dist/{order-create-exchange-6IQJFYUK.js → order-create-exchange-4PWNGE6U.js} +6 -6
  89. package/dist/{order-create-refund-DUVGD54U.js → order-create-refund-A4AXOFZC.js} +6 -6
  90. package/dist/{order-detail-Y6SFV44C.js → order-detail-HPYAUA2N.js} +7 -7
  91. package/dist/{order-edit-billing-address-IW6UIARN.js → order-edit-billing-address-5XHAAGT7.js} +7 -7
  92. package/dist/{order-edit-email-D5XIYASI.js → order-edit-email-44O3ARQ4.js} +6 -6
  93. package/dist/{order-edit-shipping-address-4VJDVGKJ.js → order-edit-shipping-address-UI2AHBXW.js} +6 -6
  94. package/dist/{order-list-KWHMMX2M.js → order-list-IVXCYRGB.js} +4 -4
  95. package/dist/{order-metadata-QSTGFW66.js → order-metadata-3U5KT3MW.js} +6 -6
  96. package/dist/{order-request-transfer-GYBTSHU4.js → order-request-transfer-OM3BPIWZ.js} +6 -6
  97. package/dist/pages/index.d.ts +33 -9
  98. package/dist/pages/index.js +95 -94
  99. package/dist/{price-list-configuration-SNL2LNV2.js → price-list-configuration-6LD6DTEQ.js} +6 -5
  100. package/dist/{price-list-create-LPJWSOBP.js → price-list-create-SR24HYH3.js} +11 -11
  101. package/dist/{price-list-detail-7AUDNRSM.js → price-list-detail-QIMJQ6DD.js} +9 -9
  102. package/dist/{price-list-edit-BOEBNVGM.js → price-list-edit-MEM47NGY.js} +2 -2
  103. package/dist/{price-list-list-AX7ZW6LL.js → price-list-list-GIVZGIYW.js} +4 -4
  104. package/dist/{price-list-prices-add-5IOYBCXV.js → price-list-prices-add-VE5RTT5O.js} +7 -7
  105. package/dist/{price-list-prices-edit-DT2DLFTO.js → price-list-prices-edit-R52K4MBL.js} +7 -7
  106. package/dist/{product-add-existing-attributes-LNZK2LHX.js → product-add-existing-attributes-AC4643LI.js} +6 -6
  107. package/dist/{product-create-QYEZHBTC.js → product-create-LY3HDOLG.js} +9 -9
  108. package/dist/{product-detail-Q6YF7IYX.js → product-detail-77DV4TAW.js} +6 -6
  109. package/dist/{product-list-IDRT4WUK.js → product-list-4JGMM4AF.js} +6 -6
  110. package/dist/{product-media-6H34CVXJ.js → product-media-PWPVCTC2.js} +2 -2
  111. package/dist/{product-metadata-VJMZL753.js → product-metadata-H53ZIWBS.js} +6 -6
  112. package/dist/{product-tag-create-4FYE46PE.js → product-tag-create-4OT4PMCG.js} +6 -6
  113. package/dist/{product-tag-detail-WF34TUQR.js → product-tag-detail-NVTDW7BR.js} +15 -13
  114. package/dist/{product-tag-edit-HRWMMCUC.js → product-tag-edit-RXF6ZZ6E.js} +6 -6
  115. package/dist/{product-tag-list-PK43EMMH.js → product-tag-list-T6BDTH24.js} +15 -13
  116. package/dist/{product-tag-metadata-ONSEQTEW.js → product-tag-metadata-HN5QRCYY.js} +6 -6
  117. package/dist/{product-type-detail-J466AJUQ.js → product-type-detail-KOGHJIMG.js} +6 -6
  118. package/dist/{product-type-metadata-CXYKP2OF.js → product-type-metadata-QUCMB3ZJ.js} +6 -6
  119. package/dist/{product-variant-detail-FXQZLB7Q.js → product-variant-detail-6XBLXEXQ.js} +6 -6
  120. package/dist/{product-variant-edit-CYEISGII.js → product-variant-edit-3KAFS4OC.js} +6 -6
  121. package/dist/{product-variant-metadata-YQ2GKWW7.js → product-variant-metadata-N5H2VPGQ.js} +6 -6
  122. package/dist/{promotion-create-KNK57JWD.js → promotion-create-Y2XVWGAT.js} +6 -6
  123. package/dist/{promotion-detail-EUQ5LK2V.js → promotion-detail-ORDL76NG.js} +9 -9
  124. package/dist/{promotion-list-M5SAE7A3.js → promotion-list-NMD23NXJ.js} +4 -4
  125. package/dist/{refund-reason-create-ANAVZO2N.js → refund-reason-create-CIXYHBRC.js} +6 -6
  126. package/dist/{refund-reason-edit-HKEVJ6A5.js → refund-reason-edit-AXMEDPRT.js} +6 -6
  127. package/dist/{refund-reason-list-FBH43XVP.js → refund-reason-list-F56TJAGR.js} +13 -11
  128. package/dist/{region-metadata-XHT3A6D7.js → region-metadata-QGH7IBQU.js} +6 -6
  129. package/dist/{reservation-detail-T3VHDWP6.js → reservation-detail-7TL2OFEM.js} +6 -6
  130. package/dist/{reservation-metadata-4LVLM4UW.js → reservation-metadata-UXACXYO6.js} +6 -6
  131. package/dist/{reset-password-RF5J4RIU.js → reset-password-GA3NEKEX.js} +1 -1
  132. package/dist/{return-reason-list-4JWWSFOS.js → return-reason-list-EJ5DLDR2.js} +7 -5
  133. package/dist/{sales-channel-add-products-FNJQKCQQ.js → sales-channel-add-products-7ERGMGJ7.js} +6 -6
  134. package/dist/{sales-channel-detail-HXJAR6M4.js → sales-channel-detail-LWVBJCJQ.js} +6 -6
  135. package/dist/{sales-channel-list-YYIH254X.js → sales-channel-list-I72W2XTH.js} +6 -6
  136. package/dist/{sales-channel-metadata-YF5AV2XX.js → sales-channel-metadata-RD6QDHRW.js} +6 -6
  137. package/dist/{shipping-option-type-create-TOONS7EC.js → shipping-option-type-create-LXYYXNSQ.js} +6 -6
  138. package/dist/{shipping-option-type-detail-VXZ4UQQI.js → shipping-option-type-detail-2IQSQ5BQ.js} +6 -6
  139. package/dist/{shipping-option-type-edit-6WO2XRLE.js → shipping-option-type-edit-4XKXWCN3.js} +6 -6
  140. package/dist/{shipping-option-type-list-S7TW7Q3R.js → shipping-option-type-list-QA2TA7XQ.js} +6 -6
  141. package/dist/{shipping-profile-metadata-SVD3WK7H.js → shipping-profile-metadata-PVNYV7DY.js} +6 -6
  142. package/dist/{store-create-7A5OSRIV.js → store-create-F6W5CSH2.js} +6 -6
  143. package/dist/{store-details-LSGSI4QU.js → store-details-CSHIHCVO.js} +10 -10
  144. package/dist/{store-edit-TP5CQHV7.js → store-edit-QJXV27DI.js} +2 -2
  145. package/dist/{store-list-KQGPNQQ4.js → store-list-FGLLHZPD.js} +10 -10
  146. package/dist/{tax-region-create-JR7OHOJ5.js → tax-region-create-MS6G5YVE.js} +7 -7
  147. package/dist/{tax-region-detail-2E56T5C2.js → tax-region-detail-EU5U3SFN.js} +6 -6
  148. package/dist/{tax-region-edit-7SBQFGPY.js → tax-region-edit-XHO3ELVD.js} +6 -6
  149. package/dist/{tax-region-metadata-4NUEQV3N.js → tax-region-metadata-NYTCYO6D.js} +6 -6
  150. package/dist/{tax-region-province-detail-5Q5E5OP7.js → tax-region-province-detail-U4RULBEK.js} +6 -6
  151. package/dist/{tax-region-tax-override-create-S5S5JZEJ.js → tax-region-tax-override-create-5MIAKHY6.js} +15 -13
  152. package/dist/{tax-region-tax-override-edit-JBG3MRNC.js → tax-region-tax-override-edit-EHLIO56A.js} +15 -13
  153. package/dist/{user-metadata-2D552EAR.js → user-metadata-VCWUSKHV.js} +6 -6
  154. package/package.json +1 -1
  155. package/dist/{chunk-WTPWO7KS.js → chunk-KAAUSK5T.js} +3 -3
@@ -1,17 +1,20 @@
1
1
  import {
2
2
  useDeleteCommissionRuleAction,
3
3
  useScopeReferenceNames
4
- } from "./chunk-RXRDZ47F.js";
4
+ } from "./chunk-BHJFT3ST.js";
5
5
  import {
6
6
  formatCommissionValue,
7
7
  getIsActiveProps,
8
8
  getScopeSummary,
9
9
  getScopeTypeLabel
10
- } from "./chunk-PN5C4AND.js";
10
+ } from "./chunk-STPSVH3T.js";
11
11
  import {
12
12
  TextCell,
13
13
  TextHeader
14
14
  } from "./chunk-JHIMVLB2.js";
15
+ import {
16
+ StatusCell
17
+ } from "./chunk-DB6ANJBO.js";
15
18
  import {
16
19
  _DataTable,
17
20
  useDataTable
@@ -130,7 +133,6 @@ import { Container as Container2 } from "@medusajs/ui";
130
133
 
131
134
  // src/pages/commissions/commissions-list/components/commission-rules-table/commission-rules-data-table.tsx
132
135
  import { PencilSquare as PencilSquare2, Trash } from "@medusajs/icons";
133
- import { StatusBadge } from "@medusajs/ui";
134
136
  import { keepPreviousData } from "@tanstack/react-query";
135
137
  import { createColumnHelper } from "@tanstack/react-table";
136
138
  import { useMemo as useMemo2 } from "react";
@@ -144,18 +146,39 @@ var useCommissionRulesFilters = () => {
144
146
  return useMemo(
145
147
  () => [
146
148
  {
147
- key: "type",
148
- label: t("commissions.fields.type.label", "Type"),
149
+ key: "scope_type",
150
+ label: t("commissions.fields.scopeType.label", "Type"),
149
151
  type: "select",
150
152
  multiple: true,
151
153
  options: [
152
154
  {
153
- label: t("commissions.fields.type.percentage", "Percentage"),
154
- value: "percentage"
155
+ label: t("commissions.fields.scopeType.store", "Store"),
156
+ value: "store"
157
+ },
158
+ {
159
+ label: t(
160
+ "commissions.fields.scopeType.productType",
161
+ "Product Type"
162
+ ),
163
+ value: "product_type"
164
+ },
165
+ {
166
+ label: t("commissions.fields.scopeType.category", "Category"),
167
+ value: "category"
155
168
  },
156
169
  {
157
- label: t("commissions.fields.type.fixed", "Fixed"),
158
- value: "fixed"
170
+ label: t(
171
+ "commissions.fields.scopeType.storeProductType",
172
+ "Store + Product Type"
173
+ ),
174
+ value: "store_product_type"
175
+ },
176
+ {
177
+ label: t(
178
+ "commissions.fields.scopeType.storeCategory",
179
+ "Store + Category"
180
+ ),
181
+ value: "store_category"
159
182
  }
160
183
  ]
161
184
  },
@@ -182,17 +205,17 @@ var useCommissionRulesQuery = ({
182
205
  pageSize = 20
183
206
  } = {}) => {
184
207
  const queryObject = useQueryParams(
185
- ["offset", "q", "order", "is_enabled", "type"],
208
+ ["offset", "q", "order", "is_enabled", "scope_type"],
186
209
  prefix
187
210
  );
188
- const { offset, q, order, is_enabled, type } = queryObject;
211
+ const { offset, q, order, is_enabled, scope_type } = queryObject;
189
212
  const searchParams = {
190
213
  limit: pageSize,
191
214
  offset: offset ? Number(offset) : 0,
192
215
  order: order || void 0,
193
216
  q: q || void 0,
194
217
  is_enabled: is_enabled ? is_enabled === "true" : void 0,
195
- type: type ? type.split(",") : void 0
218
+ scope_type: scope_type ? scope_type.split(",") : void 0
196
219
  };
197
220
  return { searchParams, raw: queryObject };
198
221
  };
@@ -220,7 +243,10 @@ var CommissionRulesDataTable = () => {
220
243
  placeholderData: keepPreviousData
221
244
  }
222
245
  );
223
- const data = commission_rates ?? [];
246
+ const data = useMemo2(
247
+ () => commission_rates ?? [],
248
+ [commission_rates]
249
+ );
224
250
  const allRules = useMemo2(
225
251
  () => data.flatMap((rate) => rate.rules ?? []),
226
252
  [data]
@@ -249,6 +275,13 @@ var CommissionRulesDataTable = () => {
249
275
  queryObject: raw,
250
276
  filters,
251
277
  navigateTo: (row) => `${row.original.id}`,
278
+ noRecords: {
279
+ title: t("commissions.rules.empty.heading", "No commission rules yet"),
280
+ message: t(
281
+ "commissions.rules.empty.description",
282
+ "Create a commission rule to override the global commission for specific stores, product types, or categories."
283
+ )
284
+ },
252
285
  pagination: true,
253
286
  search: true,
254
287
  orderBy: [
@@ -316,7 +349,7 @@ var useColumns = (names) => {
316
349
  header: () => /* @__PURE__ */ jsx2(TextHeader, { text: t("commissions.rules.columns.status", "Status") }),
317
350
  cell: ({ getValue }) => {
318
351
  const props = getIsActiveProps(getValue(), t);
319
- return /* @__PURE__ */ jsx2(StatusBadge, { color: props.color, children: props.label });
352
+ return /* @__PURE__ */ jsx2(StatusCell, { color: props.color, children: props.label });
320
353
  }
321
354
  }),
322
355
  columnHelper.display({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useDeletePriceList
3
- } from "./chunk-Z2UBJXTU.js";
3
+ } from "./chunk-RDTFLHYO.js";
4
4
 
5
5
  // src/pages/price-lists/common/hooks/use-delete-price-list-action.tsx
6
6
  import { toast, usePrompt } from "@medusajs/ui";
@@ -230,6 +230,24 @@ var useCreateCustomerAddress = (id, options) => {
230
230
  ...options
231
231
  });
232
232
  };
233
+ var useUpdateCustomerAddress = (id, addressId, options) => {
234
+ return useMutation2({
235
+ mutationFn: (payload) => sdk.admin.customers.$id.addresses.$addressId.mutate({
236
+ $id: id,
237
+ $addressId: addressId,
238
+ ...payload
239
+ }),
240
+ onSuccess: (data, variables, context) => {
241
+ queryClient.invalidateQueries({ queryKey: customersQueryKeys.lists() });
242
+ queryClient.invalidateQueries({ queryKey: customersQueryKeys.detail(id) });
243
+ queryClient.invalidateQueries({
244
+ queryKey: customerAddressesQueryKeys.list(id)
245
+ });
246
+ options?.onSuccess?.(data, variables, context);
247
+ },
248
+ ...options
249
+ });
250
+ };
233
251
  var useDeleteCustomerAddress = (id, options) => {
234
252
  return useMutation2({
235
253
  mutationFn: (addressId) => sdk.admin.customers.$id.addresses.$addressId.delete({
@@ -247,6 +265,17 @@ var useDeleteCustomerAddress = (id, options) => {
247
265
  ...options
248
266
  });
249
267
  };
268
+ var useCustomerAddress = (id, addressId, options) => {
269
+ const { data, ...rest } = useQuery2({
270
+ queryFn: () => sdk.admin.customers.$id.addresses.$addressId.query({
271
+ $id: id,
272
+ $addressId: addressId
273
+ }),
274
+ queryKey: customerAddressesQueryKeys.detail(id),
275
+ ...options
276
+ });
277
+ return { ...data, ...rest };
278
+ };
250
279
 
251
280
  export {
252
281
  useCustomer,
@@ -256,7 +285,9 @@ export {
256
285
  useDeleteCustomer,
257
286
  useBatchCustomerCustomerGroups,
258
287
  useCreateCustomerAddress,
288
+ useUpdateCustomerAddress,
259
289
  useDeleteCustomerAddress,
290
+ useCustomerAddress,
260
291
  customerGroupsQueryKeys,
261
292
  useCustomerGroup,
262
293
  useCustomerGroups,
@@ -1,21 +1,32 @@
1
- import {
2
- useOrderTableColumns
3
- } from "./chunk-DBYUB2YI.js";
4
- import {
5
- useOrderTableFilters
6
- } from "./chunk-J3AMUGGZ.js";
7
1
  import {
8
2
  useCustomerGroupTableColumns
9
3
  } from "./chunk-54EPH67T.js";
10
4
  import {
11
5
  useCustomerGroupTableFilters
12
- } from "./chunk-CMHI2RPL.js";
6
+ } from "./chunk-AKSUGT5I.js";
13
7
  import {
14
8
  useOrderTableQuery
15
9
  } from "./chunk-QUHSHIAC.js";
16
10
  import {
17
11
  useCustomerGroupTableQuery
18
- } from "./chunk-VKOE5J66.js";
12
+ } from "./chunk-3XOE4NV5.js";
13
+ import {
14
+ FulfillmentStatusCell,
15
+ FulfillmentStatusHeader,
16
+ PaymentStatusCell,
17
+ PaymentStatusHeader
18
+ } from "./chunk-TZSOL34K.js";
19
+ import {
20
+ DateCell,
21
+ DateHeader
22
+ } from "./chunk-25LYVP3C.js";
23
+ import {
24
+ getStylizedAmount
25
+ } from "./chunk-PXYDR7WQ.js";
26
+ import {
27
+ TextCell,
28
+ TextHeader
29
+ } from "./chunk-JHIMVLB2.js";
19
30
  import {
20
31
  _DataTable,
21
32
  useDataTable
@@ -27,8 +38,8 @@ import {
27
38
  TwoColumnPage
28
39
  } from "./chunk-E74OUNA3.js";
29
40
  import {
30
- useOrders
31
- } from "./chunk-RMAQKNBA.js";
41
+ useOrderGroups
42
+ } from "./chunk-VYMODH6P.js";
32
43
  import {
33
44
  useBatchCustomerCustomerGroups,
34
45
  useCustomer,
@@ -36,7 +47,7 @@ import {
36
47
  useDeleteCustomer,
37
48
  useDeleteCustomerAddress,
38
49
  useRemoveCustomersFromGroup
39
- } from "./chunk-PRBE5CM3.js";
50
+ } from "./chunk-QYDWMBEX.js";
40
51
  import {
41
52
  ActionMenu
42
53
  } from "./chunk-BDGZ4EQO.js";
@@ -49,9 +60,9 @@ import { Children } from "react";
49
60
  import { useLoaderData, useParams } from "react-router-dom";
50
61
 
51
62
  // src/pages/customers/customer-detail/components/customer-address-section/customer-address-section.tsx
52
- import { clx, Container, Heading, toast, usePrompt } from "@medusajs/ui";
63
+ import { Button, clx, Container, Heading, toast, usePrompt } from "@medusajs/ui";
53
64
  import { useTranslation } from "react-i18next";
54
- import { Trash } from "@medusajs/icons";
65
+ import { PencilSquare, Trash } from "@medusajs/icons";
55
66
  import { Link, useNavigate } from "react-router-dom";
56
67
 
57
68
  // src/components/common/listicle/listicle.tsx
@@ -111,7 +122,7 @@ var CustomerAddressSection = ({
111
122
  return /* @__PURE__ */ jsxs2(Container, { className: "p-0", "data-testid": "customer-address-section", children: [
112
123
  /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", "data-testid": "customer-address-section-header", children: [
113
124
  /* @__PURE__ */ jsx2(Heading, { level: "h2", "data-testid": "customer-address-section-heading", children: t2("addresses.title") }),
114
- /* @__PURE__ */ jsx2(Link, { to: `create-address`, className: "text-ui-fg-muted text-xs", "data-testid": "customer-address-section-add-link", children: "Add" })
125
+ /* @__PURE__ */ jsx2(Link, { to: `create-address`, "data-testid": "customer-address-section-add-link", children: /* @__PURE__ */ jsx2(Button, { variant: "secondary", size: "small", "data-testid": "customer-address-section-create-button", children: t2("actions.create") }) })
115
126
  ] }),
116
127
  addresses.length === 0 && /* @__PURE__ */ jsx2("div", { "data-testid": "customer-address-section-no-records", children: /* @__PURE__ */ jsx2(
117
128
  NoRecords,
@@ -135,6 +146,15 @@ var CustomerAddressSection = ({
135
146
  {
136
147
  "data-testid": `customer-address-section-address-${address.id}-actions`,
137
148
  groups: [
149
+ {
150
+ actions: [
151
+ {
152
+ icon: /* @__PURE__ */ jsx2(PencilSquare, {}),
153
+ label: t2("actions.edit"),
154
+ to: `edit-address/${address.id}`
155
+ }
156
+ ]
157
+ },
138
158
  {
139
159
  actions: [
140
160
  {
@@ -156,7 +176,7 @@ var CustomerAddressSection = ({
156
176
  };
157
177
 
158
178
  // src/pages/customers/customer-detail/components/customer-general-section/customer-general-section.tsx
159
- import { PencilSquare, Trash as Trash2 } from "@medusajs/icons";
179
+ import { PencilSquare as PencilSquare2, Trash as Trash2 } from "@medusajs/icons";
160
180
  import {
161
181
  Container as Container2,
162
182
  Heading as Heading2,
@@ -220,7 +240,7 @@ var CustomerGeneralSection = ({
220
240
  actions: [
221
241
  {
222
242
  label: t2("actions.edit"),
223
- icon: /* @__PURE__ */ jsx3(PencilSquare, {}),
243
+ icon: /* @__PURE__ */ jsx3(PencilSquare2, {}),
224
244
  to: "edit"
225
245
  }
226
246
  ]
@@ -256,7 +276,7 @@ var CustomerGeneralSection = ({
256
276
 
257
277
  // src/pages/customers/customer-detail/components/customer-group-section/customer-group-section.tsx
258
278
  import {
259
- Button,
279
+ Button as Button2,
260
280
  Checkbox,
261
281
  Container as Container3,
262
282
  Heading as Heading3,
@@ -266,7 +286,7 @@ import {
266
286
  import { createColumnHelper } from "@tanstack/react-table";
267
287
  import { t } from "i18next";
268
288
  import { useMemo, useState } from "react";
269
- import { PencilSquare as PencilSquare2, Trash as Trash3 } from "@medusajs/icons";
289
+ import { PencilSquare as PencilSquare3, Trash as Trash3 } from "@medusajs/icons";
270
290
  import { keepPreviousData } from "@tanstack/react-query";
271
291
  import { useTranslation as useTranslation3 } from "react-i18next";
272
292
  import { Link as Link2 } from "react-router-dom";
@@ -285,7 +305,7 @@ var CustomerGroupSection = ({
285
305
  const { customer_groups, count, isLoading, isError, error } = useCustomerGroups(
286
306
  {
287
307
  ...searchParams,
288
- fields: "+customers.id",
308
+ fields: "+customers.id,+seller.id,+seller.name",
289
309
  customers: { id: customer.id }
290
310
  },
291
311
  {
@@ -344,7 +364,7 @@ var CustomerGroupSection = ({
344
364
  return /* @__PURE__ */ jsxs4(Container3, { className: "divide-y p-0", "data-testid": "customer-group-section", children: [
345
365
  /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between px-6 py-4", "data-testid": "customer-group-section-header", children: [
346
366
  /* @__PURE__ */ jsx4(Heading3, { level: "h2", "data-testid": "customer-group-section-heading", children: t("customerGroups.domain") }),
347
- /* @__PURE__ */ jsx4(Link2, { to: `/customers/${customer.id}/add-customer-groups`, "data-testid": "customer-group-section-add-link", children: /* @__PURE__ */ jsx4(Button, { variant: "secondary", size: "small", "data-testid": "customer-group-section-add-button", children: t("general.add") }) })
367
+ /* @__PURE__ */ jsx4(Link2, { to: `/customers/${customer.id}/add-customer-groups`, "data-testid": "customer-group-section-add-link", children: /* @__PURE__ */ jsx4(Button2, { variant: "secondary", size: "small", "data-testid": "customer-group-section-add-button", children: t("general.add") }) })
348
368
  ] }),
349
369
  /* @__PURE__ */ jsx4(
350
370
  _DataTable,
@@ -413,7 +433,7 @@ var CustomerGroupRowActions = ({
413
433
  actions: [
414
434
  {
415
435
  label: t2("actions.edit"),
416
- icon: /* @__PURE__ */ jsx4(PencilSquare2, {}),
436
+ icon: /* @__PURE__ */ jsx4(PencilSquare3, {}),
417
437
  to: `/customer-groups/${group.id}/edit`
418
438
  },
419
439
  {
@@ -457,6 +477,14 @@ var useColumns = (customerId) => {
457
477
  }
458
478
  }),
459
479
  ...columns,
480
+ columnHelper.display({
481
+ id: "owner",
482
+ header: t("fields.owner"),
483
+ cell: ({ row }) => {
484
+ const seller = row.original.seller;
485
+ return /* @__PURE__ */ jsx4("span", { "data-testid": `customer-group-section-owner-${row.original.id}`, children: seller?.name ?? "-" });
486
+ }
487
+ }),
460
488
  columnHelper.display({
461
489
  id: "actions",
462
490
  cell: ({ row }) => /* @__PURE__ */ jsx4(
@@ -473,8 +501,8 @@ var useColumns = (customerId) => {
473
501
  };
474
502
 
475
503
  // src/pages/customers/customer-detail/components/customer-order-section/customer-order-section.tsx
476
- import { ArrowPath } from "@medusajs/icons";
477
- import { Container as Container4, Heading as Heading4 } from "@medusajs/ui";
504
+ import { ArrowPath, TriangleRightMini } from "@medusajs/icons";
505
+ import { Container as Container4, Heading as Heading4, IconButton, clx as clx2 } from "@medusajs/ui";
478
506
  import { keepPreviousData as keepPreviousData2 } from "@tanstack/react-query";
479
507
  import { createColumnHelper as createColumnHelper2 } from "@tanstack/react-table";
480
508
  import { useMemo as useMemo2 } from "react";
@@ -482,8 +510,59 @@ import { useTranslation as useTranslation4 } from "react-i18next";
482
510
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
483
511
  var PREFIX2 = "cusord";
484
512
  var PAGE_SIZE2 = 10;
485
- var DEFAULT_RELATIONS = "*customer,*items,*sales_channel";
486
- var DEFAULT_FIELDS = "id,status,display_id,created_at,email,fulfillment_status,payment_status,total,currency_code";
513
+ var DEFAULT_FIELDS = [
514
+ "id",
515
+ "display_id",
516
+ "customer_id",
517
+ "seller_count",
518
+ "total",
519
+ "created_at",
520
+ "updated_at",
521
+ "orders.id",
522
+ "orders.display_id",
523
+ "orders.created_at",
524
+ "orders.updated_at",
525
+ "orders.payment_status",
526
+ "orders.fulfillment_status",
527
+ "orders.total",
528
+ "orders.currency_code",
529
+ "*orders.seller"
530
+ ].join(",");
531
+ function transformOrderGroups(orderGroups, t2) {
532
+ return orderGroups.map((group) => {
533
+ const orders = group.orders ?? [];
534
+ const orderIds = orders.map((o) => `#${o.display_id}`).join(", ");
535
+ const currencyCode = orders[0]?.currency_code ?? "usd";
536
+ const children = orders.map((order) => ({
537
+ _type: "order",
538
+ id: order.id,
539
+ display_id: `#${order.display_id}`,
540
+ order_ids: "",
541
+ store: order.seller?.name ?? "-",
542
+ created_at: new Date(order.created_at),
543
+ updated_at: new Date(order.updated_at),
544
+ payment_status: order.payment_status ?? null,
545
+ fulfillment_status: order.fulfillment_status ?? null,
546
+ total: order.total ?? null,
547
+ currency_code: order.currency_code ?? "usd",
548
+ children: []
549
+ }));
550
+ return {
551
+ _type: "group",
552
+ id: group.id,
553
+ display_id: `#G${group.display_id}`,
554
+ order_ids: orderIds,
555
+ store: t2("orders.fields.vendorsCount", { count: group.seller_count }),
556
+ created_at: new Date(group.created_at),
557
+ updated_at: new Date(group.updated_at),
558
+ payment_status: null,
559
+ fulfillment_status: null,
560
+ total: group.total ?? null,
561
+ currency_code: currencyCode,
562
+ children
563
+ };
564
+ });
565
+ }
487
566
  var CustomerOrderSection = ({
488
567
  customer
489
568
  }) => {
@@ -492,22 +571,28 @@ var CustomerOrderSection = ({
492
571
  pageSize: PAGE_SIZE2,
493
572
  prefix: PREFIX2
494
573
  });
495
- const { orders, count, isLoading, isError, error } = useOrders(
574
+ const { order_groups, count, isLoading, isError, error } = useOrderGroups(
496
575
  {
497
576
  ...searchParams,
498
577
  customer_id: customer.id,
499
- fields: DEFAULT_FIELDS + "," + DEFAULT_RELATIONS
578
+ fields: DEFAULT_FIELDS
500
579
  },
501
580
  {
502
581
  placeholderData: keepPreviousData2
503
582
  }
504
583
  );
584
+ const rows = useMemo2(
585
+ () => transformOrderGroups(order_groups ?? [], t2),
586
+ [order_groups, t2]
587
+ );
505
588
  const columns = useColumns2();
506
- const filters = useOrderTableFilters();
507
589
  const { table } = useDataTable({
508
- data: orders ?? [],
590
+ data: rows,
509
591
  columns,
510
592
  enablePagination: true,
593
+ enableExpandableRows: true,
594
+ getSubRows: (row) => row.children,
595
+ getRowId: (row) => row.id,
511
596
  count,
512
597
  pageSize: PAGE_SIZE2,
513
598
  prefix: PREFIX2
@@ -523,8 +608,7 @@ var CustomerOrderSection = ({
523
608
  columns,
524
609
  table,
525
610
  pagination: true,
526
- navigateTo: (row) => `/orders/${row.original.id}`,
527
- filters,
611
+ navigateTo: (row) => row.original._type === "order" ? `/orders/${row.original.id}` : "",
528
612
  count,
529
613
  isLoading,
530
614
  pageSize: PAGE_SIZE2,
@@ -540,18 +624,18 @@ var CustomerOrderSection = ({
540
624
  )
541
625
  ] });
542
626
  };
543
- var CustomerOrderActions = ({ order }) => {
627
+ var CustomerOrderActions = ({ orderId }) => {
544
628
  const { t: t2 } = useTranslation4();
545
629
  return /* @__PURE__ */ jsx5(
546
630
  ActionMenu,
547
631
  {
548
- "data-testid": `customer-order-section-row-actions-${order.id}`,
632
+ "data-testid": `customer-order-section-row-actions-${orderId}`,
549
633
  groups: [
550
634
  {
551
635
  actions: [
552
636
  {
553
637
  label: t2("transferOwnership.label"),
554
- to: `${order.id}/transfer`,
638
+ to: `${orderId}/transfer`,
555
639
  icon: /* @__PURE__ */ jsx5(ArrowPath, {})
556
640
  }
557
641
  ]
@@ -562,16 +646,108 @@ var CustomerOrderActions = ({ order }) => {
562
646
  };
563
647
  var columnHelper2 = createColumnHelper2();
564
648
  var useColumns2 = () => {
565
- const base = useOrderTableColumns({ exclude: ["customer"] });
649
+ const { t: t2 } = useTranslation4();
566
650
  return useMemo2(
567
651
  () => [
568
- ...base,
652
+ columnHelper2.accessor("display_id", {
653
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("orders.fields.groupId") }),
654
+ cell: ({ row, getValue }) => {
655
+ if (row.original._type === "order") {
656
+ return null;
657
+ }
658
+ const expandHandler = row.getToggleExpandedHandler();
659
+ return /* @__PURE__ */ jsxs5("div", { className: "flex size-full items-center gap-x-2 overflow-hidden", children: [
660
+ /* @__PURE__ */ jsx5("div", { className: "flex size-7 items-center justify-center", children: row.getCanExpand() ? /* @__PURE__ */ jsx5(
661
+ IconButton,
662
+ {
663
+ type: "button",
664
+ onClick: (e) => {
665
+ e.stopPropagation();
666
+ e.preventDefault();
667
+ expandHandler();
668
+ },
669
+ size: "small",
670
+ variant: "transparent",
671
+ className: "text-ui-fg-subtle",
672
+ "data-testid": `customer-order-group-expand-${row.original.id}`,
673
+ children: /* @__PURE__ */ jsx5(
674
+ TriangleRightMini,
675
+ {
676
+ className: clx2({
677
+ "rotate-90 transition-transform will-change-transform": row.getIsExpanded()
678
+ })
679
+ }
680
+ )
681
+ }
682
+ ) : null }),
683
+ /* @__PURE__ */ jsx5("span", { className: "truncate", children: getValue() })
684
+ ] });
685
+ }
686
+ }),
687
+ columnHelper2.accessor("order_ids", {
688
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("orders.fields.orderIds") }),
689
+ cell: ({ row, getValue }) => {
690
+ if (row.original._type === "group") {
691
+ return /* @__PURE__ */ jsx5(TextCell, { text: getValue() });
692
+ }
693
+ return /* @__PURE__ */ jsx5(TextCell, { text: row.original.display_id });
694
+ }
695
+ }),
696
+ columnHelper2.accessor("store", {
697
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("fields.store") }),
698
+ cell: ({ getValue }) => /* @__PURE__ */ jsx5(TextCell, { text: getValue() })
699
+ }),
700
+ columnHelper2.accessor("created_at", {
701
+ header: () => /* @__PURE__ */ jsx5(DateHeader, {}),
702
+ cell: ({ getValue }) => /* @__PURE__ */ jsx5(DateCell, { date: getValue() })
703
+ }),
704
+ columnHelper2.accessor("payment_status", {
705
+ header: () => /* @__PURE__ */ jsx5(PaymentStatusHeader, {}),
706
+ cell: ({ row, getValue }) => {
707
+ if (row.original._type === "group") {
708
+ return null;
709
+ }
710
+ const status = getValue();
711
+ if (!status) {
712
+ return "-";
713
+ }
714
+ return /* @__PURE__ */ jsx5(PaymentStatusCell, { status });
715
+ }
716
+ }),
717
+ columnHelper2.accessor("fulfillment_status", {
718
+ header: () => /* @__PURE__ */ jsx5(FulfillmentStatusHeader, {}),
719
+ cell: ({ row, getValue }) => {
720
+ if (row.original._type === "group") {
721
+ return null;
722
+ }
723
+ const status = getValue();
724
+ if (!status) {
725
+ return "-";
726
+ }
727
+ return /* @__PURE__ */ jsx5(FulfillmentStatusCell, { status });
728
+ }
729
+ }),
730
+ columnHelper2.accessor("total", {
731
+ header: () => /* @__PURE__ */ jsx5(TextHeader, { text: t2("fields.total") }),
732
+ cell: ({ row, getValue }) => {
733
+ const total = getValue();
734
+ if (total == null) {
735
+ return "-";
736
+ }
737
+ return /* @__PURE__ */ jsx5(
738
+ TextCell,
739
+ {
740
+ text: getStylizedAmount(total, row.original.currency_code)
741
+ }
742
+ );
743
+ }
744
+ }),
569
745
  columnHelper2.display({
570
746
  id: "actions",
571
- cell: ({ row }) => /* @__PURE__ */ jsx5(CustomerOrderActions, { order: row.original })
747
+ cell: ({ row }) => row.original._type === "order" ? /* @__PURE__ */ jsx5(CustomerOrderActions, { orderId: row.original.id }) : null
572
748
  })
573
749
  ],
574
- [base]
750
+ [t2]
575
751
  );
576
752
  };
577
753
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  customerGroupsQueryKeys
3
- } from "./chunk-PRBE5CM3.js";
3
+ } from "./chunk-QYDWMBEX.js";
4
4
  import {
5
5
  productsQueryKeys
6
6
  } from "./chunk-M2E3PKA4.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  usePromotionTableColumns,
3
3
  usePromotionTableQuery
4
- } from "./chunk-7VPJ4C6F.js";
4
+ } from "./chunk-7PAVVX2P.js";
5
5
  import {
6
6
  usePromotionTableFilters
7
7
  } from "./chunk-S2WEYEQR.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-QG6PLWNH.js";
4
4
  import {
5
5
  useCustomerTableFilters
6
- } from "./chunk-I5THQVYP.js";
6
+ } from "./chunk-XIFE4VUR.js";
7
7
  import {
8
8
  useCustomerTableQuery
9
9
  } from "./chunk-PVZBDWLK.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-H6MYB7GB.js";
17
17
  import {
18
18
  useCustomers
19
- } from "./chunk-PRBE5CM3.js";
19
+ } from "./chunk-QYDWMBEX.js";
20
20
  import {
21
21
  ActionMenu
22
22
  } from "./chunk-BDGZ4EQO.js";
@@ -89,7 +89,7 @@ var getIsActiveProps = (isEnabled, t) => isEnabled ? {
89
89
  color: "green",
90
90
  label: t("commissions.status.enabled", "Active")
91
91
  } : {
92
- color: "grey",
92
+ color: "red",
93
93
  label: t("commissions.status.disabled", "Inactive")
94
94
  };
95
95
  var buildValuesPayload = (currencies, fixedValues = {}) => currencies.map((code) => ({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCustomerGroups
3
- } from "./chunk-PRBE5CM3.js";
3
+ } from "./chunk-QYDWMBEX.js";
4
4
 
5
5
  // src/hooks/table/filters/use-customer-table-filters.tsx
6
6
  import { useTranslation } from "react-i18next";