@shoppexio/storefront-react 0.6.0 → 0.6.1

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.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1
4
+
5
+ - Subscriptions: billing history marks each discounted payment with its code and which term payment it was ("LAUNCH20 · 2 of 3"; the code alone when the code discounts every payment), from the billing-history route's `coupon_payment` (16 locales). 0.6.0 claimed this mark but never read the field. A row whose `coupon_payment` is present but malformed fails the read like any other broken row; a backend that does not send the field yet shows no mark. An ejected account takes `subscriptions.tsx`, `account-subscriptions.ts` and the message catalogs from `eject/account` again.
6
+
3
7
  ## 0.6.0
4
8
 
5
- - Subscriptions: a subscription with a running checkout code shows "CODE · payment 2 of 3 · full price from {date}" (or "every payment" for a forever code) from the dashboard's `discount`, and billing history marks each discounted payment. `SdkCustomerSubscription.discount` (`SdkCustomerSubscriptionDiscount`: code, type and value, cap, payments used and total, discounted, full, saved and next amount, in `currency`) is null without one and absent until the API that sends it is deployed. The plan-change sheet says the code ends with the change and what the new plan costs from the next renewal.
9
+ - Subscriptions: a subscription with a running checkout code shows "CODE · payment 2 of 3 · full price from {date}" (or "every payment" for a forever code) from the dashboard's `discount`. (Billing history did not mark discounted payments in this version; see 0.6.1.) `SdkCustomerSubscription.discount` (`SdkCustomerSubscriptionDiscount`: code, type and value, cap, payments used and total, discounted, full, saved and next amount, in `currency`) is null without one and absent until the API that sends it is deployed. The plan-change sheet says the code ends with the change and what the new plan costs from the next renewal.
6
10
  - Subscriptions: the detail's "Payment provider" shows the gateway's name ("PayPal F&F"), not the gateway key; `gatewayLabel` is the one map the order and the subscription read. An ejected account takes `subscriptions.tsx` and `account-payment-method.ts` from `eject/account` again.
7
11
 
8
12
  ## 0.5.0
package/dist/account.js CHANGED
@@ -512,7 +512,8 @@ var ar_default = {
512
512
  historyFirstOrder: "\u0627\u0644\u0637\u0644\u0628 \u0627\u0644\u0623\u0648\u0644",
513
513
  historyRenewal: "\u062A\u062C\u062F\u064A\u062F",
514
514
  historyPlanChange: "\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062E\u0637\u0629\u060C \u0645\u0646 {from} \u0625\u0644\u0649 {to}",
515
- historyDays: "\u0639\u0646 {days} \u0645\u0646 {total} \u064A\u0648\u0645\u064B\u0627"
515
+ historyDays: "\u0639\u0646 {days} \u0645\u0646 {total} \u064A\u0648\u0645\u064B\u0627",
516
+ historyCouponPayment: "{code} \xB7 {payment} \u0645\u0646 {total}"
516
517
  },
