From 22404d03e166cd472e9025a7cd4b991c3939a3f2 Mon Sep 17 00:00:00 2001 From: Urvish Date: Tue, 13 Oct 2026 14:01:58 +0530 Subject: [PATCH 1/2] fixed-issue(32): cupon validation and other minor issues like gateway fees and UI --- .git_store_info | 2 + src/App.tsx | 3 +- src/components/cart/CartDrawer.tsx | 41 +------------- .../checkout/PaymentSuccessModal.tsx | 53 +++++-------------- src/constants/modules.ts | 42 +++++++-------- 5 files changed, 40 insertions(+), 101 deletions(-) create mode 100644 .git_store_info diff --git a/.git_store_info b/.git_store_info new file mode 100644 index 0000000..c8523f4 --- /dev/null +++ b/.git_store_info @@ -0,0 +1,2 @@ +Branch: main +Commit: 75acd1de923fe310458333b66b71450f444eee2b diff --git a/src/App.tsx b/src/App.tsx index c812df5..0a717a3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -656,7 +656,7 @@ export default function App() { }, { headers }); const calcData = res.data; - if (appliedCoupon && (!calcData.coupon_applied || calcData.coupon_applied === 'None')) { + if (appliedCoupon && (!calcData.coupon_applied || calcData.coupon_applied === 'None' || calcData.coupon_discount_amount <= 0)) { calcData.coupon_error = calcData.coupon_error || 'Invalid or expired coupon code.'; } setPricingCalc(calcData); @@ -781,6 +781,7 @@ export default function App() { pricingCalc && pricingCalc.coupon_applied && pricingCalc.coupon_applied !== 'None' && + pricingCalc.coupon_discount_amount > 0 && !pricingCalc.coupon_error ); diff --git a/src/components/cart/CartDrawer.tsx b/src/components/cart/CartDrawer.tsx index 9c7c244..1f54418 100644 --- a/src/components/cart/CartDrawer.tsx +++ b/src/components/cart/CartDrawer.tsx @@ -146,7 +146,7 @@ export const CartDrawer: React.FC = ({ {appliedCoupon && - (pricingCalc?.coupon_error || !pricingCalc?.coupon_applied || pricingCalc?.coupon_applied === 'None' ? ( + (pricingCalc?.coupon_error || !pricingCalc?.coupon_applied || pricingCalc?.coupon_applied === 'None' || (pricingCalc?.coupon_discount_amount !== undefined && pricingCalc?.coupon_discount_amount <= 0) ? (
⚠️ {pricingCalc?.coupon_error || 'Invalid or expired coupon code.'} @@ -234,44 +234,7 @@ export const CartDrawer: React.FC = ({
)} - {pricingCalc.convenience_fee > 0 && ( -
- Gateway fee ({pricingCalc.convenience_fee_rate}%) - - {currency === 'INR' - ? `₹${pricingCalc.convenience_fee}` - : currency === 'EUR' - ? `€${pricingCalc.convenience_fee}` - : `$${pricingCalc.convenience_fee}`} - -
- )} - {pricingCalc.gst_amount > 0 && ( -
-
- GST (18%) - - {currency === 'INR' - ? `₹${pricingCalc.gst_amount}` - : currency === 'EUR' - ? `€${pricingCalc.gst_amount}` - : `$${pricingCalc.gst_amount}`} - -
-
- - (Taxable Amount:{' '} - {currency === 'INR' - ? `₹${pricingCalc.taxable_amount}` - : currency === 'EUR' - ? `€${pricingCalc.taxable_amount}` - : `$${pricingCalc.taxable_amount}`} - ) - - -
-
- )} +
Total Chargeable diff --git a/src/components/checkout/PaymentSuccessModal.tsx b/src/components/checkout/PaymentSuccessModal.tsx index 75ce43f..e005c17 100644 --- a/src/components/checkout/PaymentSuccessModal.tsx +++ b/src/components/checkout/PaymentSuccessModal.tsx @@ -24,37 +24,14 @@ export const PaymentSuccessModal: React.FC = ({ }) => { const [desktopNotice, setDesktopNotice] = useState(false); - // Handler to reliably launch the Acupedia Mobile App across platforms (Android, iOS, and Desktop) + // Handler to reliably launch the Acupedia Mobile App across platforms const handleOpenApp = (e: React.MouseEvent) => { e.preventDefault(); + openMobileApp({ route: returnRoute, schemes: appScheme ? [appScheme] : undefined }); + const userAgent = navigator.userAgent || ''; - const isAndroid = /Android/i.test(userAgent); - const isIOS = /iPhone|iPad|iPod/i.test(userAgent); - - if (isAndroid) { - // Android Chrome requires an Intent URI format to launch apps by package and scheme reliably - const intentUrl = 'intent://#Intent;scheme=acupedia;package=com.anonymous.acupedia;end'; - window.location.href = intentUrl; - - // Fallback to custom URI schemes in case intent fails or Expo uses alternate scheme - setTimeout(() => { - window.location.href = 'acupedia://'; - }, 500); - setTimeout(() => { - window.location.href = 'myapp://'; - }, 1000); - } else if (isIOS) { - // iOS Safari and Chrome handle custom URI schemes directly - window.location.href = 'acupedia://'; - - // Fallback in case Expo uses default 'myapp://' scheme - setTimeout(() => { - window.location.href = 'myapp://'; - }, 500); - } else { - // On desktop browsers, try opening the registered custom scheme - window.location.href = 'acupedia://'; - // Show helpful desktop feedback informing the user how to access content on mobile + const isMobile = /Android|iPhone|iPad|iPod/i.test(userAgent); + if (!isMobile) { setDesktopNotice(true); } }; @@ -217,18 +194,14 @@ export const PaymentSuccessModal: React.FC = ({ )} {/* Open in App Button */} - {/* Open in App Button */} - { - e.preventDefault(); - openMobileApp({ route: returnRoute, schemes: appScheme ? [appScheme] : undefined }); - }} - className="w-full h-9 bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs rounded-lg transition-all duration-300 flex items-center justify-center gap-2 shadow-md shadow-emerald-600/10 no-underline decoration-0 cursor-pointer" - > - - Open in App / Library - + + + Open in App / Library + {desktopNotice && (
diff --git a/src/constants/modules.ts b/src/constants/modules.ts index 8faa560..f16824c 100644 --- a/src/constants/modules.ts +++ b/src/constants/modules.ts @@ -11,33 +11,33 @@ export interface ModuleItem { export const CURRICULUM_MODULES: ModuleItem[] = [ // 1. Points Category - { code: 'POINTS_ACU', name: 'Points: Acu (EOV+Cat+Ext+MR)', category: 'Points', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Unlocks Master Acupuncture Points, Extraordinary Vessels, Category/Extension Rules, and Meridian Stimulations.', color: 'from-blue-500 to-indigo-600' }, - { code: 'POINTS_SCALP', name: 'Points: Scalp', category: 'Points', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Unlocks High-Performance Scalp Acupuncture Mapping for specialized clinical neurological disorders.', color: 'from-indigo-500 to-purple-600' }, - { code: 'POINTS_EAR', name: 'Points: Ear / Auricular', category: 'Points', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Unlocks specialized Ear Micro-System Reflex stimulations, anatomy mapping, and reflexes.', color: 'from-purple-500 to-pink-600' }, - { code: 'POINTS_TUNG', name: 'Master Tung', category: 'Points', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Unlocks Master Tung\'s legendary extra points, clinical distals, and unique point properties.', color: 'from-pink-500 to-rose-600' }, - { code: 'POINTS_PACK', name: 'Points: Complete Pack', category: 'Points', priceInr: 2, priceUsd: 2.0, priceEur: 2.0, desc: '1 Year: Unlock all 4 Points modules (Acu, Scalp, Ear, and Master Tung) at once for ultimate master-level access.', color: 'from-indigo-600 to-pink-600' }, + { code: 'POINTS_ACU', name: 'Points: Acu (EOV+Cat+Ext+MR)', category: 'Points', priceInr: 300, priceUsd: 5.0, priceEur: 5.0, desc: '1 Year: Unlocks Master Acupuncture Points, Extraordinary Vessels, Category/Extension Rules, and Meridian Stimulations.', color: 'from-blue-500 to-indigo-600' }, + { code: 'POINTS_SCALP', name: 'Points: Scalp', category: 'Points', priceInr: 100, priceUsd: 2.0, priceEur: 2.0, desc: '1 Year: Unlocks High-Performance Scalp Acupuncture Mapping for specialized clinical neurological disorders.', color: 'from-indigo-500 to-purple-600' }, + { code: 'POINTS_EAR', name: 'Points: Ear / Auricular', category: 'Points', priceInr: 200, priceUsd: 3.0, priceEur: 3.0, desc: '1 Year: Unlocks specialized Ear Micro-System Reflex stimulations, anatomy mapping, and reflexes.', color: 'from-purple-500 to-pink-600' }, + { code: 'POINTS_TUNG', name: 'Master Tung', category: 'Points', priceInr: 300, priceUsd: 5.0, priceEur: 5.0, desc: '1 Year: Unlocks Master Tung\'s legendary extra points, clinical distals, and unique point properties.', color: 'from-pink-500 to-rose-600' }, + { code: 'POINTS_PACK', name: 'Points: Complete Pack', category: 'Points', priceInr: 900, priceUsd: 15.0, priceEur: 15.0, desc: '1 Year: Unlock all 4 Points modules (Acu, Scalp, Ear, and Master Tung) at once for ultimate master-level access.', color: 'from-indigo-600 to-pink-600' }, // 2. Pattern Category — Individual sub-modules (all map to PATTERN_CORE plan) - { code: 'PATTERN_CORE', name: 'Eight Principles', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Exterior/Interior, Cold/Heat, Deficiency/Excess, Yin/Yang pattern differentiation.', color: 'from-violet-500 to-purple-600' }, - { code: 'PATTERN_CORE', name: 'Zang-Fu Organs', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Zangfu organ and channel identification across 12 organ systems.', color: 'from-cyan-500 to-blue-600' }, - { code: 'PATTERN_CORE', name: 'Qi, Blood & Body Fluids', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Qi, Blood, and Body Fluid identification of pathological patterns.', color: 'from-blue-500 to-indigo-600' }, - { code: 'PATTERN_CORE', name: 'Pathogenic Factors', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Wind, Cold, Summer-Heat, Dampness, Dryness, Fire pattern identification.', color: 'from-amber-500 to-orange-600' }, - { code: 'PATTERN_CORE', name: 'Six Stages', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Tai Yang, Yang Ming, Shao Yang, Tai Yin, Shao Yin, Jue Yin stage differentiation.', color: 'from-emerald-500 to-green-600' }, - { code: 'PATTERN_CORE', name: 'Four Levels', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Wei, Qi, Ying, Xue level pattern identification for warm diseases.', color: 'from-red-500 to-rose-600' }, - { code: 'PATTERN_CORE', name: 'Three Burners', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Upper, Middle, and Lower Burner (San Jiao) pattern identification.', color: 'from-pink-500 to-fuchsia-600' }, - { code: 'PATTERN_CORE', name: 'Five Elements', category: 'Pattern', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Wood, Fire, Earth, Metal, Water relationships and clinical patterns.', color: 'from-indigo-500 to-violet-600' }, - { code: 'PATTERN_CORE', name: 'Pattern: Complete Pack', category: 'Pattern', priceInr: 2, priceUsd: 2.0, priceEur: 2.0, desc: '1 Year: Unlock all 8 Pattern Diagnosis methodologies at once for complete syndrome differentiation mastery.', color: 'from-rose-600 to-orange-600' }, + { code: 'PATTERN_CORE', name: 'Eight Principles', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Exterior/Interior, Cold/Heat, Deficiency/Excess, Yin/Yang pattern differentiation.', color: 'from-violet-500 to-purple-600' }, + { code: 'PATTERN_CORE', name: 'Zang-Fu Organs', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Zangfu organ and channel identification across 12 organ systems.', color: 'from-cyan-500 to-blue-600' }, + { code: 'PATTERN_CORE', name: 'Qi, Blood & Body Fluids', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Qi, Blood, and Body Fluid identification of pathological patterns.', color: 'from-blue-500 to-indigo-600' }, + { code: 'PATTERN_CORE', name: 'Pathogenic Factors', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Wind, Cold, Summer-Heat, Dampness, Dryness, Fire pattern identification.', color: 'from-amber-500 to-orange-600' }, + { code: 'PATTERN_CORE', name: 'Six Stages', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Tai Yang, Yang Ming, Shao Yang, Tai Yin, Shao Yin, Jue Yin stage differentiation.', color: 'from-emerald-500 to-green-600' }, + { code: 'PATTERN_CORE', name: 'Four Levels', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Wei, Qi, Ying, Xue level pattern identification for warm diseases.', color: 'from-red-500 to-rose-600' }, + { code: 'PATTERN_CORE', name: 'Three Burners', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Upper, Middle, and Lower Burner (San Jiao) pattern identification.', color: 'from-pink-500 to-fuchsia-600' }, + { code: 'PATTERN_CORE', name: 'Five Elements', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Wood, Fire, Earth, Metal, Water relationships and clinical patterns.', color: 'from-indigo-500 to-violet-600' }, + { code: 'PATTERN_CORE', name: 'Pattern: Complete Pack', category: 'Pattern', priceInr: 500, priceUsd: 10.0, priceEur: 10.0, desc: '1 Year: Unlock all 8 Pattern Diagnosis methodologies at once for complete syndrome differentiation mastery.', color: 'from-rose-600 to-orange-600' }, // 3. Nutrition Category — Individual sub-modules (all map to NUTRITION_CORE plan) - { code: 'NUTRITION_CORE', name: 'Food Categories', category: 'Nutrition', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Nutritional food category classifications, thermal properties, and dietetic groupings.', color: 'from-emerald-500 to-teal-600' }, - { code: 'NUTRITION_CORE', name: 'Food Items', category: 'Nutrition', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Individual food item properties, indications, and therapeutic applications.', color: 'from-green-500 to-emerald-600' }, - { code: 'NUTRITION_CORE', name: 'Nutrition: Complete Pack', category: 'Nutrition', priceInr: 2, priceUsd: 2.0, priceEur: 2.0, desc: '1 Year: Unlock all Nutrition & Dietetics modules for complete clinical dietary therapy mastery.', color: 'from-teal-500 to-green-600' }, + { code: 'NUTRITION_CORE', name: 'Food Categories', category: 'Nutrition', priceInr: 600, priceUsd: 15.0, priceEur: 15.0, desc: '1 Year: Nutritional food category classifications, thermal properties, and dietetic groupings.', color: 'from-emerald-500 to-teal-600' }, + { code: 'NUTRITION_CORE', name: 'Food Items', category: 'Nutrition', priceInr: 600, priceUsd: 15.0, priceEur: 15.0, desc: '1 Year: Individual food item properties, indications, and therapeutic applications.', color: 'from-green-500 to-emerald-600' }, + { code: 'NUTRITION_CORE', name: 'Nutrition: Complete Pack', category: 'Nutrition', priceInr: 600, priceUsd: 15.0, priceEur: 15.0, desc: '1 Year: Unlock all Nutrition & Dietetics modules for complete clinical dietary therapy mastery.', color: 'from-teal-500 to-green-600' }, // 4. Therapeutics Category - { code: 'THERAPEUTICS_GYNAE', name: 'Therapeutics: Gynecology', category: 'Therapeutics', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Unlocks advanced clinical Gynecology treatment protocols, syndromes, and corresponding points.', color: 'from-teal-500 to-cyan-500' }, - { code: 'THERAPEUTICS_EAR', name: 'Therapeutics: Ear reflexology', category: 'Therapeutics', priceInr: 1, priceUsd: 1.0, priceEur: 1.0, desc: '1 Year: Unlocks comprehensive ear micro-system treatment procedures and specific clinical ear protocols.', color: 'from-cyan-500 to-blue-600' }, - { code: 'THERAPEUTICS_CORE', name: 'Therapeutics Complete Bundle', category: 'Therapeutics', priceInr: 2, priceUsd: 2.0, priceEur: 2.0, desc: '1 Year: Unlocks both advanced clinical Gynecology and Ear Reflexology therapeutics treatment protocols.', color: 'from-teal-500 to-blue-600' }, + { code: 'THERAPEUTICS_GYNAE', name: 'Therapeutics: Gynecology', category: 'Therapeutics', priceInr: 600, priceUsd: 15.0, priceEur: 15.0, desc: '1 Year: Unlocks advanced clinical Gynecology treatment protocols, syndromes, and corresponding points.', color: 'from-teal-500 to-cyan-500' }, + { code: 'THERAPEUTICS_EAR', name: 'Therapeutics: Ear reflexology', category: 'Therapeutics', priceInr: 600, priceUsd: 15.0, priceEur: 15.0, desc: '1 Year: Unlocks comprehensive ear micro-system treatment procedures and specific clinical ear protocols.', color: 'from-cyan-500 to-blue-600' }, + { code: 'THERAPEUTICS_CORE', name: 'Therapeutics Complete Bundle', category: 'Therapeutics', priceInr: 1200, priceUsd: 30.0, priceEur: 30.0, desc: '1 Year: Unlocks both advanced clinical Gynecology and Ear Reflexology therapeutics treatment protocols.', color: 'from-teal-500 to-blue-600' }, // 5. Lifetime Access - { code: 'LIFETIME_ALL', name: 'Lifetime Unlimited Access Pass', category: 'Lifetime', priceInr: 2, priceUsd: 2.0, priceEur: 2.0, desc: '10 Years: Unlock all 10 current modules + all future updates. Includes official master clinical certificate.', color: 'from-yellow-500 to-amber-600' } + { code: 'LIFETIME_ALL', name: 'Lifetime Unlimited Access Pass', category: 'Lifetime', priceInr: 15000, priceUsd: 350.0, priceEur: 350.0, desc: '10 Years: Unlock all 10 current modules + all future updates. Includes official master clinical certificate.', color: 'from-yellow-500 to-amber-600' } ]; From ff62878cd6eef60fca5a30901556d70d00e2d024 Mon Sep 17 00:00:00 2001 From: Urvish Date: Tue, 13 Oct 2026 14:33:58 +0530 Subject: [PATCH 2/2] fixed-issue(3):automatically apply and display loyalty discounts in cart summary --- src/App.tsx | 30 ++++++++++++++++++++++++++++-- src/components/cart/CartDrawer.tsx | 8 +++++++- src/types/index.ts | 8 ++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c812df5..5ee82fb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -291,14 +291,14 @@ export default function App() { } }, [userToken]); - // Recalculate price whenever cart, coupon, or currency changes + // Recalculate price whenever cart, coupon, currency, or logged-in user changes useEffect(() => { if (cart.length === 0) { setPricingCalc(null); return; } calculatePricing(); - }, [cart, appliedCoupon, currency]); + }, [cart, appliedCoupon, currency, loggedInUser]); // Update currency and dial code automatically on country selection during registration useEffect(() => { @@ -649,8 +649,34 @@ export default function App() { setLoadingPricing(true); try { const headers = userToken ? { 'Authorization': `Bearer ${userToken}` } : {}; + + // Derive owned categories from loggedInUser to ensure loyalty discounts apply automatically + const userOwnedCategories: string[] = []; + if (loggedInUser?.active_subscriptions) { + for (const sub of loggedInUser.active_subscriptions) { + const code = (sub.plan_code || '').toUpperCase(); + if (code.startsWith('POINT')) userOwnedCategories.push('Points'); + else if (code.startsWith('PATTERN')) userOwnedCategories.push('Pattern'); + else if (code.startsWith('NUTRITION')) userOwnedCategories.push('Nutrition'); + else if (code.startsWith('THERAPEUTIC')) userOwnedCategories.push('Therapeutics'); + else if (code === 'LIFETIME_ALL' || code === 'LIFETIME_ALL_USD') userOwnedCategories.push('Lifetime'); + } + } + if (loggedInUser?.unlocked_module_slugs) { + for (const slug of loggedInUser.unlocked_module_slugs) { + const s = slug.toLowerCase(); + if (s.includes('point') || s.includes('ear') || s.includes('scalp') || s.includes('tung')) userOwnedCategories.push('Points'); + else if (s.includes('pattern') || s.includes('eight') || s.includes('principles') || s.includes('zang') || s.includes('stages') || s.includes('burners') || s.includes('channels') || s.includes('elements') || s.includes('vessel')) userOwnedCategories.push('Pattern'); + else if (s.includes('nutrition') || s.includes('food')) userOwnedCategories.push('Nutrition'); + else if (s.includes('therapeutic') || s.includes('gynae') || s.includes('auriculo')) userOwnedCategories.push('Therapeutics'); + } + } + const uniqueOwnedCategories = Array.from(new Set(userOwnedCategories)); + const res = await axios.post(`${API_BASE}/api/cart/calculate`, { cart_item_codes: cart.map(item => item.code), + owned_category_names: uniqueOwnedCategories, + is_first_purchase: uniqueOwnedCategories.length === 0, coupon_code: appliedCoupon || undefined, currency: currency }, { headers }); diff --git a/src/components/cart/CartDrawer.tsx b/src/components/cart/CartDrawer.tsx index 9c7c244..1e69f7e 100644 --- a/src/components/cart/CartDrawer.tsx +++ b/src/components/cart/CartDrawer.tsx @@ -198,7 +198,13 @@ export const CartDrawer: React.FC = ({
{pricingCalc.bundle_discount_amount > 0 && (
- Bundle Discount + + {pricingCalc.discount_policy && pricingCalc.discount_policy !== 'None' + ? (pricingCalc.discount_policy.startsWith('Staggered Buy:') + ? pricingCalc.discount_policy.replace('Staggered Buy:', 'Loyalty Discount:') + : pricingCalc.discount_policy) + : 'Loyalty Discount'} + -{currency === 'INR' ? `₹${pricingCalc.bundle_discount_amount}` diff --git a/src/types/index.ts b/src/types/index.ts index b8a5891..d3f3a40 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -34,12 +34,17 @@ export interface UserProfile { roles?: string[]; external_ref?: string; active_subscriptions: UserSubscription[]; + unlocked_module_slugs?: string[]; created_at?: string; } export interface PricingCalculation { + base_subtotal?: number; original_price: number; discount_amount: number; + discount_policy?: string; + bundle_discount_amount?: number; + total_discounts?: number; taxable_amount: number; gst_amount: number; convenience_fee?: number; @@ -47,6 +52,9 @@ export interface PricingCalculation { grand_total: number; total_amount?: number; currency: Currency; + coupon_applied?: string; + coupon_discount_amount?: number; + coupon_error?: string | null; applied_coupon?: { code: string; discount_type: 'percentage' | 'fixed';