@medusajs/dashboard 2.10.4-snapshot-20250929174531 → 2.10.4-snapshot-20250930123356

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 (125) hide show
  1. package/dist/{add-campaign-promotions-3BB3BLFD.mjs → add-campaign-promotions-YATCZFPA.mjs} +3 -3
  2. package/dist/{api-key-management-detail-ZQLQKGYF.mjs → api-key-management-detail-6URA7AKM.mjs} +1 -2
  3. package/dist/app.js +152 -74
  4. package/dist/app.mjs +3 -4
  5. package/dist/{campaign-create-CQ3XBHSY.mjs → campaign-create-SGLXQU2F.mjs} +3 -2
  6. package/dist/{campaign-detail-LASOFZ2O.mjs → campaign-detail-6WW6QFB2.mjs} +5 -6
  7. package/dist/{categories-metadata-HUIY6V4F.mjs → categories-metadata-LISTDI2Y.mjs} +1 -2
  8. package/dist/{category-detail-ZJJBYVFX.mjs → category-detail-K3GNLMQZ.mjs} +2 -3
  9. package/dist/{category-products-7N4TITQ4.mjs → category-products-EGGFU5IA.mjs} +2 -3
  10. package/dist/{chunk-5WMJLYEP.mjs → chunk-4KGC42TY.mjs} +1 -1
  11. package/dist/{chunk-NFQXNOP7.mjs → chunk-55PVXDDC.mjs} +1 -1
  12. package/dist/{chunk-7DFTLGA5.mjs → chunk-7PAOPX4A.mjs} +102 -102
  13. package/dist/{chunk-U4R5MBF2.mjs → chunk-ASFB7W5A.mjs} +1 -1
  14. package/dist/{chunk-DKOCYXB5.mjs → chunk-CLIAKOWC.mjs} +10 -2
  15. package/dist/{chunk-AXXGAOQL.mjs → chunk-ENN7KGKR.mjs} +9 -4
  16. package/dist/{chunk-CY33DS7K.mjs → chunk-GOJZH5OP.mjs} +52 -1
  17. package/dist/{chunk-IP2QPPWC.mjs → chunk-HGAQ6CRN.mjs} +1 -1
  18. package/dist/{chunk-PAG2HG6I.mjs → chunk-LFSI4NJU.mjs} +94 -22
  19. package/dist/{chunk-7JJTWGHU.mjs → chunk-S34JJVBQ.mjs} +7 -0
  20. package/dist/{chunk-QPLPGRYF.mjs → chunk-TR3FWQXE.mjs} +1 -1
  21. package/dist/{chunk-CXTAH75K.mjs → chunk-VLNUSUNX.mjs} +1 -1
  22. package/dist/{chunk-RBDAWRFF.mjs → chunk-W4JWOYEI.mjs} +1 -1
  23. package/dist/{chunk-XR7I5HGZ.mjs → chunk-WKSE3SCT.mjs} +1 -1
  24. package/dist/{chunk-VWQYN2RW.mjs → chunk-ZEED3CMI.mjs} +1 -1
  25. package/dist/{collection-add-products-WKMNYPLS.mjs → collection-add-products-3FN6PUXN.mjs} +2 -3
  26. package/dist/{collection-detail-NONKXELG.mjs → collection-detail-3XJA3YAW.mjs} +2 -3
  27. package/dist/{collection-list-3ZHLS2LP.mjs → collection-list-SDEPSNRJ.mjs} +2 -3
  28. package/dist/{collection-metadata-J6P3K7U6.mjs → collection-metadata-U3U5IAXY.mjs} +1 -2
  29. package/dist/{customer-detail-5Y7ICDMA.mjs → customer-detail-3LRBZ3JI.mjs} +1 -2
  30. package/dist/{customer-group-detail-PXP73BFA.mjs → customer-group-detail-PSWUMSNT.mjs} +1 -2
  31. package/dist/{customer-group-list-3DB643XQ.mjs → customer-group-list-CWMPWYDT.mjs} +1 -2
  32. package/dist/{customers-add-customer-group-BVUVU46N.mjs → customers-add-customer-group-B2A4NE3V.mjs} +1 -2
  33. package/dist/{edit-rules-3MSTPCE5.mjs → edit-rules-5IC62HEP.mjs} +1 -2
  34. package/dist/{inventory-create-NEYX7PZJ.mjs → inventory-create-W5TWRGTB.mjs} +1 -2
  35. package/dist/{inventory-detail-66HDQL3W.mjs → inventory-detail-NA3TYSDI.mjs} +1 -2
  36. package/dist/{inventory-metadata-OSTUWM23.mjs → inventory-metadata-IHX3PKUU.mjs} +1 -2
  37. package/dist/{inventory-stock-XY2OCAY3.mjs → inventory-stock-N63HVL4Y.mjs} +1 -2
  38. package/dist/{location-detail-UZHD3IKW.mjs → location-detail-LTPCPYBB.mjs} +1 -2
  39. package/dist/{location-fulfillment-providers-D4RMKQXU.mjs → location-fulfillment-providers-D7RUW43H.mjs} +2 -3
  40. package/dist/{location-service-zone-shipping-option-create-OASLL2K7.mjs → location-service-zone-shipping-option-create-7OWIMXRU.mjs} +1 -2
  41. package/dist/{login-LQRL2ZDY.mjs → login-35YVS44T.mjs} +1 -2
  42. package/dist/{order-create-claim-7UF734QH.mjs → order-create-claim-IL5IJQDA.mjs} +1 -2
  43. package/dist/{order-create-edit-MZHUVTGE.mjs → order-create-edit-MZZBDG2K.mjs} +1 -2
  44. package/dist/{order-create-exchange-2UGEF65S.mjs → order-create-exchange-CWS4HFYS.mjs} +1 -2
  45. package/dist/{order-create-fulfillment-HGJ2YPUB.mjs → order-create-fulfillment-I22AFZNL.mjs} +1 -2
  46. package/dist/{order-create-refund-CJDKVBSE.mjs → order-create-refund-MGNKZZU7.mjs} +18 -79
  47. package/dist/{order-create-shipment-3FDVQ6WT.mjs → order-create-shipment-DQ2MGT73.mjs} +1 -2
  48. package/dist/{order-detail-SEPCRJW5.mjs → order-detail-G3IQFZ4U.mjs} +4 -8
  49. package/dist/{order-edit-billing-address-J75NQFRY.mjs → order-edit-billing-address-LBI4BH2D.mjs} +1 -2
  50. package/dist/{order-edit-email-ABFQKE6A.mjs → order-edit-email-LZIAGMIQ.mjs} +1 -2
  51. package/dist/{order-edit-shipping-address-OXW7TAJD.mjs → order-edit-shipping-address-7ASMMZHB.mjs} +1 -2
  52. package/dist/{order-metadata-5NF3ICQL.mjs → order-metadata-WKPBFYBS.mjs} +1 -2
  53. package/dist/{order-receive-return-IM65P7XQ.mjs → order-receive-return-5NEE4MCK.mjs} +1 -2
  54. package/dist/{order-request-transfer-LZ25KEDA.mjs → order-request-transfer-3VT2ZUA7.mjs} +1 -2
  55. package/dist/{price-list-create-EC5VGCMW.mjs → price-list-create-RSXHRPDW.mjs} +2 -3
  56. package/dist/{price-list-detail-CRTJA5O4.mjs → price-list-detail-27WN2S6M.mjs} +2 -3
  57. package/dist/{price-list-prices-add-HYCM4QDY.mjs → price-list-prices-add-P76O76X3.mjs} +2 -3
  58. package/dist/{product-attributes-WVQRK3GQ.mjs → product-attributes-XSMFVMPL.mjs} +4 -5
  59. package/dist/{product-create-PWSPOVUS.mjs → product-create-IGZFHXVZ.mjs} +4 -5
  60. package/dist/{product-create-variant-V2QGXFEF.mjs → product-create-variant-3A7UARG7.mjs} +1 -2
  61. package/dist/{product-detail-EBPCCBI4.mjs → product-detail-CW42KVKT.mjs} +4 -5
  62. package/dist/{product-edit-5E6D43KE.mjs → product-edit-EXLC7FN7.mjs} +4 -5
  63. package/dist/{product-export-VFC3I5DK.mjs → product-export-EIIBIYBL.mjs} +2 -3
  64. package/dist/{product-import-V7EZJ2TU.mjs → product-import-WXFKSQMH.mjs} +1 -2
  65. package/dist/{product-list-FFZO57JG.mjs → product-list-KEND4NTM.mjs} +2 -3
  66. package/dist/{product-media-TRKQTA4G.mjs → product-media-NJZ6JSA7.mjs} +2 -2
  67. package/dist/{product-metadata-VYQ65KYI.mjs → product-metadata-6WVU7KCL.mjs} +1 -2
  68. package/dist/{product-organization-OCVSTKEK.mjs → product-organization-V2LE3CYO.mjs} +4 -5
  69. package/dist/{product-shipping-profile-SG6NDHF4.mjs → product-shipping-profile-K4FB5YNC.mjs} +4 -5
  70. package/dist/{product-stock-LJRYRSKN.mjs → product-stock-EYYSNQN6.mjs} +1 -2
  71. package/dist/{product-tag-create-EB5CVUOP.mjs → product-tag-create-LZJJQDDN.mjs} +1 -2
  72. package/dist/{product-tag-detail-V5CZY4R4.mjs → product-tag-detail-IZWWHAL4.mjs} +4 -5
  73. package/dist/{product-tag-edit-YATSW5OK.mjs → product-tag-edit-GJ7T5EWE.mjs} +1 -2
  74. package/dist/{product-tag-list-2LFGEFGL.mjs → product-tag-list-CT5SDORF.mjs} +4 -5
  75. package/dist/{product-tag-metadata-R5P5FWAZ.mjs → product-tag-metadata-2PE6F6PT.mjs} +1 -2
  76. package/dist/{product-type-detail-BZNI5GJ5.mjs → product-type-detail-X7TH5D5P.mjs} +2 -3
  77. package/dist/{product-type-metadata-SUQHWLWA.mjs → product-type-metadata-UBVJNWEL.mjs} +1 -2
  78. package/dist/{product-variant-detail-W2JHQQQJ.mjs → product-variant-detail-IUAHUIF3.mjs} +1 -2
  79. package/dist/{product-variant-edit-DSY77FF4.mjs → product-variant-edit-7QDJ2IRD.mjs} +1 -2
  80. package/dist/{product-variant-metadata-HE3MRTJB.mjs → product-variant-metadata-VNDDDM3T.mjs} +1 -2
  81. package/dist/{promotion-add-campaign-YOUUM6RB.mjs → promotion-add-campaign-SOGZKDNX.mjs} +2 -2
  82. package/dist/{promotion-create-NBFV4XQV.mjs → promotion-create-DRWLH3CY.mjs} +8 -5
  83. package/dist/{promotion-detail-247QD6DA.mjs → promotion-detail-VHNQCTRH.mjs} +3 -4
  84. package/dist/{promotion-list-WDHOSD55.mjs → promotion-list-6KMDX6OB.mjs} +3 -3
  85. package/dist/{refund-reason-create-45ZZOX7F.mjs → refund-reason-create-77GSQ4W5.mjs} +38 -3
  86. package/dist/{refund-reason-edit-E2HDAQZI.mjs → refund-reason-edit-UHR7VTDK.mjs} +49 -1
  87. package/dist/{refund-reason-list-WI7NHRDS.mjs → refund-reason-list-WIIPT75C.mjs} +3 -4
  88. package/dist/{region-metadata-3JIGHAUI.mjs → region-metadata-6VLWB5VQ.mjs} +1 -2
  89. package/dist/{reservation-detail-FENCNQDA.mjs → reservation-detail-3ATQ33U7.mjs} +1 -2
  90. package/dist/{reservation-metadata-DQ3A7MHU.mjs → reservation-metadata-2SVXKSIC.mjs} +1 -2
  91. package/dist/{reset-password-LCVV4NOA.mjs → reset-password-AOR576NC.mjs} +1 -1
  92. package/dist/{return-reason-list-FW7OYUOW.mjs → return-reason-list-T7KQHIYV.mjs} +1 -1
  93. package/dist/{sales-channel-add-products-G4EUOCWY.mjs → sales-channel-add-products-UFRCO4JR.mjs} +2 -3
  94. package/dist/{sales-channel-detail-NT7PEVVH.mjs → sales-channel-detail-4B6KT7EU.mjs} +2 -3
  95. package/dist/{sales-channel-list-REV2RETE.mjs → sales-channel-list-3KAKOZV7.mjs} +1 -2
  96. package/dist/{sales-channel-metadata-O5O6ADG5.mjs → sales-channel-metadata-VWG77T3Y.mjs} +1 -2
  97. package/dist/{shipping-option-type-create-7FSJNHHA.mjs → shipping-option-type-create-ZSUEJDPC.mjs} +1 -2
  98. package/dist/{shipping-option-type-detail-6UQST7RY.mjs → shipping-option-type-detail-LUIV6WLP.mjs} +2 -3
  99. package/dist/{shipping-option-type-edit-B475WRRR.mjs → shipping-option-type-edit-MC4UYHRM.mjs} +1 -2
  100. package/dist/{shipping-option-type-list-DTETSFSA.mjs → shipping-option-type-list-AA3VLD4U.mjs} +2 -3
  101. package/dist/{shipping-profile-metadata-PRINFNSY.mjs → shipping-profile-metadata-37X46LSP.mjs} +1 -2
  102. package/dist/{store-detail-QKF2TVNW.mjs → store-detail-PGMGDA2T.mjs} +1 -2
  103. package/dist/{store-metadata-M6GIKI5P.mjs → store-metadata-DPM7CH4C.mjs} +1 -2
  104. package/dist/{tax-region-create-4DTM3RTZ.mjs → tax-region-create-EFDLXWCS.mjs} +2 -3
  105. package/dist/{tax-region-detail-SLCI3JYL.mjs → tax-region-detail-S5R5D4KY.mjs} +2 -3
  106. package/dist/{tax-region-edit-CJ63JXFQ.mjs → tax-region-edit-ECTOKAGZ.mjs} +1 -2
  107. package/dist/{tax-region-province-detail-BGL2USQF.mjs → tax-region-province-detail-7DEEXMWA.mjs} +1 -2
  108. package/dist/{tax-region-tax-override-create-L4WOTSBO.mjs → tax-region-tax-override-create-6EHKZAZ4.mjs} +4 -5
  109. package/dist/{tax-region-tax-override-edit-2JAVNE37.mjs → tax-region-tax-override-edit-AZBQQPYI.mjs} +4 -5
  110. package/dist/{user-metadata-DFTGB46F.mjs → user-metadata-HPKKLNTP.mjs} +1 -2
  111. package/dist/{workflow-execution-detail-YNT2RKIP.mjs → workflow-execution-detail-Z6JEL2HO.mjs} +1 -2
  112. package/package.json +9 -9
  113. package/src/hooks/table/columns/use-refund-reason-table-columns.tsx +7 -0
  114. package/src/i18n/translations/$schema.json +36 -2
  115. package/src/i18n/translations/en.json +10 -2
  116. package/src/routes/campaigns/campaign-create/components/create-campaign-form/create-campaign-form.tsx +7 -2
  117. package/src/routes/campaigns/campaign-detail/components/campaign-budget/campaign-budget.tsx +5 -1
  118. package/src/routes/campaigns/common/components/create-campaign-form-fields/create-campaign-form-fields.tsx +50 -1
  119. package/src/routes/campaigns/common/constants.ts +1 -0
  120. package/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx +12 -76
  121. package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +1 -5
  122. package/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +7 -0
  123. package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx +46 -0
  124. package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx +23 -1
  125. package/dist/chunk-5U3FFMC7.mjs +0 -84
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  usePromotionTableColumns,
3
3
  usePromotionTableQuery