517
518
  favorites: {
518
519
  loading: "\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0645\u0641\u0636\u0644\u062A\u0643",
@@ -1142,7 +1143,8 @@ var de_default = {
1142
1143
  historyFirstOrder: "Erstbestellung",
1143
1144
  historyRenewal: "Verl\xE4ngerung",
1144
1145
  historyPlanChange: "Tarifwechsel, {from} zu {to}",
1145
- historyDays: "f\xFCr {days} von {total} Tagen"
1146
+ historyDays: "f\xFCr {days} von {total} Tagen",
1147
+ historyCouponPayment: "{code} \xB7 {payment} von {total}"
1146
1148
  },
1147
1149
  favorites: {
1148
1150
  loading: "Deine Favoriten werden geladen",
@@ -1772,7 +1774,8 @@ var en_default = {
1772
1774
  historyFirstOrder: "First order",
1773
1775
  historyRenewal: "Renewal",
1774
1776
  historyPlanChange: "Plan change, {from} to {to}",
1775
- historyDays: "for {days} of {total} days"
1777
+ historyDays: "for {days} of {total} days",
1778
+ historyCouponPayment: "{code} \xB7 {payment} of {total}"
1776
1779
  },
1777
1780
  favorites: {
1778
1781
  loading: "Loading your favorites",
@@ -2402,7 +2405,8 @@ var es_default = {
2402
2405
  historyFirstOrder: "Primer pedido",
2403
2406
  historyRenewal: "Renovaci\xF3n",
2404
2407
  historyPlanChange: "Cambio de plan, de {from} a {to}",
2405
- historyDays: "por {days} de {total} d\xEDas"
2408
+ historyDays: "por {days} de {total} d\xEDas",
2409
+ historyCouponPayment: "{code} \xB7 {payment} de {total}"
2406
2410
  },
2407
2411
  favorites: {
2408
2412
  loading: "Cargando tus favoritos",
@@ -3032,7 +3036,8 @@ var fi_default = {
3032
3036
  historyFirstOrder: "Ensimm\xE4inen tilaus",
3033
3037
  historyRenewal: "Uusinta",
3034
3038
  historyPlanChange: "Sopimuksen vaihto, {from} \u2192 {to}",
3035
- historyDays: "{days}/{total} p\xE4iv\xE4lt\xE4"
3039
+ historyDays: "{days}/{total} p\xE4iv\xE4lt\xE4",
3040
+ historyCouponPayment: "{code} \xB7 {payment}/{total}"
3036
3041
  },
3037
3042
  favorites: {
3038
3043
  loading: "Ladataan suosikkejasi",
@@ -3662,7 +3667,8 @@ var fr_default = {
3662
3667
  historyFirstOrder: "Premi\xE8re commande",
3663
3668
  historyRenewal: "Renouvellement",
3664
3669
  historyPlanChange: "Changement de formule, de {from} \xE0 {to}",
3665
- historyDays: "pour {days} jours sur {total}"
3670
+ historyDays: "pour {days} jours sur {total}",
3671
+ historyCouponPayment: "{code} \xB7 {payment} sur {total}"
3666
3672
  },
3667
3673
  favorites: {
3668
3674
  loading: "Chargement de vos favoris",
@@ -4292,7 +4298,8 @@ var hi_default = {
4292
4298
  historyFirstOrder: "\u092A\u0939\u0932\u093E \u0911\u0930\u094D\u0921\u0930",
4293
4299
  historyRenewal: "\u0928\u0935\u0940\u0928\u0940\u0915\u0930\u0923",
4294
4300
  historyPlanChange: "\u092F\u094B\u091C\u0928\u093E \u092C\u0926\u0932\u093E\u0935, {from} \u0938\u0947 {to}",
4295
- historyDays: "{total} \u092E\u0947\u0902 \u0938\u0947 {days} \u0926\u093F\u0928\u094B\u0902 \u0915\u0947 \u0932\u093F\u090F"
4301
+ historyDays: "{total} \u092E\u0947\u0902 \u0938\u0947 {days} \u0926\u093F\u0928\u094B\u0902 \u0915\u0947 \u0932\u093F\u090F",
4302
+ historyCouponPayment: "{code} \xB7 {total} \u092E\u0947\u0902 \u0938\u0947 {payment}"
4296
4303
  },
4297
4304
  favorites: {
4298
4305
  loading: "\u0906\u092A\u0915\u0947 \u092A\u0938\u0902\u0926\u0940\u0926\u093E \u0932\u094B\u0921 \u0939\u094B \u0930\u0939\u0947 \u0939\u0948\u0902",
@@ -4922,7 +4929,8 @@ var it_default = {
4922
4929
  historyFirstOrder: "Primo ordine",
4923
4930
  historyRenewal: "Rinnovo",
4924
4931
  historyPlanChange: "Cambio piano, da {from} a {to}",
4925
- historyDays: "per {days} giorni su {total}"
4932
+ historyDays: "per {days} giorni su {total}",
4933
+ historyCouponPayment: "{code} \xB7 {payment} di {total}"
4926
4934
  },
4927
4935
  favorites: {
4928
4936
  loading: "Caricamento dei tuoi preferiti",
@@ -5552,7 +5560,8 @@ var lt_default = {
5552
5560
  historyFirstOrder: "Pirmas u\u017Esakymas",
5553
5561
  historyRenewal: "Atnaujinimas",
5554
5562
  historyPlanChange: "Plano keitimas, {from} \u2192 {to}",
5555
- historyDays: "u\u017E {days} i\u0161 {total} d."
5563
+ historyDays: "u\u017E {days} i\u0161 {total} d.",
5564
+ historyCouponPayment: "{code} \xB7 {payment} i\u0161 {total}"
5556
5565
  },
5557
5566
  favorites: {
5558
5567
  loading: "\u012Ekeliami j\u016Bs\u0173 m\u0117gstami",
@@ -6182,7 +6191,8 @@ var nl_default = {
6182
6191
  historyFirstOrder: "Eerste bestelling",
6183
6192
  historyRenewal: "Verlenging",
6184
6193
  historyPlanChange: "Pakketwijziging, van {from} naar {to}",
6185
- historyDays: "voor {days} van {total} dagen"
6194
+ historyDays: "voor {days} van {total} dagen",
6195
+ historyCouponPayment: "{code} \xB7 {payment} van {total}"
6186
6196
  },
6187
6197
  favorites: {
6188
6198
  loading: "Je favorieten worden geladen",
@@ -6812,7 +6822,8 @@ var pl_default = {
6812
6822
  historyFirstOrder: "Pierwsze zam\xF3wienie",
6813
6823
  historyRenewal: "Odnowienie",
6814
6824
  historyPlanChange: "Zmiana planu, z {from} na {to}",
6815
- historyDays: "za {days} z {total} dni"
6825
+ historyDays: "za {days} z {total} dni",
6826
+ historyCouponPayment: "{code} \xB7 {payment} z {total}"
6816
6827
  },
6817
6828
  favorites: {
6818
6829
  loading: "Wczytujemy Twoje ulubione",
@@ -7442,7 +7453,8 @@ var pt_default = {
7442
7453
  historyFirstOrder: "Primeiro pedido",
7443
7454
  historyRenewal: "Renova\xE7\xE3o",
7444
7455
  historyPlanChange: "Mudan\xE7a de plano, de {from} para {to}",
7445
- historyDays: "por {days} de {total} dias"
7456
+ historyDays: "por {days} de {total} dias",
7457
+ historyCouponPayment: "{code} \xB7 {payment} de {total}"
7446
7458
  },
7447
7459
  favorites: {
7448
7460
  loading: "A carregar os teus favoritos",
@@ -8072,7 +8084,8 @@ var ru_default = {
8072
8084
  historyFirstOrder: "\u041F\u0435\u0440\u0432\u044B\u0439 \u0437\u0430\u043A\u0430\u0437",
8073
8085
  historyRenewal: "\u041F\u0440\u043E\u0434\u043B\u0435\u043D\u0438\u0435",
8074
8086
  historyPlanChange: "\u0421\u043C\u0435\u043D\u0430 \u0442\u0430\u0440\u0438\u0444\u0430: {from} \u043D\u0430 {to}",
8075
- historyDays: "\u0437\u0430 {days} \u0438\u0437 {total} \u0434\u043D."
8087
+ historyDays: "\u0437\u0430 {days} \u0438\u0437 {total} \u0434\u043D.",
8088
+ historyCouponPayment: "{code} \xB7 {payment} \u0438\u0437 {total}"
8076
8089
  },
8077
8090
  favorites: {
8078
8091
  loading: "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \u0432\u0430\u0448\u0435 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435",
@@ -8702,7 +8715,8 @@ var tr_default = {
8702
8715
  historyFirstOrder: "\u0130lk sipari\u015F",
8703
8716
  historyRenewal: "Yenileme",
8704
8717
  historyPlanChange: "Plan de\u011Fi\u015Fikli\u011Fi, {from} \u2192 {to}",
8705
- historyDays: "{total} g\xFCn\xFCn {days} g\xFCn\xFC i\xE7in"
8718
+ historyDays: "{total} g\xFCn\xFCn {days} g\xFCn\xFC i\xE7in",
8719
+ historyCouponPayment: "{code} \xB7 {payment}/{total}"
8706
8720
  },
8707
8721
  favorites: {
8708
8722
  loading: "Favorileriniz y\xFCkleniyor",
@@ -9332,7 +9346,8 @@ var uk_default = {
9332
9346
  historyFirstOrder: "\u041F\u0435\u0440\u0448\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F",
9333
9347
  historyRenewal: "\u041F\u0440\u043E\u0434\u043E\u0432\u0436\u0435\u043D\u043D\u044F",
9334
9348
  historyPlanChange: "\u0417\u043C\u0456\u043D\u0430 \u0442\u0430\u0440\u0438\u0444\u0443: {from} \u043D\u0430 {to}",
9335
- historyDays: "\u0437\u0430 {days} \u0437 {total} \u0434\u043D."
9349
+ historyDays: "\u0437\u0430 {days} \u0437 {total} \u0434\u043D.",
9350
+ historyCouponPayment: "{code} \xB7 {payment} \u0437 {total}"
9336
9351
  },
9337
9352
  favorites: {
9338
9353
  loading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0443\u0454\u043C\u043E \u0432\u0430\u0448\u0435 \u043E\u0431\u0440\u0430\u043D\u0435",
@@ -9962,7 +9977,8 @@ var zh_default = {
9962
9977
  historyFirstOrder: "\u9996\u6B21\u8BA2\u5355",
9963
9978
  historyRenewal: "\u7EED\u8BA2",
9964
9979
  historyPlanChange: "\u5957\u9910\u53D8\u66F4\uFF1A{from} \u6539\u4E3A {to}",
9965
- historyDays: "{total} \u5929\u4E2D\u7684 {days} \u5929"
9980
+ historyDays: "{total} \u5929\u4E2D\u7684 {days} \u5929",
9981
+ historyCouponPayment: "{code} \xB7 \u7B2C {payment}/{total} \u6B21"
9966
9982
  },
9967
9983
  favorites: {
9968
9984
  loading: "\u6B63\u5728\u52A0\u8F7D\u4F60\u7684\u6536\u85CF",
@@ -14940,6 +14956,15 @@ function readPlanChange(value) {
14940
14956
  if (from === null || to === null || daysLeft === void 0 || daysTotal === void 0) return void 0;
14941
14957
  return { from_plan_name: from, to_plan_name: to, days_left: daysLeft, days_total: daysTotal };
14942
14958
  }
14959
+ function readCouponPayment(value) {
14960
+ if (value === null) return null;
14961
+ if (!isRecord3(value)) return void 0;
14962
+ const code = readString(value, "code");
14963
+ const payment = readCount(value, "payment");
14964
+ const paymentsTotal = readCount(value, "payments_total");
14965
+ if (code === null || payment === void 0 || payment === null || paymentsTotal === void 0) return void 0;
14966
+ return { code, payment, payments_total: paymentsTotal };
14967
+ }
14943
14968
  function billingEntryTitle(invoice) {
14944
14969
  if (invoice.plan_change) {
14945
14970
  return { key: "subscriptions.historyPlanChange", params: { from: invoice.plan_change.from_plan_name, to: invoice.plan_change.to_plan_name } };
@@ -14970,10 +14995,11 @@ function narrowBillingHistory(payload) {
14970
14995
  const createdAt = readString(entry, "created_at");
14971
14996
  const kind = BILLING_KINDS.find((known) => known === entry.kind);
14972
14997
  const planChange = readPlanChange(entry.plan_change);
14973
- if (uniqid === null || total === null || currency === null || status === null || createdAt === null || !kind || planChange === void 0) {
14998
+ const couponPayment = readCouponPayment(entry.coupon_payment);
14999
+ if (uniqid === null || total === null || currency === null || status === null || createdAt === null || !kind || planChange === void 0 || couponPayment === void 0) {
14974
15000
  return { ok: false };
14975
15001
  }
14976
- invoices.push({ uniqid, total, currency, status, created_at: createdAt, kind, plan_change: planChange });
15002
+ invoices.push({ uniqid, total, currency, status, created_at: createdAt, kind, plan_change: planChange, coupon_payment: couponPayment });
14977
15003
  }
14978
15004
  return { ok: true, invoices };
14979
15005
  }
@@ -15521,6 +15547,7 @@ function BillingHistoryList({ payload, reload }) {
15521
15547
  return /* @__PURE__ */ jsx13("ul", { className: "sxa:space-y-4", children: history.invoices.map((invoice) => {
15522
15548
  const title = billingEntryTitle(invoice);
15523
15549
  const days = billingEntryDays(invoice);
15550
+ const coupon = invoice.coupon_payment;
15524
15551
  return /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs12(
15525
15552
  Link7,
15526
15553
  {
@@ -15532,7 +15559,8 @@ function BillingHistoryList({ payload, reload }) {
15532
15559
  /* @__PURE__ */ jsxs12("p", { className: "sxa:mt-1 sxa:text-micro sxa:tabular-nums sxa:text-muted", children: [
15533
15560
  formatAccountDate(invoice.created_at),
15534
15561
  days ? ` \xB7 ${t(days.key, days.params)}` : null
15535
- ] })
15562
+ ] }),
15563
+ coupon ? /* @__PURE__ */ jsx13("p", { className: "sxa:mt-0.5 sxa:text-micro sxa:tabular-nums sxa:text-muted", children: coupon.payments_total === null ? coupon.code : t("subscriptions.historyCouponPayment", { code: coupon.code, payment: coupon.payment, total: coupon.payments_total }) }) : null
15536
15564
  ] }),
15537
15565
  /* @__PURE__ */ jsxs12("div", { className: "sxa:flex sxa:shrink-0 sxa:flex-col sxa:items-end sxa:gap-1.5 sxa:sm:flex-row sxa:sm:items-center sxa:sm:gap-3", children: [
15538
15566
  /* @__PURE__ */ jsx13("span", { className: "sxa:text-small sxa:font-semibold sxa:tabular-nums", children: formatAccountAmount(invoice.total, invoice.currency) }),