@fluid-app/portal-sdk 0.1.345 → 0.1.346

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.
@@ -2541,7 +2541,7 @@ function mapDetailSubscription(bff) {
2541
2541
  max_skips: bff.plan?.max_skips ?? null,
2542
2542
  price_adjustment_type: null,
2543
2543
  price_adjustment_amount: null,
2544
- max_quantity: null,
2544
+ max_quantity: bff.product?.max_quantity ?? null,
2545
2545
  active: true,
2546
2546
  company_default: null,
2547
2547
  created_at: "",
@@ -3290,25 +3290,20 @@ function formatLongDate(iso) {
3290
3290
  }
3291
3291
  }
3292
3292
  /**
3293
- * Render the subscription bill amount in the BFF-formatted currency string
3294
- * when available (e.g. "$50.00", "€45.00"). Falls back to the unformatted
3295
- * decimal if the BFF string is missing.
3293
+ * Render the per-cycle subscription bill amount (`price × quantity`).
3294
+ *
3295
+ * `sub.price` (mapped from the BFF's `total`) is the per-unit price, not the
3296
+ * line total — the variant column it ultimately reads from is a plain
3297
+ * decimal column, and the detail page also computes `price * quantity` for
3298
+ * its bill rows. At qty=1 the multiplication is a no-op so the bug stayed
3299
+ * hidden until qty>1 surfaced the mismatch with the detail view.
3296
3300
  */
3297
3301
  function formatPrice(sub) {
3298
- const fromBff = sub.variant?.product?.price_in_currency;
3299
- if (fromBff && fromBff.trim().length > 0) return fromBff;
3300
- return sub.price.toFixed(2);
3302
+ return (sub.price * (sub.quantity ?? 1)).toFixed(2);
3301
3303
  }
3302
- /**
3303
- * Mirror of `formatPrice` for the detail subscription shape used inside a
3304
- * `Bundle.subscriptions[]`. The detail variant carries `price_in_currency`
3305
- * directly (no nested `product` like the list variant), so this peels off
3306
- * one less layer.
3307
- */
3304
+ /** Detail-shape counterpart for bundle member rows. */
3308
3305
  function formatDetailPrice(sub) {
3309
- const fromBff = sub.variant?.price_in_currency;
3310
- if (fromBff && fromBff.trim().length > 0) return fromBff;
3311
- return sub.price.toFixed(2);
3306
+ return (sub.price * (sub.quantity ?? 1)).toFixed(2);
3312
3307
  }
3313
3308
  /**
3314
3309
  * Compute progress through a billing cycle. Returns `null` when either
@@ -3488,7 +3483,7 @@ function FilterPills({ active, counts, onChange, onBundleClick, t }) {
3488
3483
  const BUNDLE_INLINE_LIMIT = 2;
3489
3484
  function BundleCard({ bundle, onSubscriptionClick, t }) {
3490
3485
  const [popoverOpen, setPopoverOpen] = (0, react.useState)(false);
3491
- const total = bundle.subscriptions.reduce((sum, s) => sum + s.price, 0);
3486
+ const total = bundle.subscriptions.reduce((sum, s) => sum + s.price * (s.quantity ?? 1), 0);
3492
3487
  const nextBillLong = bundle.next_bill_date ? formatLongDate(bundle.next_bill_date) : null;
3493
3488
  const inlineMembers = bundle.subscriptions.slice(0, BUNDLE_INLINE_LIMIT);
3494
3489
  const overflowCount = bundle.subscriptions.length - inlineMembers.length;
@@ -7453,4 +7448,4 @@ Object.defineProperty(exports, "subscriptionsScreenPropertySchema", {
7453
7448
  }
7454
7449
  });
7455
7450
 
7456
- //# sourceMappingURL=SubscriptionsScreen-DPh8mKe0.cjs.map
7451
+ //# sourceMappingURL=SubscriptionsScreen-BFihupo4.cjs.map