Bug #12038
Updated by Yalavarthi Thriveni 1 day ago
Question 1 (Individual 1: Individual Product Shipping & Multi-Box Sum): (shipsIndividually) Explains why live "When FedEx quotes do sum the responds with rates for those 3 boxes, but offline fallback mistakenly are shipping charges a flat rate once instead calculated as the sum of multiplying by packages.length ($7.99 vs $23.97). Provides the blueprint to preserve all $N$ package dimensions (shipment.packages array) instead of truncating to packages[0]. packages, or not?" The Answer: Question 2 (Admin Allowed Methods & Static Restrictions): Explains how the system dynamically reads product/category configs from MongoDB, Yes for Live FedEx Rates, but NO for Fallback/Offline Rates. Furthermore, there is constrained a critical data loss bug in how your database records those 3 boxes. Here is what actually happens step-by-step: 1. Live FedEx API Call (Sum is Calculated Correctly by static string comparisons and completely bypassed in multi-warehouse orders. FedEx) Extends support for custom profiles (local_pickup_only, freight, etc.). Question When 3 (Mixed Cart standard_only + express_only Reliability): Resolves the 2D Split Flaw so that orders split across both multiple warehouses and multiple transit speeds without downgrading live plants to Ground. Replaces the greedy air-shipping bug by defaulting flexible items ("all") into Ground packages, protecting customers from inflated $100+ air freight fees. have shipsIndividually: true, shippingPackage.util.js:L106-123 creates 3 package objects. Bonus (International Unit Harmonization): In fedex.adapter.js:L764-794 Implements harmonizePackageUnits() , these 3 boxes are sent in fedex.adapter.js to ensure pure Metric (KG + CM) or pure Imperial (LB + IN), preventing FedEx's requestedPackageLineItems as a Multi-Piece Shipment (MPS). FedEx 400 Bad Request rates all 3 packages together and 16x dimensional weight errors. returns: 2. Real-Time Integration Test Cases Provided json Scenario Real-World Context What is Tested "totalNetCharge": { "amount": "48.50", "currency": "USD" } Scenario (e.g., Box 1 Multi-Piece (3 Planters) = $16, Box 2 = $17, Box 3 individual boxes (shipsIndividually: true) from 1 warehouse. Validates that FedEx MPS calculates = $15.50 $\rightarrow$ Total = $48.50). In fedex.adapter.js:L811-815 , your adapter extracts shipmentRate.totalNetCharge. Verdict for Live FedEx: The customer is charged the proper consolidated rate and sum of all 3 box dimensions are preserved in the response. boxes. Scenario 2 Single-Warehouse Mixed Cart 1 Orchid (express_only) + 1 Soil (standard_only) + 1 Trowel (all). Validates that 2 shipments are created and the trowel is bundled into Standard Ground. Scenario 3 2. The 2D Split (Multi-Warehouse) Warehouse A ships Bonsai (express_only); Warehouse B ships Soil (standard_only). Validates that Warehouse A ships via FedEx 2Day (plant lives) and Warehouse B ships via FedEx Ground. Scenario 4 Carrier Outage Offline / Fallback Flaw (Sum is NOT Calculated!) If FedEx API down. Cart has 2 individual boxes. Validates fails, times out, or sandbox credentials flake: The system falls back to buildNationwideCourierOptions . The fallback calculates reads: javascript amount: Number(shippingSettings?.standardShipping?.fallbackRate || 7.99) The Bug: It does not multiply by packages.length (3 boxes). It charges a flat $7.99 once, instead of $7.99 $\times$ 3 = $23.97. Your store loses money paying carrier fees out-of-pocket. 3. The Package Dimension Drop Bug (Box 2 and Box 3 are Lost!) Even though FedEx calculates the rate for 3 boxes, look at shippingSplit.service.js:L258 & L470 : javascript const pkg = $15.98 (not flat $7.99). grpLive?.packages?.[0] || {}; // ONLY TAKES BOX 0! Scenario 5 International India $\leftrightarrow$ USA Indian export hub shipping to USA. Validates weights convert to KG AND packageDimensions: { length: Number(pkg.length || 10), width: Number(pkg.width || 8), height: Number(pkg.height || 4), weight: Number(pkg.weight || 1), } The Bug: The checkout order only stores the dimensions convert of packages[0]. Boxes 2 and 3 disappear from the order document! When your warehouse staff opens the order to CM. pack and print labels, they only see 1 box, not 3. What Does FedEx Consider vs. What Does It Miss? - attached screenshots for this section issues !clipboard-202611061433-73lvm.png! !clipboard-202611061525-poftj.png! !clipboard-202611061433-8muoo.png!