@mercurjs/admin 2.0.0-canary.39 → 2.0.0-canary.41

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 (200) hide show
  1. package/dist/{add-campaign-promotions-ZUXBF5G3.js → add-campaign-promotions-7TPECJOT.js} +4 -4
  2. package/dist/{api-key-management-detail-SKJNAZ5L.js → api-key-management-detail-2EFDWJSF.js} +7 -7
  3. package/dist/{api-key-management-list-2D4WKI6Y.js → api-key-management-list-UZLHSM2R.js} +6 -5
  4. package/dist/{api-key-management-sales-channels-C7EWPHC2.js → api-key-management-sales-channels-ER5ZINL7.js} +6 -7
  5. package/dist/{campaign-create-B7XM2FZM.js → campaign-create-AFR3V7P4.js} +3 -3
  6. package/dist/{campaign-detail-7U4CQHU5.js → campaign-detail-UUNEZUY7.js} +9 -8
  7. package/dist/{campaign-list-SC7FLTRM.js → campaign-list-2AAGWYEG.js} +6 -5
  8. package/dist/category-create-LY45Z7YB.js +23 -0
  9. package/dist/{category-detail-HGHR3R2R.js → category-detail-AGTIMI6P.js} +7 -6
  10. package/dist/{category-list-QBBFGHQM.js → category-list-ROM7UTA4.js} +6 -5
  11. package/dist/{chunk-ENMRRG4N.js → chunk-2AWQ4FPA.js} +6 -6
  12. package/dist/{chunk-VBAAYYCS.js → chunk-2HPZJCAF.js} +6 -6
  13. package/dist/{chunk-SFG7JTBH.js → chunk-2LAANNMF.js} +111 -48
  14. package/dist/{chunk-KYUXTS2L.js → chunk-2UN7CNBG.js} +7 -7
  15. package/dist/chunk-3LTXCGNM.js +204 -0
  16. package/dist/{chunk-EDQBUWY7.js → chunk-3NIWL75F.js} +6 -6
  17. package/dist/{product-create-variant-CJPECBV4.js → chunk-4UTK7DZN.js} +63 -69
  18. package/dist/{chunk-5VEYNZSW.js → chunk-5322X23U.js} +9 -4
  19. package/dist/{chunk-U3SFHLUA.js → chunk-53IISBJZ.js} +1 -0
  20. package/dist/{chunk-DGCPYCHU.js → chunk-54RTJBYO.js} +63 -8
  21. package/dist/{chunk-E2AAYIHS.js → chunk-5EFOVNK2.js} +3 -3
  22. package/dist/{chunk-NQPAEBSZ.js → chunk-6E3T6CGY.js} +15 -7
  23. package/dist/{chunk-V2DXJ75C.js → chunk-6OA7JZ5E.js} +1 -1
  24. package/dist/chunk-72IQIAGX.js +245 -0
  25. package/dist/{chunk-3IYIS5UZ.js → chunk-7DOPC5GY.js} +4 -4
  26. package/dist/{chunk-Q6XCCONH.js → chunk-AI6RJGRQ.js} +9 -9
  27. package/dist/{price-list-create-OK7YYLAB.js → chunk-AJZQBGE4.js} +193 -428
  28. package/dist/{chunk-XDVS4B7W.js → chunk-BAV6Y7RC.js} +8 -7
  29. package/dist/{chunk-4WYBW3HK.js → chunk-BCAT7P6B.js} +3 -3
  30. package/dist/{chunk-LYT3RI4O.js → chunk-BHYDGWZ6.js} +18 -9
  31. package/dist/{chunk-DK3U2SRA.js → chunk-BIEYPCHL.js} +5 -5
  32. package/dist/{product-create-NVBKO426.js → chunk-BLG726FI.js} +36 -68
  33. package/dist/chunk-BVRI7YAR.js +100 -0
  34. package/dist/{chunk-2IGCU3KP.js → chunk-DOMRLXOI.js} +2 -2
  35. package/dist/{chunk-K6FXWZ2M.js → chunk-F55UXYYA.js} +10 -0
  36. package/dist/{chunk-AOVEX4EM.js → chunk-FNXSMFGL.js} +5 -5
  37. package/dist/{chunk-IXGP2EEN.js → chunk-FYAYHOCN.js} +2 -3
  38. package/dist/{chunk-QBOXELB5.js → chunk-GJHAVFXL.js} +4 -4
  39. package/dist/{price-list-prices-add-7PGUONDK.js → chunk-GOVOSXUU.js} +90 -290
  40. package/dist/{chunk-66IHH2HG.js → chunk-H6W6Q6YE.js} +3 -3
  41. package/dist/{seller-details-KROISMQC.js → chunk-HVLQFQGD.js} +74 -146
  42. package/dist/{chunk-QD6KYDYH.js → chunk-I6R4I7EF.js} +6 -6
  43. package/dist/{chunk-RIMR3ULR.js → chunk-ISYWL6RZ.js} +64 -33
  44. package/dist/{chunk-HHNJNKCB.js → chunk-KMUEJ3IE.js} +59 -20
  45. package/dist/{chunk-GJTIHFXG.js → chunk-KOILMFJX.js} +29 -31
  46. package/dist/{chunk-3SAH3NUS.js → chunk-LIXRNUG5.js} +1 -1
  47. package/dist/chunk-LOJD5572.js +433 -0
  48. package/dist/{chunk-T25UE7SS.js → chunk-MD56QRKC.js} +6 -6
  49. package/dist/{chunk-S4QUEQQK.js → chunk-MSFNMGFD.js} +48 -48
  50. package/dist/{chunk-YH4VQBAA.js → chunk-MX52GGQO.js} +81 -52
  51. package/dist/{chunk-O6O22BN4.js → chunk-N7BCAAJC.js} +113 -48
  52. package/dist/{chunk-JA2XIIIZ.js → chunk-NXKCVD5F.js} +6 -5
  53. package/dist/{chunk-G4QMLQF2.js → chunk-NZN7PFPB.js} +2 -4
  54. package/dist/{chunk-KUDLPUWR.js → chunk-OFWYMU6K.js} +8 -8
  55. package/dist/chunk-OOAY7PAK.js +1155 -0
  56. package/dist/chunk-PAQH5QQH.js +685 -0
  57. package/dist/{chunk-3H74EI2D.js → chunk-POCHIWE2.js} +100 -40
  58. package/dist/chunk-PXBCTPQO.js +248 -0
  59. package/dist/chunk-QSZ2FIM2.js +223 -0
  60. package/dist/{chunk-23663A2W.js → chunk-R5VKVG6S.js} +1 -1
  61. package/dist/{chunk-DP5U3GQU.js → chunk-RXUUBJSZ.js} +1 -1
  62. package/dist/{chunk-FYB5MS4F.js → chunk-S2GARTQU.js} +6 -6
  63. package/dist/{chunk-7TLEUIAL.js → chunk-SO6PXIPV.js} +21 -16
  64. package/dist/{category-create-UWBJGIED.js → chunk-ST74PSEZ.js} +78 -149
  65. package/dist/{chunk-33FUPXJL.js → chunk-T3OYE2MH.js} +4 -4
  66. package/dist/{chunk-JRWB7VWP.js → chunk-U4RMXPGI.js} +8 -8
  67. package/dist/{chunk-YGSM5PVN.js → chunk-UI2BJVP5.js} +1 -1
  68. package/dist/{chunk-FXU7SL6M.js → chunk-UOIUQC3P.js} +25 -15
  69. package/dist/{chunk-ZU2RNSCP.js → chunk-UONTDHRH.js} +4 -2
  70. package/dist/{chunk-J7SR4GW5.js → chunk-V3SHSLK4.js} +4 -4
  71. package/dist/{chunk-TE5VQBCL.js → chunk-V42ZR4XW.js} +8 -9
  72. package/dist/chunk-V5J73NPW.js +117 -0
  73. package/dist/{chunk-QP6XXG6A.js → chunk-VOFAM7HJ.js} +74 -42
  74. package/dist/{chunk-CR4E2DCR.js → chunk-VT3RBTYK.js} +3 -3
  75. package/dist/{chunk-AOVJTW7M.js → chunk-VWQYMOBM.js} +9 -9
  76. package/dist/{chunk-6L2LSIPR.js → chunk-VXAQZ2ZZ.js} +4 -4
  77. package/dist/{chunk-OSHCUDYY.js → chunk-X3KBQBGW.js} +6 -6
  78. package/dist/{chunk-WZADCDDE.js → chunk-X56THFPA.js} +2 -1
  79. package/dist/{chunk-HZKW7HRU.js → chunk-X7NWBH7T.js} +64 -35
  80. package/dist/{chunk-OFRQZHVQ.js → chunk-XE5ZMNUN.js} +6 -6
  81. package/dist/{chunk-4GVHNYZR.js → chunk-XHVYNMTA.js} +2 -2
  82. package/dist/{chunk-U2UCL2VG.js → chunk-XIZLPYEE.js} +3 -111
  83. package/dist/{chunk-KXPCEVFB.js → chunk-XOKRMMVP.js} +6 -6
  84. package/dist/{chunk-XVKRTPVM.js → chunk-Y5N26ZC3.js} +41 -15
  85. package/dist/{chunk-A6Z2Q7D5.js → chunk-Z2MDPTF2.js} +4 -2
  86. package/dist/{chunk-TKGZBTOS.js → chunk-ZFSZTRZ6.js} +54 -32
  87. package/dist/{chunk-RV6NZTNP.js → chunk-ZZEAWVFX.js} +27 -27
  88. package/dist/{collection-detail-YJ3FV2C6.js → collection-detail-SRR3HSIV.js} +7 -6
  89. package/dist/{collection-list-WDQOBHQN.js → collection-list-MKISW5S4.js} +6 -5
  90. package/dist/{commission-rate-detail-UQDIIMIK.js → commission-rate-detail-GLB733F3.js} +5 -4
  91. package/dist/{commission-rate-list-WTDZLKUR.js → commission-rate-list-5V3FQROA.js} +6 -5
  92. package/dist/{customer-detail-N7CS4IJU.js → customer-detail-SBQF232S.js} +4 -3
  93. package/dist/customer-group-add-customers-LCNDTLXR.js +1 -1
  94. package/dist/{customer-group-detail-UCTY4FF7.js → customer-group-detail-QQSNRM2K.js} +6 -5
  95. package/dist/{customer-group-list-XOQ64CVR.js → customer-group-list-IO7SVK3F.js} +15 -6
  96. package/dist/{customer-list-BUUO6OF7.js → customer-list-TXBAME4V.js} +4 -3
  97. package/dist/customers-add-customer-group-BKEV24N2.js +1 -1
  98. package/dist/index.d.ts +225 -16
  99. package/dist/index.js +581 -387
  100. package/dist/inventory-create-Q4JIXZTT.js +56 -0
  101. package/dist/{inventory-detail-BJT5WEV5.js → inventory-detail-3D37JWQT.js} +7 -6
  102. package/dist/{inventory-list-3LWBPWVK.js → inventory-list-WH42ADNB.js} +6 -5
  103. package/dist/{inventory-stock-G3GP4FZX.js → inventory-stock-DTKOGYT7.js} +6 -6
  104. package/dist/{location-detail-N7J6PEAP.js → location-detail-2SSHXSKL.js} +5 -4
  105. package/dist/location-fulfillment-providers-BHCY2MYC.js +1 -1
  106. package/dist/{location-list-UG6B47NP.js → location-list-LPISOSQI.js} +5 -4
  107. package/dist/{location-sales-channels-3IGHCJEN.js → location-sales-channels-PPH53OHD.js} +6 -7
  108. package/dist/location-service-zone-shipping-option-create-GSXLVEGO.js +57 -0
  109. package/dist/{location-service-zone-shipping-option-pricing-7VMPXDWX.js → location-service-zone-shipping-option-pricing-4CTGXBP3.js} +6 -6
  110. package/dist/marketplace-add-currencies-CIGOPBO6.js +1 -1
  111. package/dist/{marketplace-detail-7KJMXXAJ.js → marketplace-detail-3CBLIYVK.js} +6 -5
  112. package/dist/{order-detail-C25NQSZN.js → order-detail-AJV2PE7J.js} +7 -6
  113. package/dist/{order-edit-billing-address-NVRMPZEU.js → order-edit-billing-address-QQUPIC2H.js} +6 -6
  114. package/dist/{order-list-7NH7LROU.js → order-list-VPQOG5WE.js} +6 -5
  115. package/dist/pages/index.d.ts +2608 -82
  116. package/dist/pages/index.js +238 -156
  117. package/dist/{payout-detail-MDD5SRK5.js → payout-detail-PMR26YQI.js} +5 -4
  118. package/dist/{payout-list-XY2A5KYS.js → payout-list-DMG7MQM7.js} +6 -4
  119. package/dist/price-list-configuration-XK3IZLLX.js +1 -1
  120. package/dist/price-list-create-QS6CVEWS.js +76 -0
  121. package/dist/{price-list-detail-IGFSM77P.js → price-list-detail-IO5ZURVW.js} +7 -6
  122. package/dist/{price-list-list-TBXQ5DOS.js → price-list-list-B3FKB46L.js} +6 -5
  123. package/dist/price-list-prices-add-NSAQWBT6.js +71 -0
  124. package/dist/{price-list-prices-edit-QVGBT6AI.js → price-list-prices-edit-UOAIOS5X.js} +6 -6
  125. package/dist/product-create-UVKMOKRF.js +68 -0
  126. package/dist/product-create-variant-TCXDJ425.js +53 -0
  127. package/dist/{product-detail-ZC37BGPC.js → product-detail-273ME23P.js} +4 -4
  128. package/dist/{product-list-635ZXM2D.js → product-list-2ZHLFSBI.js} +5 -4
  129. package/dist/{product-media-ZMDAVPGI.js → product-media-YMFP6Q6A.js} +3 -3
  130. package/dist/{product-prices-WMRIC7WM.js → product-prices-X6JO3Y5A.js} +5 -5
  131. package/dist/{product-sales-channels-LSN5DVWZ.js → product-sales-channels-2PVBPK6W.js} +2 -3
  132. package/dist/{product-stock-HF42WRSC.js → product-stock-ARRFHDSU.js} +6 -6
  133. package/dist/{product-tag-detail-OJLYO3Q5.js → product-tag-detail-545AVFGA.js} +7 -6
  134. package/dist/{product-tag-list-XFHGJBRF.js → product-tag-list-2Y2Q7K3A.js} +7 -6
  135. package/dist/{product-type-detail-J4UA4AEM.js → product-type-detail-PBP572AM.js} +7 -6
  136. package/dist/{product-type-list-H5EQHCXS.js → product-type-list-XWNUKETZ.js} +6 -5
  137. package/dist/{product-variant-detail-5WKYURFA.js → product-variant-detail-RJUQWBYH.js} +4 -3
  138. package/dist/{profile-detail-EYNXOHGZ.js → profile-detail-H22ZBNOB.js} +5 -4
  139. package/dist/{promotion-add-campaign-B5SF72KC.js → promotion-add-campaign-5LCKEU6H.js} +3 -3
  140. package/dist/promotion-create-KXBEHXPK.js +54 -0
  141. package/dist/{promotion-detail-MVFOMS4E.js → promotion-detail-NZZ2HII7.js} +7 -6
  142. package/dist/{promotion-list-IN4VWEQN.js → promotion-list-KARWNOAQ.js} +9 -8
  143. package/dist/{refund-reason-list-DJZZC7KK.js → refund-reason-list-GTZQBZ7R.js} +3 -2
  144. package/dist/{region-detail-OFZHX57G.js → region-detail-3OPMLS4V.js} +5 -4
  145. package/dist/{region-list-L4FKHVJJ.js → region-list-542EMW5C.js} +6 -5
  146. package/dist/{reservation-detail-LZYEM5NW.js → reservation-detail-IPGIBQW4.js} +5 -4
  147. package/dist/{reservation-list-OGPDB7WG.js → reservation-list-CEFKMB2G.js} +6 -5
  148. package/dist/{reset-password-Q7Y4FWRE.js → reset-password-R5ULRWEM.js} +1 -1
  149. package/dist/{return-reason-list-6ICMSVKF.js → return-reason-list-S7LU655M.js} +5 -4
  150. package/dist/{sales-channel-detail-RRJG7U7R.js → sales-channel-detail-QCJ6OC3H.js} +7 -6
  151. package/dist/{sales-channel-list-LUZ4ZXCY.js → sales-channel-list-KYNBWXUD.js} +7 -7
  152. package/dist/seller-details-A7TYGP67.js +104 -0
  153. package/dist/{seller-list-664H4SI5.js → seller-list-5KPNNC2B.js} +7 -6
  154. package/dist/{shipping-option-type-detail-2RY3NHRO.js → shipping-option-type-detail-OBYOZZWS.js} +5 -4
  155. package/dist/{shipping-option-type-list-IOSOE33S.js → shipping-option-type-list-UGVMQ3DC.js} +6 -5
  156. package/dist/{shipping-profile-detail-RIIAX7VE.js → shipping-profile-detail-RYOFRMLH.js} +5 -4
  157. package/dist/{shipping-profiles-list-AL4EJSJY.js → shipping-profiles-list-XJGQ7AVX.js} +5 -4
  158. package/dist/{tax-region-create-UOTLTCOP.js → tax-region-create-AR2LNF2G.js} +6 -6
  159. package/dist/{tax-region-detail-CA2W5W6A.js → tax-region-detail-PIGY5JQ7.js} +7 -6
  160. package/dist/{tax-region-list-JTZ7KZCX.js → tax-region-list-AMGZWUAI.js} +6 -5
  161. package/dist/{tax-region-province-detail-ZHLX4FF4.js → tax-region-province-detail-D3R4FJT4.js} +6 -5
  162. package/dist/types-DUhfb5tH.d.ts +30 -0
  163. package/dist/{user-detail-YNPBC5MN.js → user-detail-H66ZAR7W.js} +5 -4
  164. package/dist/{user-list-LNTZNT3D.js → user-list-HIUXLIJV.js} +5 -4
  165. package/package.json +3 -3
  166. package/dist/chunk-62ZRA6BZ.js +0 -216
  167. package/dist/chunk-6PNMR6XP.js +0 -192
  168. package/dist/chunk-7COSFMM7.js +0 -163
  169. package/dist/chunk-A2KURGQO.js +0 -151
  170. package/dist/chunk-BHID7W3U.js +0 -78
  171. package/dist/chunk-UKLRBS4W.js +0 -61
  172. package/dist/inventory-create-QLEIHESO.js +0 -620
  173. package/dist/location-service-zone-shipping-option-create-GYPW6SSN.js +0 -811
  174. package/dist/promotion-create-D77SANLX.js +0 -1262
  175. package/dist/{adjust-inventory-HZCWL6SC.js → adjust-inventory-WL7D7TQR.js} +3 -3
  176. package/dist/{campaign-budget-edit-AIXCDGG3.js → campaign-budget-edit-722ECPRI.js} +3 -3
  177. package/dist/{category-products-XLCG2JR7.js → category-products-H3VFYGOU.js} +2 -2
  178. package/dist/{chunk-DEKJJ7NG.js → chunk-OFCUTNGV.js} +3 -3
  179. package/dist/{chunk-KUWNYCGL.js → chunk-U3OWJE7V.js} +0 -0
  180. package/dist/{collection-add-products-IQ7M63BA.js → collection-add-products-BQ2FZKR4.js} +1 -1
  181. package/dist/{commission-rate-create-VC72GTV4.js → commission-rate-create-GFQNADQS.js} +9 -9
  182. package/dist/{commission-rate-edit-AXJKJNFY.js → commission-rate-edit-A2BFZUEI.js} +9 -9
  183. package/dist/{location-service-zone-shipping-option-edit-E3GN4ZF5.js → location-service-zone-shipping-option-edit-KPECMUYB.js} +3 -3
  184. package/dist/{order-create-claim-7WW6MXTT.js → order-create-claim-IWTV2HKL.js} +6 -6
  185. package/dist/{order-create-edit-KAH6ZPLX.js → order-create-edit-H2MHZFIW.js} +5 -5
  186. package/dist/{order-create-exchange-ELLWF3IY.js → order-create-exchange-PPMRSGLD.js} +6 -6
  187. package/dist/{order-create-refund-5QZBOSCA.js → order-create-refund-LZOHRL7T.js} +3 -3
  188. package/dist/{order-create-return-L6DEDPJK.js → order-create-return-WY6R4QMN.js} +6 -6
  189. package/dist/{order-edit-shipping-address-BPU7OL2N.js → order-edit-shipping-address-XQCSN4YO.js} +3 -3
  190. package/dist/{order-receive-return-FW5QZJBM.js → order-receive-return-GKMHYD4G.js} +1 -1
  191. package/dist/{product-edit-LQJDUUVX.js → product-edit-QGRKGJ3H.js} +1 -1
  192. package/dist/{product-variant-edit-66ZUIIMP.js → product-variant-edit-IQLBIHDE.js} +1 -1
  193. package/dist/{product-variant-manage-inventory-items-CV2CC2PV.js → product-variant-manage-inventory-items-C77QHYRT.js} +3 -3
  194. package/dist/{promotion-edit-details-YKS24GBD.js → promotion-edit-details-BFXPUEE6.js} +4 -4
  195. package/dist/{region-create-UMJK3VGL.js → region-create-ZPY6V77Q.js} +3 -3
  196. package/dist/{region-edit-ODVSNJHM.js → region-edit-Q2CBVPR2.js} +3 -3
  197. package/dist/{sales-channel-add-products-EOWFSO35.js → sales-channel-add-products-PIY4PUIW.js} +2 -2
  198. package/dist/{tax-region-province-create-RFYCUDER.js → tax-region-province-create-7BMYABJ6.js} +3 -3
  199. package/dist/{tax-region-tax-override-create-WIWUNXW6.js → tax-region-tax-override-create-EBDKSAXG.js} +6 -6
  200. package/dist/{tax-region-tax-override-edit-SWROFQTP.js → tax-region-tax-override-edit-55ODL7KC.js} +6 -6
