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:
Frane Polić
2024-12-12 08:03:56 +00:00
committed by GitHub
parent 52b494b62d
commit 472e92e400
18 changed files with 263 additions and 9 deletions
@@ -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(