feat(core-flows): calculate SO price on cart ops (#10563)
**What** - calculate the shipping option price when creating a shipping method - calculate the shipping option price when refreshing cart - add testing for calculated SO flow - fix validation on calculated SO creation - add manual fulfillment provider for testing - add `from_location` to calculation context --- RESOLVES CMRC-778 RESOLVES CMRC-602 RESOLVES SUP-136
This commit is contained in:
1 parent
95baacfd00
commit
0c49470066
21 files changed
+903
-52
No files matched your search
@@ -27,5 +27,11 @@ export const POST = async (
|
||||
const shippingOption = data[0]
|
||||
const priceData = result[0]
|
||||
|
||||
res.status(200).json({ shipping_option: { ...shippingOption, ...priceData } })
|
||||
shippingOption.calculated_price = priceData
|
||||
|
||||
// ensure same shape as flat rate shipping options
|
||||
shippingOption.amount = priceData.calculated_amount
|
||||
shippingOption.is_tax_inclusive = priceData.is_calculated_price_tax_inclusive
|
||||
|
||||
res.status(200).json({ shipping_option: shippingOption })
|
||||
}
|
||||
@@ -26,5 +26,5 @@ export type StoreCalculateShippingOptionPriceType = z.infer<
|
||||
>
|
||||
export const StoreCalculateShippingOptionPrice = z.object({
|
||||
cart_id: z.string(),
|
||||
data: z.record(z.string(), z.unknown()),
|
||||
data: z.record(z.string(), z.unknown()).optional(),
|
||||
})
|
||||
Reference in new issue
Block a user