@@ -0,0 +1,433 @@
1
+ import {
2
+ transformNullableFormData,
3
+ transformNullableFormNumber,
4
+ transformNullableFormNumbers
5
+ } from "./chunk-7RPRNVBS.js";
6
+ import {
7
+ CountrySelect
8
+ } from "./chunk-V74Y5NIV.js";
9
+ import {
10
+ DataGrid,
11
+ createDataGridHelper
12
+ } from "./chunk-U3OWJE7V.js";
13
+ import {
14
+ optionalInt
15
+ } from "./chunk-UXD3VNBO.js";
16
+ import {
17
+ TabbedForm,
18
+ defineTabMeta,
19
+ useTabbedForm
20
+ } from "./chunk-5GG65TKV.js";
21
+ import {
22
+ SwitchBox
23
+ } from "./chunk-YVCBMOJG.js";
24
+ import {
25
+ RouteFocusModal,
26
+ useRouteModal
27
+ } from "./chunk-MWOKFNRO.js";
28
+ import {
29
+ Form
30
+ } from "./chunk-3QSRE5LS.js";
31
+ import {
32
+ useStockLocations
33
+ } from "./chunk-4YF3GAKE.js";
34
+ import {
35
+ inventoryItemsQueryKeys,
36
+ useCreateInventoryItem
37
+ } from "./chunk-K357FGGP.js";
38
+ import {
39
+ queryClient
40
+ } from "./chunk-RHKRREUU.js";
41
+ import {
42
+ sdk
43
+ } from "./chunk-ZYNBKBY3.js";
44
+
45
+ // src/pages/inventory/inventory-create/components/inventory-create-form/schema.ts
46
+ import { z } from "zod";
47
+ var CreateInventoryItemSchema = z.object({
48
+ title: z.string().min(1),
49
+ description: z.string().optional(),
50
+ sku: z.string().optional(),
51
+ hs_code: z.string().optional(),
52
+ weight: optionalInt,
53
+ length: optionalInt,
54
+ height: optionalInt,
55
+ width: optionalInt,
56
+ origin_country: z.string().optional(),
57
+ mid_code: z.string().optional(),
58
+ material: z.string().optional(),
59
+ requires_shipping: z.boolean().optional(),
60
+ thumbnail: z.string().optional(),
61
+ locations: z.record(z.string(), optionalInt).optional()
62
+ });
63
+
64
+ // src/pages/inventory/inventory-create/inventory-create.tsx
65
+ import { Children as Children2 } from "react";
66
+
67
+ // src/pages/inventory/inventory-create/components/inventory-create-form/inventory-create-form.tsx
68
+ import { zodResolver } from "@hookform/resolvers/zod";
69
+ import { toast } from "@medusajs/ui";
70
+ import { Children, useMemo as useMemo2 } from "react";
71
+ import { useForm } from "react-hook-form";
72
+ import { useTranslation as useTranslation3 } from "react-i18next";
73
+
74
+ // src/pages/inventory/inventory-create/components/inventory-create-form/inventory-availability-form.tsx
75
+ import { useMemo } from "react";
76
+ import { useTranslation } from "react-i18next";
77
+ import { jsx } from "react/jsx-runtime";
78
+ var Root = ({ locations }) => {
79
+ const form = useTabbedForm();
80
+ const { setCloseOnEscape } = useRouteModal();
81
+ const columns = useColumns();
82
+ return /* @__PURE__ */ jsx("div", { className: "size-full", "data-testid": "inventory-create-form-availability", children: /* @__PURE__ */ jsx(
83
+ DataGrid,
84
+ {
85
+ columns,
86
+ data: locations,
87
+ state: form,
88
+ onEditingChange: (editing) => setCloseOnEscape(!editing)
89
+ }
90
+ ) });
91
+ };
92
+ var columnHelper = createDataGridHelper();
93
+ var useColumns = () => {
94
+ const { t } = useTranslation();
95
+ return useMemo(
96
+ () => [
97
+ columnHelper.column({
98
+ id: "location",
99
+ header: () => /* @__PURE__ */ jsx("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx("span", { className: "truncate", children: t("locations.domain") }) }),
100
+ cell: (context) => {
101
+ return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context, children: context.row.original.name });
102
+ },
103
+ disableHiding: true
104
+ }),
105
+ columnHelper.column({
106
+ id: "in-stock",
107
+ name: t("fields.inStock"),
108
+ header: t("fields.inStock"),
109
+ field: (context) => `locations.${context.row.original.id}`,
110
+ type: "number",
111
+ cell: (context) => {
112
+ return /* @__PURE__ */ jsx(DataGrid.NumberCell, { placeholder: "0", context });
113
+ },
114
+ disableHiding: true
115
+ })
116
+ ],
117
+ [t]
118
+ );
119
+ };
120
+ Root._tabMeta = defineTabMeta({
121
+ id: "availability",
122
+ labelKey: "inventory.create.availability",
123
+ validationFields: ["locations"]
124
+ });
125
+ var InventoryAvailabilityForm = Root;
126
+
127
+ // src/pages/inventory/inventory-create/components/inventory-create-form/inventory-create-details-tab.tsx
128
+ import {
129
+ Divider,
130
+ Heading,
131
+ Input,
132
+ Textarea
133
+ } from "@medusajs/ui";
134
+ import { useTranslation as useTranslation2 } from "react-i18next";
135
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
136
+ var Root2 = () => {
137
+ const { t } = useTranslation2();
138
+ const form = useTabbedForm();
139
+ return /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col items-center overflow-y-auto px-3", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex w-full max-w-[720px] flex-col gap-y-8 px-px py-16", "data-testid": "inventory-create-form-content", children: [
140
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-8", children: [
141
+ /* @__PURE__ */ jsx2("div", { "data-testid": "inventory-create-form-header", children: /* @__PURE__ */ jsx2(Heading, { "data-testid": "inventory-create-form-heading", children: t("inventory.create.title") }) }),
142
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-6", children: [
143
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-2", children: [
144
+ /* @__PURE__ */ jsx2(
145
+ Form.Field,
146
+ {
147
+ control: form.control,
148
+ name: "title",
149
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-title-item", children: [
150
+ /* @__PURE__ */ jsx2(Form.Label, { "data-testid": "inventory-create-form-title-label", children: t("fields.title") }),
151
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-title-control", children: /* @__PURE__ */ jsx2(Input, { ...field, placeholder: t("fields.title"), "data-testid": "inventory-create-form-title-input" }) }),
152
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-title-error" })
153
+ ] })
154
+ }
155
+ ),
156
+ /* @__PURE__ */ jsx2(
157
+ Form.Field,
158
+ {
159
+ control: form.control,
160
+ name: "sku",
161
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-sku-item", children: [
162
+ /* @__PURE__ */ jsx2(Form.Label, { "data-testid": "inventory-create-form-sku-label", children: t("fields.sku") }),
163
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-sku-control", children: /* @__PURE__ */ jsx2(Input, { ...field, placeholder: "sku-123", "data-testid": "inventory-create-form-sku-input" }) }),
164
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-sku-error" })
165
+ ] })
166
+ }
167
+ )
168
+ ] }),
169
+ /* @__PURE__ */ jsx2(
170
+ Form.Field,
171
+ {
172
+ control: form.control,
173
+ name: "description",
174
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-description-item", children: [
175
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-description-label", children: t("products.fields.description.label") }),
176
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-description-control", children: /* @__PURE__ */ jsx2(Textarea, { ...field, placeholder: "The item description", "data-testid": "inventory-create-form-description-textarea" }) }),
177
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-description-error" })
178
+ ] })
179
+ }
180
+ )
181
+ ] }),
182
+ /* @__PURE__ */ jsx2(
183
+ SwitchBox,
184
+ {
185
+ control: form.control,
186
+ name: "requires_shipping",
187
+ label: t("inventory.create.requiresShipping"),
188
+ description: t("inventory.create.requiresShippingHint"),
189
+ "data-testid": "inventory-create-form-requires-shipping"
190
+ }
191
+ )
192
+ ] }),
193
+ /* @__PURE__ */ jsx2(Divider, {}),
194
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-6", children: [
195
+ /* @__PURE__ */ jsx2(Heading, { level: "h2", children: t("inventory.create.attributes") }),
196
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-x-4 gap-y-4 lg:grid-cols-2 lg:gap-y-8", children: [
197
+ /* @__PURE__ */ jsx2(
198
+ Form.Field,
199
+ {
200
+ control: form.control,
201
+ name: "width",
202
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-width-item", children: [
203
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-width-label", children: t("products.fields.width.label") }),
204
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-width-control", children: /* @__PURE__ */ jsx2(Input, { ...field, type: "number", min: 0, placeholder: "100", "data-testid": "inventory-create-form-width-input" }) }),
205
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-width-error" })
206
+ ] })
207
+ }
208
+ ),
209
+ /* @__PURE__ */ jsx2(
210
+ Form.Field,
211
+ {
212
+ control: form.control,
213
+ name: "length",
214
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-length-item", children: [
215
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-length-label", children: t("products.fields.length.label") }),
216
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-length-control", children: /* @__PURE__ */ jsx2(Input, { ...field, type: "number", min: 0, placeholder: "100", "data-testid": "inventory-create-form-length-input" }) }),
217
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-length-error" })
218
+ ] })
219
+ }
220
+ ),
221
+ /* @__PURE__ */ jsx2(
222
+ Form.Field,
223
+ {
224
+ control: form.control,
225
+ name: "height",
226
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-height-item", children: [
227
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-height-label", children: t("products.fields.height.label") }),
228
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-height-control", children: /* @__PURE__ */ jsx2(Input, { ...field, type: "number", min: 0, placeholder: "100", "data-testid": "inventory-create-form-height-input" }) }),
229
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-height-error" })
230
+ ] })
231
+ }
232
+ ),
233
+ /* @__PURE__ */ jsx2(
234
+ Form.Field,
235
+ {
236
+ control: form.control,
237
+ name: "weight",
238
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-weight-item", children: [
239
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-weight-label", children: t("products.fields.weight.label") }),
240
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-weight-control", children: /* @__PURE__ */ jsx2(Input, { ...field, type: "number", min: 0, placeholder: "100", "data-testid": "inventory-create-form-weight-input" }) }),
241
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-weight-error" })
242
+ ] })
243
+ }
244
+ ),
245
+ /* @__PURE__ */ jsx2(
246
+ Form.Field,
247
+ {
248
+ control: form.control,
249
+ name: "mid_code",
250
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-mid-code-item", children: [
251
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-mid-code-label", children: t("products.fields.mid_code.label") }),
252
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-mid-code-control", children: /* @__PURE__ */ jsx2(Input, { ...field, "data-testid": "inventory-create-form-mid-code-input" }) }),
253
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-mid-code-error" })
254
+ ] })
255
+ }
256
+ ),
257
+ /* @__PURE__ */ jsx2(
258
+ Form.Field,
259
+ {
260
+ control: form.control,
261
+ name: "hs_code",
262
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-hs-code-item", children: [
263
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-hs-code-label", children: t("products.fields.hs_code.label") }),
264
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-hs-code-control", children: /* @__PURE__ */ jsx2(Input, { ...field, "data-testid": "inventory-create-form-hs-code-input" }) }),
265
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-hs-code-error" })
266
+ ] })
267
+ }
268
+ ),
269
+ /* @__PURE__ */ jsx2(
270
+ Form.Field,
271
+ {
272
+ control: form.control,
273
+ name: "origin_country",
274
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-origin-country-item", children: [
275
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-origin-country-label", children: t("products.fields.countryOrigin.label") }),
276
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-origin-country-control", children: /* @__PURE__ */ jsx2(CountrySelect, { ...field, "data-testid": "inventory-create-form-origin-country-select" }) }),
277
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-origin-country-error" })
278
+ ] })
279
+ }
280
+ ),
281
+ /* @__PURE__ */ jsx2(
282
+ Form.Field,
283
+ {
284
+ control: form.control,
285
+ name: "material",
286
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "inventory-create-form-material-item", children: [
287
+ /* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "inventory-create-form-material-label", children: t("products.fields.material.label") }),
288
+ /* @__PURE__ */ jsx2(Form.Control, { "data-testid": "inventory-create-form-material-control", children: /* @__PURE__ */ jsx2(Input, { ...field, "data-testid": "inventory-create-form-material-input" }) }),
289
+ /* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "inventory-create-form-material-error" })
290
+ ] })
291
+ }
292
+ )
293
+ ] })
294
+ ] })
295
+ ] }) });
296
+ };
297
+ Root2._tabMeta = defineTabMeta({
298
+ id: "details",
299
+ labelKey: "inventory.create.details",
300
+ validationFields: [
301
+ "title",
302
+ "sku",
303
+ "description",
304
+ "hs_code",
305
+ "weight",
306
+ "length",
307
+ "height",
308
+ "width",
309
+ "origin_country",
310
+ "mid_code",
311
+ "material",
312
+ "requires_shipping",
313
+ "thumbnail"
314
+ ]
315
+ });
316
+ var InventoryCreateDetailsTab = Root2;
317
+
318
+ // src/pages/inventory/inventory-create/components/inventory-create-form/inventory-create-form.tsx
319
+ import { jsx as jsx3 } from "react/jsx-runtime";
320
+ function InventoryCreateForm({
321
+ locations,
322
+ children,
323
+ schema,
324
+ defaultValues: extraDefaults
325
+ }) {
326
+ const { t } = useTranslation3();
327
+ const { handleSuccess } = useRouteModal();
328
+ const form = useForm({
329
+ defaultValues: {
330
+ title: "",
331
+ sku: "",
332
+ hs_code: "",
333
+ weight: "",
334
+ length: "",
335
+ height: "",
336
+ width: "",
337
+ origin_country: "",
338
+ mid_code: "",
339
+ material: "",
340
+ description: "",
341
+ requires_shipping: true,
342
+ thumbnail: "",
343
+ locations: Object.fromEntries(
344
+ locations.map((location) => [location.id, ""])
345
+ ),
346
+ ...extraDefaults
347
+ },
348
+ resolver: zodResolver(schema ?? CreateInventoryItemSchema)
349
+ });
350
+ const { mutateAsync: createInventoryItem, isPending: isLoading } = useCreateInventoryItem();
351
+ const handleSubmit = form.handleSubmit(async (data) => {
352
+ const { locations: formLocations, weight, length, height, width, ...payload } = data;
353
+ const cleanData = transformNullableFormData(payload, false);
354
+ const cleanNumbers = transformNullableFormNumbers(
355
+ { weight, length, height, width },
356
+ false
357
+ );
358
+ const { inventory_item } = await createInventoryItem(
359
+ {
360
+ ...cleanData,
361
+ ...cleanNumbers
362
+ },
363
+ {
364
+ onError: (e) => {
365
+ toast.error(e.message);
366
+ return;
367
+ }
368
+ }
369
+ );
370
+ await sdk.admin.inventoryItem.batchUpdateLevels(inventory_item.id, {
371
+ create: Object.entries(formLocations ?? {}).filter(([_, quantiy]) => !!quantiy).map(([location_id, stocked_quantity]) => ({
372
+ location_id,
373
+ stocked_quantity: transformNullableFormNumber(
374
+ stocked_quantity,
375
+ false
376
+ )
377
+ }))
378
+ }).then(async () => {
379
+ await queryClient.invalidateQueries({
380
+ queryKey: inventoryItemsQueryKeys.lists()
381
+ });
382
+ }).catch((e) => {
383
+ toast.error(e.message);
384
+ }).finally(() => {
385
+ handleSuccess();
386
+ toast.success(t("inventory.create.successToast"));
387
+ });
388
+ });
389
+ const defaultTabs = useMemo2(
390
+ () => [
391
+ /* @__PURE__ */ jsx3(InventoryCreateDetailsTab, {}, "details"),
392
+ /* @__PURE__ */ jsx3(InventoryAvailabilityForm, { locations }, "availability")
393
+ ],
394
+ [locations]
395
+ );
396
+ const hasCustomChildren = Children.count(children) > 0;
397
+ return /* @__PURE__ */ jsx3(
398
+ TabbedForm,
399
+ {
400
+ form,
401
+ onSubmit: handleSubmit,
402
+ isLoading,
403
+ children: hasCustomChildren ? children : defaultTabs
404
+ }
405
+ );
406
+ }
407
+
408
+ // src/pages/inventory/inventory-create/inventory-create.tsx
409
+ import { jsx as jsx4 } from "react/jsx-runtime";
410
+ var Root3 = ({ children }) => {
411
+ const { isPending, stock_locations, isError, error } = useStockLocations({
412
+ limit: 9999,
413
+ fields: "id,name"
414
+ });
415
+ const ready = !isPending && !!stock_locations;
416
+ if (isError) {
417
+ throw error;
418
+ }
419
+ return /* @__PURE__ */ jsx4(RouteFocusModal, { children: ready && (Children2.count(children) > 0 ? children : /* @__PURE__ */ jsx4(InventoryCreateForm, { locations: stock_locations })) });
420
+ };
421
+ var InventoryCreatePage = Object.assign(Root3, {
422
+ Form: InventoryCreateForm,
423
+ DetailsTab: InventoryCreateDetailsTab,
424
+ AvailabilityTab: InventoryAvailabilityForm,
425
+ Tab: TabbedForm.Tab
426
+ });
427
+ var InventoryCreate = Root3;
428
+
429
+ export {
430
+ CreateInventoryItemSchema,
431
+ InventoryCreatePage,
432
+ InventoryCreate
433
+ };
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-ULJ3OMWU.js";
8
8
  import {
9
9
  SingleColumnPage
10
- } from "./chunk-U2UCL2VG.js";
10
+ } from "./chunk-XIZLPYEE.js";
11
11
  import {
12
12
  SingleColumnPageSkeleton
13
13
  } from "./chunk-INNFZYX2.js";
