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,4 +1,5 @@
|
||||
import {
|
||||
CalculateShippingOptionPriceDTO,
|
||||
Constructor,
|
||||
DAL,
|
||||
FulfillmentTypes,
|
||||
@@ -107,9 +108,9 @@ export default class FulfillmentProviderService extends ModulesSdkUtils.MedusaIn
|
||||
|
||||
async calculatePrice(
|
||||
providerId: string,
|
||||
optionData: Record<string, unknown>,
|
||||
data: Record<string, unknown>,
|
||||
context: Record<string, unknown>
|
||||
optionData: CalculateShippingOptionPriceDTO["optionData"],
|
||||
data: CalculateShippingOptionPriceDTO["data"],
|
||||
context: CalculateShippingOptionPriceDTO["context"]
|
||||
) {
|
||||
const provider = this.retrieveProviderRegistration(providerId)
|
||||
return await provider.calculatePrice(optionData, data, context)
|
||||
|
||||
Reference in New Issue
Block a user