feat(core-flows,dashboard,js-sdk,medusa,types): support Fulfillment Options (#10622)

**What**
- add a list point for fetching fulfillment options for a provider
- add FO support on SO create & update on dashboard
- pass `cart` and `stockLocation` to `validateFufillmentData` context

---

CLOSES CMRC-789
CLOSES CMRC-790
This commit is contained in:
Frane Polić
2024-12-18 10:16:26 +01:00
committed by GitHub
parent f3eca7734e
commit bde4b82194
20 changed files with 1850 additions and 487 deletions

View File

@@ -5,6 +5,7 @@ import {
FilterableFulfillmentSetProps,
FindConfig,
FulfillmentDTO,
FulfillmentOption,
FulfillmentTypes,
IFulfillmentModuleService,
InternalModuleDeclaration,
@@ -1946,7 +1947,7 @@ export default class FulfillmentModuleService
async retrieveFulfillmentOptions(
providerId: string
): Promise<Record<string, any>[]> {
): Promise<FulfillmentOption[]> {
return await this.fulfillmentProviderService_.getFulfillmentOptions(
providerId
)

View File

@@ -2,6 +2,7 @@ import {
CalculateShippingOptionPriceDTO,
Constructor,
DAL,
FulfillmentOption,
FulfillmentTypes,
IFulfillmentProvider,
Logger,
@@ -81,7 +82,7 @@ export default class FulfillmentProviderService extends ModulesSdkUtils.MedusaIn
async getFulfillmentOptions(
providerId: string
): Promise<Record<string, unknown>[]> {
): Promise<FulfillmentOption[]> {
const provider = this.retrieveProviderRegistration(providerId)
return await provider.getFulfillmentOptions()
}