@@ -335,7 +335,7 @@ var ProductListCellActions = ({
335
335
  };
336
336
 
337
337
  // src/pages/sales-channels/sales-channel-detail/sales-channel-detail.tsx
338
- import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
338
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
339
339
  var Root = ({ children }) => {
340
340
  const initialData = useLoaderData();
341
341
  const { id } = useParams();
@@ -345,16 +345,16 @@ var Root = ({ children }) => {
345
345
  if (isLoading || !sales_channel) {
346
346
  return /* @__PURE__ */ jsx3(SingleColumnPageSkeleton, { sections: 2, showJSON: true, showMetadata: true });
347
347
  }
348
- return /* @__PURE__ */ jsx3(SingleColumnPage, { showJSON: true, showMetadata: true, data: sales_channel, children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs3(Fragment, { children: [
348
+ return Children.count(children) > 0 ? /* @__PURE__ */ jsx3(SingleColumnPage, { showJSON: true, showMetadata: true, data: sales_channel, children }) : /* @__PURE__ */ jsxs3(SingleColumnPage, { showJSON: true, showMetadata: true, data: sales_channel, children: [
349
349
  /* @__PURE__ */ jsx3(SalesChannelGeneralSection, { salesChannel: sales_channel }),
350
350
  /* @__PURE__ */ jsx3(SalesChannelProductSection, { salesChannel: sales_channel })
351
- ] }) });
351
+ ] });
352
352
  };
353
- var SalesChannelDetail = Object.assign(Root, {
353
+ var SalesChannelDetailPage = Object.assign(Root, {
354
354
  GeneralSection: SalesChannelGeneralSection,
355
355
  ProductSection: SalesChannelProductSection
356
356
  });
357
357
 
358
358
  export {
359
- SalesChannelDetail
359
+ SalesChannelDetailPage
360
360
  };
@@ -8,7 +8,7 @@ import {
8
8
  DataGrid,
9
9
  createDataGridHelper,
10
10
  createDataGridPriceColumns
11
- } from "./chunk-KUWNYCGL.js";
11
+ } from "./chunk-U3OWJE7V.js";
12
12
  import {
13
13
  useRegions
14
14
  } from "./chunk-QSM56ZOP.js";
@@ -66,6 +66,53 @@ var usePriceListCurrencyData = () => {
66
66
  return { regions, currencies, pricePreferences, isReady };
67
67
  };
68
68
 
69
+ // src/pages/price-lists/common/schemas.ts
70
+ import { z } from "zod";
71
+ var PriceListCustomerGroupSchema = z.object({
72
+ id: z.string(),
73
+ name: z.string()
74
+ });
75
+ var PriceListRulesSchema = z.object({
76
+ customer_group_id: z.array(PriceListCustomerGroupSchema).nullish()
77
+ });
78
+ var PriceListCreateCurrencyPriceSchema = z.object({
79
+ amount: z.string().or(z.number()).optional()
80
+ });
81
+ var PriceListCreateRegionPriceSchema = z.object({
82
+ amount: z.string().or(z.number()).optional()
83
+ });
84
+ var PriceListCreateProductVariantSchema = z.object({
85
+ currency_prices: z.record(PriceListCreateCurrencyPriceSchema.optional()),
86
+ region_prices: z.record(PriceListCreateRegionPriceSchema.optional())
87
+ });
88
+ var PriceListCreateProductVariantsSchema = z.record(
89
+ PriceListCreateProductVariantSchema
90
+ );
91
+ var PriceListCreateProductsSchema = z.record(
92
+ z.object({
93
+ variants: PriceListCreateProductVariantsSchema
94
+ })
95
+ );
96
+ var PriceListUpdateCurrencyPriceSchema = z.object({
97
+ amount: z.string().or(z.number()).optional(),
98
+ id: z.string().nullish()
99
+ });
100
+ var PriceListUpdateRegionPriceSchema = z.object({
101
+ amount: z.string().or(z.number()).optional(),
102
+ id: z.string().nullish()
103
+ });
104
+ var PriceListUpdateProductVariantsSchema = z.record(
105
+ z.object({
106
+ currency_prices: z.record(PriceListUpdateCurrencyPriceSchema.optional()),
107
+ region_prices: z.record(PriceListUpdateRegionPriceSchema.optional())
108
+ })
109
+ );
110
+ var PriceListUpdateProductsSchema = z.record(
111
+ z.object({
112
+ variants: PriceListUpdateProductVariantsSchema
113
+ })
114
+ );
115
+
69
116
  // src/pages/price-lists/common/hooks/use-price-list-grid-columns.tsx
70
117
  import { useMemo } from "react";
71
118
  import { useTranslation } from "react-i18next";
@@ -119,53 +166,6 @@ var usePriceListGridColumns = ({
119
166
  return colDefs;
120
167
  };
121
168
 
122
- // src/pages/price-lists/common/schemas.ts
123
- import { z } from "zod";
124
- var PriceListCustomerGroupSchema = z.object({
125
- id: z.string(),
126
- name: z.string()
127
- });
128
- var PriceListRulesSchema = z.object({
129
- customer_group_id: z.array(PriceListCustomerGroupSchema).nullish()
130
- });
131
- var PriceListCreateCurrencyPriceSchema = z.object({
132
- amount: z.string().or(z.number()).optional()
133
- });
134
- var PriceListCreateRegionPriceSchema = z.object({
135
- amount: z.string().or(z.number()).optional()
136
- });
137
- var PriceListCreateProductVariantSchema = z.object({
138
- currency_prices: z.record(PriceListCreateCurrencyPriceSchema.optional()),
139
- region_prices: z.record(PriceListCreateRegionPriceSchema.optional())
140
- });
141
- var PriceListCreateProductVariantsSchema = z.record(
142
- PriceListCreateProductVariantSchema
143
- );
144
- var PriceListCreateProductsSchema = z.record(
145
- z.object({
146
- variants: PriceListCreateProductVariantsSchema
147
- })
148
- );
149
- var PriceListUpdateCurrencyPriceSchema = z.object({
150
- amount: z.string().or(z.number()).optional(),
151
- id: z.string().nullish()
152
- });
153
- var PriceListUpdateRegionPriceSchema = z.object({
154
- amount: z.string().or(z.number()).optional(),
155
- id: z.string().nullish()
156
- });
157
- var PriceListUpdateProductVariantsSchema = z.record(
158
- z.object({
159
- currency_prices: z.record(PriceListUpdateCurrencyPriceSchema.optional()),
160
- region_prices: z.record(PriceListUpdateRegionPriceSchema.optional())
161
- })
162
- );
163
- var PriceListUpdateProductsSchema = z.record(
164
- z.object({
165
- variants: PriceListUpdateProductVariantsSchema
166
- })
167
- );
168
-
169
169
  export {
170
170
  usePriceListCurrencyData,
171
171
  usePriceListGridColumns,