4
- } from "./chunk-U4R5MBF2.mjs";
5
- import "./chunk-IP2QPPWC.mjs";
4
+ } from "./chunk-ASFB7W5A.mjs";
5
+ import "./chunk-HGAQ6CRN.mjs";
6
6
  import "./chunk-MSDRGCRR.mjs";
7
7
  import "./chunk-ADOCJB6L.mjs";
8
8
  import "./chunk-LQTHYS2Z.mjs";
@@ -30,7 +30,7 @@ import {
30
30
  useRouteModal
31
31
  } from "./chunk-4TC5YS65.mjs";
32
32
  import "./chunk-4GQOUCX6.mjs";
33
- import "./chunk-DKOCYXB5.mjs";
33
+ import "./chunk-CLIAKOWC.mjs";
34
34
  import "./chunk-LPEUYMRK.mjs";
35
35
  import "./chunk-OC7BQLYI.mjs";
36
36
  import "./chunk-S4DMV3ZT.mjs";
@@ -38,9 +38,8 @@ import {
38
38
  import "./chunk-OC7BQLYI.mjs";
39
39
  import "./chunk-S4DMV3ZT.mjs";
40
40
  import "./chunk-67ORSRVT.mjs";
41
- import "./chunk-PAG2HG6I.mjs";
41
+ import "./chunk-LFSI4NJU.mjs";
42
42
  import "./chunk-KOSCMAIC.mjs";
43
- import "./chunk-5U3FFMC7.mjs";
44
43
  import "./chunk-X6DSNTTX.mjs";
45
44
  import "./chunk-I6E6CALJ.mjs";
46
45
  import {
package/dist/app.js CHANGED
@@ -11004,7 +11004,7 @@ var init_en = __esm({
11004
11004
  delete: {
11005
11005
  title: "Are you sure?",
11006
11006
  description: "You are about to delete the campaign '{{name}}'. This action cannot be undone.",
11007
- successToast: "Campaign '{{name}}' was successfully created."
11007
+ successToast: "Campaign '{{name}}' was successfully deleted."
11008
11008
  },
11009
11009
  edit: {
11010
11010
  header: "Edit Campaign",
@@ -11048,7 +11048,11 @@ var init_en = __esm({
11048
11048
  type: "Type",
11049
11049
  currency: "Currency",
11050
11050
  limit: "Limit",
11051
- used: "Used"
11051
+ used: "Used",
11052
+ budgetAttribute: "Limit usage per",
11053
+ budgetAttributeTooltip: "Define how many times the promotion can be used by a specific customer or email.",
11054
+ limitBudgetAttributeCustomer: "Budget limit per customer",
11055
+ limitBudgetAttributeEmail: "Budget limit per email"
11052
11056
  },
11053
11057
  type: {
11054
11058
  spend: {
@@ -11571,6 +11575,10 @@ var init_en = __esm({
11571
11575
  label: "Label",
11572
11576
  placeholder: "Gesture of goodwill"
11573
11577
  },
11578
+ code: {
11579
+ label: "Code",
11580
+ placeholder: "gesture_of_goodwill"
11581
+ },
11574
11582
  description: {
11575
11583
  label: "Description",
11576
11584
  placeholder: "Customer had a bad shopping experience"
@@ -127537,7 +127545,6 @@ var init_order_summary_section = __esm({
127537
127545
  ),
127538
127546
  isCreditLinesOpen && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)("div", { className: "flex flex-col gap-1 pl-5", children: creditLines.map((creditLine) => {
127539
127547
  const prettyReference = creditLine.reference?.split("_").join(" ").split("-").join(" ");
127540
- const prettyReferenceId = creditLine.reference_id ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(display_id_default, { id: creditLine.reference_id }) : null;
127541
127548
  return /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)(
127542
127549
  "div",
127543
127550
  {
@@ -127586,8 +127593,6 @@ var init_order_summary_section = __esm({
127586
127593
  children: [
127587
127594
  "(",
127588
127595
  prettyReference,
127589
- " ",
127590
- prettyReferenceId,
127591
127596
  ")"
127592
127597
  ]
127593
127598
  }
@@ -136671,7 +136676,6 @@ var init_create_refund_form = __esm({
136671
136676
  init_api();
136672
136677
  init_currencies2();
136673
136678
  init_format_currency();
136674
- init_format_provider();
136675
136679
  init_money_amount_helpers();
136676
136680
  init_orders2();
136677
136681
  init_use_document_direction();
@@ -136705,22 +136709,10 @@ var init_create_refund_form = __esm({
136705
136709
  amount: {
136706
136710
  value: paymentAmount.toFixed(currency.decimal_digits),
136707
136711
  float: paymentAmount
136708
- },
136709
- note: "",
136710
- refund_reason_id: ""
136712
+ }
136711
136713
  },
136712
136714
  resolver: (0, import_zod45.zodResolver)(CreateRefundSchema)
136713
136715
  });
136714
- (0, import_react185.useEffect)(() => {
136715
- const pendingDifference = order.summary.pending_difference;
136716
- const paymentAmount2 = payment?.amount || 0;
136717
- const pendingAmount = pendingDifference < 0 ? Math.min(Math.abs(pendingDifference), paymentAmount2) : paymentAmount2;
136718
- const normalizedAmount = pendingAmount < 0 ? pendingAmount * -1 : pendingAmount;
136719
- form.setValue("amount", {
136720
- value: normalizedAmount.toFixed(currency.decimal_digits),
136721
- float: normalizedAmount
136722
- });
136723
- }, [payment?.id || ""]);
136724
136716
  const { mutateAsync, isPending } = useRefundPayment(order.id, payment?.id);
136725
136717
  const handleSubmit = form.handleSubmit(async (data) => {
136726
136718
  await mutateAsync(
@@ -136754,55 +136746,18 @@ var init_create_refund_form = __esm({
136754
136746
  className: "flex size-full flex-col overflow-hidden",
136755
136747
  children: [
136756
136748
  /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(RouteDrawer.Body, { className: "flex-1 overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)("div", { className: "flex flex-col gap-y-4", children: [
136757
- /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)(
136758
- import_ui199.Select,
136759
- {
136760
- dir: direction,
136761
- value: paymentId,
136762
- onValueChange: (value) => {
136763
- setPaymentId(value);
136764
- },
136765
- children: [
136766
- /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(import_ui199.Label, { className: "txt-compact-small mb-[-6px] font-sans font-medium", children: t5("orders.payment.selectPaymentToRefund") }),
136767
- /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(import_ui199.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
136768
- import_ui199.Select.Value,
136769
- {
136770
- placeholder: t5("orders.payment.selectPaymentToRefund")
136771
- }
136772
- ) }),
136773
- /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(import_ui199.Select.Content, { children: payments.map((payment2) => {
136774
- const totalRefunded = payment2.refunds.reduce(
136775
- (acc, next) => next.amount + acc,
136776
- 0
136777
- );
136778
- return /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)(
136779
- import_ui199.Select.Item,
136780
- {
136781
- value: payment2.id,
136782
- disabled: !!payment2.canceled_at || totalRefunded >= payment2.amount,
136783
- className: "flex items-center justify-center",
136784
- children: [
136785
- /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)("span", { children: [
136786
- getLocaleAmount(
136787
- payment2.amount,
136788
- payment2.currency_code
136789
- ),
136790
- " - "
136791
- ] }),
136792
- /* @__PURE__ */ (0, import_jsx_runtime275.jsx)("span", { children: formatProvider(payment2.provider_id) }),
136793
- /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)("span", { children: [
136794
- " - (#",
136795
- payment2.id.substring(23),
136796
- ")"
136797
- ] })
136798
- ]
136799
- },
136800
- payment2.id
136801
- );
136802
- }) })
136803
- ]
136804
- }
136805
- ),
136749
+ /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)("div", { className: "flex items-center", children: [
136750
+ /* @__PURE__ */ (0, import_jsx_runtime275.jsx)("span", { children: getLocaleAmount(
136751
+ payment.amount,
136752
+ payment.currency_code
136753
+ ) }),
136754
+ /* @__PURE__ */ (0, import_jsx_runtime275.jsx)("span", { children: "\xA0-\xA0" }),
136755
+ /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)("span", { children: [
136756
+ "(#",
136757
+ payment.id.substring(23),
136758
+ ")"
136759
+ ] })
136760
+ ] }),
136806
136761
  /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
136807
136762
  Form.Field,
136808
136763
  {
@@ -138688,7 +138643,8 @@ var init_constants14 = __esm({
138688
138643
  budget: {
138689
138644
  type: "usage",
138690
138645
  currency_code: null,
138691
- limit: null
138646
+ limit: null,
138647
+ attribute: null
138692
138648
  }
138693
138649
  };
138694
138650
  }
@@ -139222,6 +139178,7 @@ var init_create_campaign_form_fields = __esm({
139222
139178
  init_store();
139223
139179
  init_use_document_direction();
139224
139180
  init_currencies2();
139181
+ init_combobox2();
139225
139182
  import_jsx_runtime295 = require("react/jsx-runtime");
139226
139183
  CreateCampaignFormFields = ({ form, fieldScope = "" }) => {
139227
139184
  const { t: t5 } = (0, import_react_i18next219.useTranslation)();
@@ -139373,13 +139330,14 @@ var init_create_campaign_form_fields = __esm({
139373
139330
  import_ui214.RadioGroup,
139374
139331
  {
139375
139332
  dir: direction,
139376
- className: "flex gap-y-3",
139333
+ className: "flex gap-x-4 gap-y-3",
139377
139334
  ...field,
139378
139335
  onValueChange: field.onChange,
139379
139336
  children: [
139380
139337
  /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
139381
139338
  import_ui214.RadioGroup.ChoiceBox,
139382
139339
  {
139340
+ className: "flex-1",
139383
139341
  value: "usage",
139384
139342
  label: t5("campaigns.budget.type.usage.title"),
139385
139343
  description: t5("campaigns.budget.type.usage.description")
@@ -139388,6 +139346,7 @@ var init_create_campaign_form_fields = __esm({
139388
139346
  /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
139389
139347
  import_ui214.RadioGroup.ChoiceBox,
139390
139348
  {
139349
+ className: "flex-1",
139391
139350
  value: "spend",
139392
139351
  label: t5("campaigns.budget.type.spend.title"),
139393
139352
  description: t5("campaigns.budget.type.spend.description"),
@@ -139490,6 +139449,52 @@ var init_create_campaign_form_fields = __esm({
139490
139449
  ] });
139491
139450
  }
139492
139451
  }
139452
+ ),
139453
+ !isTypeSpend && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
139454
+ Form.Field,
139455
+ {
139456
+ control: form.control,
139457
+ name: `${fieldScope}budget.attribute`,
139458
+ render: ({ field }) => {
139459
+ return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)(Form.Item, { className: "basis-1/2", children: [
139460
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
139461
+ Form.Label,
139462
+ {
139463
+ tooltip: t5(
139464
+ "campaigns.budget.fields.budgetAttributeTooltip"
139465
+ ),
139466
+ children: t5("campaigns.budget.fields.budgetAttribute")
139467
+ }
139468
+ ),
139469
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
139470
+ Combobox,
139471
+ {
139472
+ ...field,
139473
+ onChange: (e) => {
139474
+ if (typeof e === "undefined") {
139475
+ field.onChange(null);
139476
+ } else {
139477
+ field.onChange(e);
139478
+ }
139479
+ },
139480
+ allowClear: true,
139481
+ options: [
139482
+ {
139483
+ label: t5("fields.customer"),
139484
+ value: "customer_id"
139485
+ },
139486
+ {
139487
+ label: t5("fields.email"),
139488
+ value: "customer_email"
139489
+ }
139490
+ ]
139491
+ },
139492
+ "attribute"
139493
+ ) }),
139494
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(Form.ErrorMessage, {})
139495
+ ] });
139496
+ }
139497
+ }
139493
139498
  )
139494
139499
  ] })
139495
139500
  ] });
@@ -139832,8 +139837,9 @@ var init_create_campaign_form = __esm({
139832
139837
  starts_at: zod16.date().nullable(),
139833
139838
  ends_at: zod16.date().nullable(),
139834
139839
  budget: zod16.object({
139840
+ attribute: zod16.string().nullish(),
139835
139841
  limit: zod16.number().min(0).nullish(),
139836
- type: zod16.enum(["spend", "usage"]),
139842
+ type: zod16.enum(["spend", "usage", "use_by_attribute"]),
139837
139843
  currency_code: zod16.string().nullish()
139838
139844
  })
139839
139845
  });
@@ -139846,6 +139852,8 @@ var init_create_campaign_form = __esm({
139846
139852
  resolver: (0, import_zod51.zodResolver)(CreateCampaignSchema)
139847
139853
  });
139848
139854
  const handleSubmit = form.handleSubmit(async (data) => {
139855
+ const attribute = data.budget.attribute || null;
139856
+ const type = attribute ? "use_by_attribute" : data.budget.type;
139849
139857
  await mutateAsync(
139850
139858
  {
139851
139859
  name: data.name,
@@ -139854,7 +139862,8 @@ var init_create_campaign_form = __esm({
139854
139862
  starts_at: data.starts_at,
139855
139863
  ends_at: data.ends_at,
139856
139864
  budget: {
139857
- type: data.budget.type,
139865
+ type,
139866
+ attribute,
139858
139867
  limit: data.budget.limit ? data.budget.limit : void 0,
139859
139868
  currency_code: data.budget.currency_code
139860
139869
  }
@@ -140197,6 +140206,10 @@ var init_create_promotion_form = __esm({
140197
140206
  values: rule.values
140198
140207
  }));
140199
140208
  };
140209
+ if (data.campaign) {
140210
+ data.campaign.budget.attribute = data.campaign.budget.attribute || null;
140211
+ data.campaign.budget.type = data.campaign.budget.attribute ? "use_by_attribute" : data.campaign.budget.type;
140212
+ }
140200
140213
  createPromotion(
140201
140214
  {
140202
140215
  ...promotionData,
@@ -142774,7 +142787,7 @@ var init_campaign_budget = __esm({
142774
142787
  {
142775
142788
  className: "text-ui-fg-subtle ms-10 mt-[1.5px] font-normal",
142776
142789
  level: "h3",
142777
- children: t5("campaigns.fields.budget_limit")
142790
+ children: campaign.budget?.type === "use_by_attribute" ? campaign.budget?.attribute === "customer_id" ? t5("campaigns.budget.fields.limitBudgetAttributeCustomer") : t5("campaigns.budget.fields.limitBudgetAttributeEmail") : t5("campaigns.fields.budget_limit")
142778
142791
  }
142779
142792
  )
142780
142793
  ] }),
@@ -169734,6 +169747,13 @@ var init_use_refund_reason_table_columns = __esm({
169734
169747
  sortAscLabel: t5("filters.sorting.alphabeticallyAsc"),
169735
169748
  sortDescLabel: t5("filters.sorting.alphabeticallyDesc")
169736
169749
  }),
169750
+ columnHelper78.accessor("code", {
169751
+ header: () => t5("fields.code"),
169752
+ enableSorting: true,
169753
+ sortLabel: t5("fields.code"),
169754
+ sortAscLabel: t5("filters.sorting.alphabeticallyAsc"),
169755
+ sortDescLabel: t5("filters.sorting.alphabeticallyDesc")
169756
+ }),
169737
169757
  columnHelper78.accessor("description", {
169738
169758
  header: () => t5("fields.description"),
169739
169759
  cell: ({ getValue: getValue2 }) => /* @__PURE__ */ (0, import_jsx_runtime574.jsx)(DescriptionCell, { description: getValue2() }),
@@ -180640,6 +180660,7 @@ var init_refund_reason_create_form = __esm({
180640
180660
  import_jsx_runtime668 = require("react/jsx-runtime");
180641
180661
  RefundReasonCreateSchema = import_zod158.z.object({
180642
180662
  label: import_zod158.z.string().min(1),
180663
+ code: import_zod158.z.string().min(1),
180643
180664
  description: import_zod158.z.string().optional()
180644
180665
  });
180645
180666
  RefundReasonCreateForm = () => {
@@ -180648,10 +180669,14 @@ var init_refund_reason_create_form = __esm({
180648
180669
  const form = (0, import_react_hook_form138.useForm)({
180649
180670
  defaultValues: {
180650
180671
  label: "",
180672
+ code: "",
180651
180673
  description: ""
180652
180674
  },
180653
180675
  resolver: (0, import_zod157.zodResolver)(RefundReasonCreateSchema)
180654
180676
  });
180677
+ const generateCodeFromLabel = (label) => {
180678
+ return label.toLowerCase().replace(/[^a-z0-9]/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "");
180679
+ };
180655
180680
  const { mutateAsync, isPending } = useCreateRefundReason();
180656
180681
  const handleSubmit = form.handleSubmit(async (data) => {
180657
180682
  await mutateAsync(data, {
@@ -180694,6 +180719,37 @@ var init_refund_reason_create_form = __esm({
180694
180719
  ...field,
180695
180720
  placeholder: t5(
180696
180721
  "refundReasons.fields.label.placeholder"
180722
+ ),
180723
+ onChange: (e) => {
180724
+ if (!form.getFieldState("code").isTouched || !form.getValues("code")) {
180725
+ form.setValue(
180726
+ "code",
180727
+ generateCodeFromLabel(e.target.value)
180728
+ );
180729
+ }
180730
+ field.onChange(e);
180731
+ }
180732
+ }
180733
+ ) }),
180734
+ /* @__PURE__ */ (0, import_jsx_runtime668.jsx)(Form.ErrorMessage, {})
180735
+ ] });
180736
+ }
180737
+ }
180738
+ ) }),
180739
+ /* @__PURE__ */ (0, import_jsx_runtime668.jsx)("div", { className: "grid gap-4 md:grid-cols-2", children: /* @__PURE__ */ (0, import_jsx_runtime668.jsx)(
180740
+ Form.Field,
180741
+ {
180742
+ control: form.control,
180743
+ name: "code",
180744
+ render: ({ field }) => {
180745
+ return /* @__PURE__ */ (0, import_jsx_runtime668.jsxs)(Form.Item, { children: [
180746
+ /* @__PURE__ */ (0, import_jsx_runtime668.jsx)(Form.Label, { children: t5("refundReasons.fields.code.label") }),
180747
+ /* @__PURE__ */ (0, import_jsx_runtime668.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime668.jsx)(
180748
+ import_ui438.Input,
180749
+ {
180750
+ ...field,
180751
+ placeholder: t5(
180752
+ "refundReasons.fields.code.placeholder"
180697
180753
  )
180698
180754
  }
180699
180755
  ) }),
@@ -180783,10 +180839,11 @@ var init_refund_reason_edit_form = __esm({
180783
180839
  init_form2();
180784
180840
  init_modals();
180785
180841
  init_keybound_form2();
180786
- init_refund_reasons();
180842
+ init_api();
180787
180843
  import_jsx_runtime670 = require("react/jsx-runtime");
180788
180844
  RefundReasonEditSchema = import_zod160.z.object({
180789
180845
  label: import_zod160.z.string().min(1),
180846
+ code: import_zod160.z.string().min(1),
180790
180847
  description: import_zod160.z.string().optional()
180791
180848
  });
180792
180849
  RefundReasonEditForm = ({
@@ -180797,6 +180854,7 @@ var init_refund_reason_edit_form = __esm({
180797
180854
  const form = (0, import_react_hook_form139.useForm)({
180798
180855
  defaultValues: {
180799
180856
  label: refundReason.label,
180857
+ code: refundReason.code,
180800
180858
  description: refundReason.description ?? void 0
180801
180859
  },
180802
180860
  resolver: (0, import_zod159.zodResolver)(RefundReasonEditSchema)
@@ -180844,6 +180902,26 @@ var init_refund_reason_edit_form = __esm({
180844
180902
  }
180845
180903
  }
180846
180904
  ),
180905
+ /* @__PURE__ */ (0, import_jsx_runtime670.jsx)(
180906
+ Form.Field,
180907
+ {
180908
+ control: form.control,
180909
+ name: "code",
180910
+ render: ({ field }) => {
180911
+ return /* @__PURE__ */ (0, import_jsx_runtime670.jsxs)(Form.Item, { children: [
180912
+ /* @__PURE__ */ (0, import_jsx_runtime670.jsx)(Form.Label, { children: t5("refundReasons.fields.code.label") }),
180913
+ /* @__PURE__ */ (0, import_jsx_runtime670.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime670.jsx)(
180914
+ import_ui439.Input,
180915
+ {
180916
+ ...field,
180917
+ placeholder: t5("refundReasons.fields.code.placeholder")
180918
+ }
180919
+ ) }),
180920
+ /* @__PURE__ */ (0, import_jsx_runtime670.jsx)(Form.ErrorMessage, {})
180921
+ ] });
180922
+ }
180923
+ }
180924
+ ),
180847
180925
  /* @__PURE__ */ (0, import_jsx_runtime670.jsx)(
180848
180926
  Form.Field,
180849
180927
  {
package/dist/app.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  DashboardApp
3
- } from "./chunk-7DFTLGA5.mjs";
3
+ } from "./chunk-7PAOPX4A.mjs";
4
4
  import "./chunk-NQIC7ZFS.mjs";
5
5
  import "./chunk-ONB3JEHR.mjs";
6
6
  import "./chunk-VLOA5XAC.mjs";
7
7
  import "./chunk-4GQOUCX6.mjs";
8
8
  import "./chunk-2VTICXJR.mjs";
9
9
  import "./chunk-D3YQN7HV.mjs";
10
- import "./chunk-DKOCYXB5.mjs";
10
+ import "./chunk-CLIAKOWC.mjs";
11
11
  import "./chunk-MNXC6Q4F.mjs";
12
12
  import "./chunk-C5P5PL3E.mjs";
13
13
  import "./chunk-DG7J63J2.mjs";
@@ -19,9 +19,8 @@ import "./chunk-OC7BQLYI.mjs";
19
19
  import "./chunk-S4DMV3ZT.mjs";
20
20
  import "./chunk-67ORSRVT.mjs";
21
21
  import "./chunk-OBQI23QM.mjs";
22
- import "./chunk-PAG2HG6I.mjs";
22
+ import "./chunk-LFSI4NJU.mjs";
23
23
  import "./chunk-KOSCMAIC.mjs";
24
- import "./chunk-5U3FFMC7.mjs";
25
24
  import "./chunk-X6DSNTTX.mjs";
26
25
  import "./chunk-I6E6CALJ.mjs";
27
26
  import "./chunk-RGP3IXX4.mjs";
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  CreateCampaignForm
3
- } from "./chunk-AXXGAOQL.mjs";
4
- import "./chunk-CY33DS7K.mjs";
3
+ } from "./chunk-ENN7KGKR.mjs";
4
+ import "./chunk-GOJZH5OP.mjs";
5
5
  import "./chunk-F6ZOHZVB.mjs";
6
+ import "./chunk-OFN7DIZA.mjs";
6
7
  import "./chunk-DK4WIVY6.mjs";
7
8
  import "./chunk-IUCDCPJU.mjs";
8
9
  import "./chunk-6HTZNHPT.mjs";
@@ -4,8 +4,8 @@ import {
4
4
  import {
5
5
  usePromotionTableColumns,
6
6
  usePromotionTableQuery
7
- } from "./chunk-U4R5MBF2.mjs";
8
- import "./chunk-IP2QPPWC.mjs";
7
+ } from "./chunk-ASFB7W5A.mjs";
8
+ import "./chunk-HGAQ6CRN.mjs";
9
9
  import "./chunk-MSDRGCRR.mjs";
10
10
  import "./chunk-ADOCJB6L.mjs";
11
11
  import "./chunk-LQTHYS2Z.mjs";
@@ -31,7 +31,7 @@ import {
31
31
  import "./chunk-C76H5USB.mjs";
32
32
  import "./chunk-PFKKVLZX.mjs";
33
33
  import "./chunk-4GQOUCX6.mjs";
34
- import "./chunk-DKOCYXB5.mjs";
34
+ import "./chunk-CLIAKOWC.mjs";
35
35
  import {
36
36
  useExtension
37
37
  } from "./chunk-C5P5PL3E.mjs";
@@ -44,9 +44,8 @@ import {
44
44
  import "./chunk-OC7BQLYI.mjs";
45
45
  import "./chunk-S4DMV3ZT.mjs";
46
46
  import "./chunk-67ORSRVT.mjs";
47
- import "./chunk-PAG2HG6I.mjs";
47
+ import "./chunk-LFSI4NJU.mjs";
48
48
  import "./chunk-KOSCMAIC.mjs";
49
- import "./chunk-5U3FFMC7.mjs";
50
49
  import "./chunk-X6DSNTTX.mjs";
51
50
  import "./chunk-I6E6CALJ.mjs";
52
51
  import "./chunk-RGP3IXX4.mjs";
@@ -129,7 +128,7 @@ var CampaignBudget = ({ campaign }) => {
129
128
  {
130
129
  className: "text-ui-fg-subtle ms-10 mt-[1.5px] font-normal",
131
130
  level: "h3",
132
- children: t("campaigns.fields.budget_limit")
131
+ children: campaign.budget?.type === "use_by_attribute" ? campaign.budget?.attribute === "customer_id" ? t("campaigns.budget.fields.limitBudgetAttributeCustomer") : t("campaigns.budget.fields.limitBudgetAttributeEmail") : t("campaigns.fields.budget_limit")
133
132
  }
134
133
  )
135
134
  ] }),
@@ -11,9 +11,8 @@ import "./chunk-LPEUYMRK.mjs";
11
11
  import "./chunk-OC7BQLYI.mjs";
12
12
  import "./chunk-S4DMV3ZT.mjs";
13
13
  import "./chunk-OBQI23QM.mjs";
14
- import "./chunk-PAG2HG6I.mjs";
14
+ import "./chunk-LFSI4NJU.mjs";
15
15
  import "./chunk-KOSCMAIC.mjs";
16
- import "./chunk-5U3FFMC7.mjs";
17
16
  import "./chunk-X6DSNTTX.mjs";
18
17
  import "./chunk-I6E6CALJ.mjs";
19
18
  import "./chunk-RGP3IXX4.mjs";
@@ -30,7 +30,7 @@ import "./chunk-HQKGZADC.mjs";
30
30
  import "./chunk-EMIHDNB7.mjs";
31
31
  import {
32
32
  useProductTableFilters
33
- } from "./chunk-5WMJLYEP.mjs";
33
+ } from "./chunk-4KGC42TY.mjs";
34
34
  import "./chunk-Z26G6WFJ.mjs";
35
35
  import "./chunk-M3VFKDXJ.mjs";
36
36
  import {
@@ -52,9 +52,8 @@ import {
52
52
  import "./chunk-OC7BQLYI.mjs";
53
53
  import "./chunk-S4DMV3ZT.mjs";
54
54
  import "./chunk-67ORSRVT.mjs";
55
- import "./chunk-PAG2HG6I.mjs";
55
+ import "./chunk-LFSI4NJU.mjs";
56
56
  import "./chunk-KOSCMAIC.mjs";
57
- import "./chunk-5U3FFMC7.mjs";
58
57
  import "./chunk-X6DSNTTX.mjs";
59
58
  import "./chunk-I6E6CALJ.mjs";
60
59
  import "./chunk-RGP3IXX4.mjs";
@@ -18,7 +18,7 @@ import "./chunk-HQKGZADC.mjs";
18
18
  import "./chunk-EMIHDNB7.mjs";
19
19
  import {
20
20
  useProductTableFilters
21
- } from "./chunk-5WMJLYEP.mjs";
21
+ } from "./chunk-4KGC42TY.mjs";
22
22
  import "./chunk-Z26G6WFJ.mjs";
23
23
  import "./chunk-M3VFKDXJ.mjs";
24
24
  import "./chunk-C76H5USB.mjs";
@@ -36,9 +36,8 @@ import "./chunk-LPEUYMRK.mjs";
36
36
  import "./chunk-S4DMV3ZT.mjs";
37
37
  import "./chunk-67ORSRVT.mjs";
38
38
  import "./chunk-OBQI23QM.mjs";
39
- import "./chunk-PAG2HG6I.mjs";
39
+ import "./chunk-LFSI4NJU.mjs";
40
40
  import "./chunk-KOSCMAIC.mjs";
41
- import "./chunk-5U3FFMC7.mjs";
42
41
  import "./chunk-X6DSNTTX.mjs";
43
42
  import "./chunk-I6E6CALJ.mjs";
44
43
  import "./chunk-RGP3IXX4.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useProductTags
3
- } from "./chunk-PAG2HG6I.mjs";
3
+ } from "./chunk-LFSI4NJU.mjs";
4
4
  import {
5
5
  useProductTypes
6
6
  } from "./chunk-B4GODIOW.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-6GU6IDUA.mjs";
11
11
  import {
12
12
  i18n
13
- } from "./chunk-DKOCYXB5.mjs";
13
+ } from "./chunk-CLIAKOWC.mjs";
14
14
  import {
15
15
  Form
16
16
  } from "./chunk-OBQI23QM.mjs";