feat(medusa, core-flows, fulfillment): calculate SO price endpoint (#10532)
**What** - endpoint + flow for fetching calculated price for a shipping option --- CLOSES CMRC-777
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
CalculatedShippingOptionPrice,
|
||||
Context,
|
||||
DAL,
|
||||
FilterableFulfillmentSetProps,
|
||||
@@ -1998,6 +1999,21 @@ export default class FulfillmentModuleService
|
||||
return await promiseAll(promises)
|
||||
}
|
||||
|
||||
async calculateShippingOptionsPrices(
|
||||
shippingOptionsData: FulfillmentTypes.CalculateShippingOptionPriceDTO[]
|
||||
): Promise<CalculatedShippingOptionPrice[]> {
|
||||
const promises = shippingOptionsData.map((data) =>
|
||||
this.fulfillmentProviderService_.calculatePrice(
|
||||
data.provider_id,
|
||||
data.optionData,
|
||||
data.data,
|
||||
data.context
|
||||
)
|
||||
)
|
||||
|
||||
return await promiseAll(promises)
|
||||
}
|
||||
|
||||
@InjectTransactionManager()
|
||||
// @ts-expect-error
|
||||
async deleteShippingProfiles(
|
||||
|
||||
Reference in New Issue
Block a user