feat(medusa,types): add fulfillment provider list api (#7124)

* feat(medusa,types): add fulfillment provider list api

* chore: remove timestamps
This commit is contained in:
Riqwan Thamir
2024-04-22 19:35:33 +02:00
committed by GitHub
parent 0df523594f
commit 38c971f111
11 changed files with 178 additions and 2 deletions
@@ -3,6 +3,7 @@ import { ModuleJoinerConfig } from "@medusajs/types"
import { MapToConfig } from "@medusajs/utils"
import {
Fulfillment,
FulfillmentProvider,
FulfillmentSet,
GeoZone,
ServiceZone,
@@ -59,6 +60,13 @@ export const joinerConfig: ModuleJoinerConfig = {
methodSuffix: "Fulfillments",
},
},
{
name: ["fulfillment_provider", "fulfillment_providers"],
args: {
entity: FulfillmentProvider.name,
methodSuffix: "FulfillmentProviders",
},
},
{
name: ["service_zone", "service_zones"],
args: {
@@ -20,15 +20,16 @@ import {
InjectTransactionManager,
MedusaContext,
MedusaError,
Modules,
ModulesSdkUtils,
arrayDifference,
getSetDifference,
isString,
promiseAll,
Modules
} from "@medusajs/utils"
import {
Fulfillment,
FulfillmentProvider,
FulfillmentSet,
GeoZone,
ServiceZone,
@@ -39,8 +40,8 @@ import {
} from "@models"
import { isContextValid, validateRules } from "@utils"
import { entityNameToLinkableKeysMap, joinerConfig } from "../joiner-config"
import FulfillmentProviderService from "./fulfillment-provider"
import { UpdateShippingOptionsInput } from "../types/service"
import FulfillmentProviderService from "./fulfillment-provider"
const generateMethodForModels = [
ServiceZone,
@@ -49,6 +50,7 @@ const generateMethodForModels = [
ShippingProfile,
ShippingOptionRule,
ShippingOptionType,
FulfillmentProvider,
// Not adding Fulfillment to not auto generate the methods under the hood and only provide the methods we want to expose8
]
@@ -86,6 +88,7 @@ export default class FulfillmentModuleService<
ShippingProfile: { dto: FulfillmentTypes.ShippingProfileDTO }
ShippingOptionRule: { dto: FulfillmentTypes.ShippingOptionRuleDTO }
ShippingOptionType: { dto: FulfillmentTypes.ShippingOptionTypeDTO }
FulfillmentProvider: { dto: FulfillmentTypes.FulfillmentProviderDTO }
}
>(FulfillmentSet, generateMethodForModels, entityNameToLinkableKeysMap)
implements IFulfillmentModuleService