@burdenoff/microfe-billing 2026.911.1 → 2026.912.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.
|
@@ -10,6 +10,7 @@ function t(t) {
|
|
|
10
10
|
name: e.name || "Store Item",
|
|
11
11
|
description: `${e.itemType || "Product"} - Quantity: ${e.quantity || 1}`,
|
|
12
12
|
price: e.unitPrice || 0,
|
|
13
|
+
priceUSD: n === "USD" ? e.unitPrice || 0 : void 0,
|
|
13
14
|
currency: n,
|
|
14
15
|
quantity: e.quantity || 1,
|
|
15
16
|
features: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storeOrder.js","names":[],"sources":["../../../../../src/billing/modules/checkout/utils/storeOrder.ts"],"sourcesContent":["import type { CheckoutItem, Currency } from '../types';\n\nexport interface StoreOrderLineItem {\n productId?: string | null;\n name?: string | null;\n quantity?: number | null;\n unitPrice?: number | null;\n itemType?: string | null;\n variantId?: string | null;\n}\n\nexport interface StoreOrderCheckoutSource {\n id: string;\n billingOrderId?: string | null;\n currency?: string | null;\n lineItems?: StoreOrderLineItem[] | null;\n}\n\nexport const DEFAULT_STORE_ORDER_CURRENCY = 'USD';\n\nexport function normalizeStoreOrderCurrency(currency?: string | null): Currency {\n const normalizedCurrency = currency?.trim().toUpperCase();\n\n return normalizedCurrency && normalizedCurrency.length > 0\n ? normalizedCurrency\n : DEFAULT_STORE_ORDER_CURRENCY;\n}\n\nexport function buildStoreOrderCheckoutItems(storeOrder: StoreOrderCheckoutSource): CheckoutItem[] {\n const currency = normalizeStoreOrderCurrency(storeOrder.currency);\n\n return (storeOrder.lineItems ?? []).map((lineItem, index) => ({\n id: lineItem.productId || `store-item-${storeOrder.id}-${index}`,\n type: 'ORDER',\n name: lineItem.name || 'Store Item',\n description: `${lineItem.itemType || 'Product'} - Quantity: ${lineItem.quantity || 1}`,\n price: lineItem.unitPrice || 0,\n currency,\n quantity: lineItem.quantity || 1,\n features: [],\n metadata: {\n storeOrderId: storeOrder.id,\n billingOrderId: storeOrder.billingOrderId,\n productId: lineItem.productId,\n variantId: lineItem.variantId,\n },\n }));\n}\n"],"mappings":"AAoBA,SAAgB,EAA4B,GAAoC;CAC9E,IAAM,IAAqB,GAAU,KAAK,EAAE,YAAY;CAExD,OAAO,KAAsB,EAAmB,SAAS,IACrD,IAAA;AAEN;AAEA,SAAgB,EAA6B,GAAsD;CACjG,IAAM,IAAW,EAA4B,EAAW,QAAQ;CAEhE,QAAQ,EAAW,aAAa,CAAC,GAAG,KAAK,GAAU,OAAW;EAC5D,IAAI,EAAS,aAAa,cAAc,EAAW,GAAG,GAAG;EACzD,MAAM;EACN,MAAM,EAAS,QAAQ;EACvB,aAAa,GAAG,EAAS,YAAY,UAAU,eAAe,EAAS,YAAY;EACnF,OAAO,EAAS,aAAa;
|
|
1
|
+
{"version":3,"file":"storeOrder.js","names":[],"sources":["../../../../../src/billing/modules/checkout/utils/storeOrder.ts"],"sourcesContent":["import type { CheckoutItem, Currency } from '../types';\n\nexport interface StoreOrderLineItem {\n productId?: string | null;\n name?: string | null;\n quantity?: number | null;\n unitPrice?: number | null;\n itemType?: string | null;\n variantId?: string | null;\n}\n\nexport interface StoreOrderCheckoutSource {\n id: string;\n billingOrderId?: string | null;\n currency?: string | null;\n lineItems?: StoreOrderLineItem[] | null;\n}\n\nexport const DEFAULT_STORE_ORDER_CURRENCY = 'USD';\n\nexport function normalizeStoreOrderCurrency(currency?: string | null): Currency {\n const normalizedCurrency = currency?.trim().toUpperCase();\n\n return normalizedCurrency && normalizedCurrency.length > 0\n ? normalizedCurrency\n : DEFAULT_STORE_ORDER_CURRENCY;\n}\n\nexport function buildStoreOrderCheckoutItems(storeOrder: StoreOrderCheckoutSource): CheckoutItem[] {\n const currency = normalizeStoreOrderCurrency(storeOrder.currency);\n\n return (storeOrder.lineItems ?? []).map((lineItem, index) => ({\n id: lineItem.productId || `store-item-${storeOrder.id}-${index}`,\n type: 'ORDER',\n name: lineItem.name || 'Store Item',\n description: `${lineItem.itemType || 'Product'} - Quantity: ${lineItem.quantity || 1}`,\n price: lineItem.unitPrice || 0,\n // Store orders are created in USD by default (DEFAULT_STORE_ORDER_CURRENCY)\n // — when that's the order's actual currency, fix the USD reference here so\n // credit-conversion math stays correct even after the checkout page's\n // currency-conversion effect overwrites `price`/`currency` with the\n // display-currency amount (reproduced live, BOFF-7192: a $10.12 item\n // showed as \"96,707 Credits\" because the already-INR-converted price got\n // treated as if it were still USD).\n priceUSD: currency === 'USD' ? lineItem.unitPrice || 0 : undefined,\n currency,\n quantity: lineItem.quantity || 1,\n features: [],\n metadata: {\n storeOrderId: storeOrder.id,\n billingOrderId: storeOrder.billingOrderId,\n productId: lineItem.productId,\n variantId: lineItem.variantId,\n },\n }));\n}\n"],"mappings":"AAoBA,SAAgB,EAA4B,GAAoC;CAC9E,IAAM,IAAqB,GAAU,KAAK,EAAE,YAAY;CAExD,OAAO,KAAsB,EAAmB,SAAS,IACrD,IAAA;AAEN;AAEA,SAAgB,EAA6B,GAAsD;CACjG,IAAM,IAAW,EAA4B,EAAW,QAAQ;CAEhE,QAAQ,EAAW,aAAa,CAAC,GAAG,KAAK,GAAU,OAAW;EAC5D,IAAI,EAAS,aAAa,cAAc,EAAW,GAAG,GAAG;EACzD,MAAM;EACN,MAAM,EAAS,QAAQ;EACvB,aAAa,GAAG,EAAS,YAAY,UAAU,eAAe,EAAS,YAAY;EACnF,OAAO,EAAS,aAAa;EAQ7B,UAAU,MAAa,QAAQ,EAAS,aAAa,IAAI,KAAA;EACzD;EACA,UAAU,EAAS,YAAY;EAC/B,UAAU,CAAC;EACX,UAAU;GACR,cAAc,EAAW;GACzB,gBAAgB,EAAW;GAC3B,WAAW,EAAS;GACpB,WAAW,EAAS;EACtB;CACF,EAAE;AACJ"}
|