Merge branch 'develop' into fix/2152
This commit is contained in:
@@ -14,17 +14,17 @@ import {
|
||||
UpdateServiceZoneDTO,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
arrayDifference,
|
||||
EmitEvents,
|
||||
FulfillmentUtils,
|
||||
getSetDifference,
|
||||
InjectManager,
|
||||
InjectTransactionManager,
|
||||
isString,
|
||||
MedusaContext,
|
||||
MedusaError,
|
||||
Modules,
|
||||
ModulesSdkUtils,
|
||||
arrayDifference,
|
||||
getSetDifference,
|
||||
isString,
|
||||
promiseAll,
|
||||
} from "@medusajs/utils"
|
||||
import {
|
||||
|
||||
@@ -49,6 +49,9 @@ export const LocationFulfillmentSet: ModuleJoinerConfig = {
|
||||
},
|
||||
{
|
||||
serviceName: Modules.FULFILLMENT,
|
||||
fieldAlias: {
|
||||
location: "locations_link.location",
|
||||
},
|
||||
relationship: {
|
||||
serviceName: LINKS.LocationFulfillmentSet,
|
||||
primaryKey: "fulfillment_set_id",
|
||||
|
||||
@@ -12,3 +12,4 @@ export * from "./readonly"
|
||||
export * from "./region-payment-provider"
|
||||
export * from "./sales-channel-location"
|
||||
export * from "./shipping-option-price-set"
|
||||
export * from "./order-fulfillment"
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import { Modules } from "@medusajs/modules-sdk"
|
||||
import { ModuleJoinerConfig } from "@medusajs/types"
|
||||
import { LINKS } from "@medusajs/utils"
|
||||
|
||||
export const OrderFulfillment: ModuleJoinerConfig = {
|
||||
serviceName: LINKS.OrderFulfillment,
|
||||
isLink: true,
|
||||
databaseConfig: {
|
||||
tableName: "order_fulfillment",
|
||||
idPrefix: "orderful",
|
||||
},
|
||||
alias: [
|
||||
{
|
||||
name: ["order_fulfillment", "order_fulfillments"],
|
||||
args: {
|
||||
entity: "LinkOrderFulfillment",
|
||||
},
|
||||
},
|
||||
],
|
||||
primaryKeys: ["id", "order_id", "fulfillment_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: Modules.ORDER,
|
||||
primaryKey: "id",
|
||||
foreignKey: "order_id",
|
||||
alias: "order",
|
||||
},
|
||||
{
|
||||
serviceName: Modules.FULFILLMENT,
|
||||
primaryKey: "id",
|
||||
foreignKey: "fulfillment_id",
|
||||
alias: "fulfillments",
|
||||
args: {
|
||||
// TODO: We are not suppose to know the module implementation here, wait for later to think about inferring it
|
||||
methodSuffix: "Fulfillments",
|
||||
},
|
||||
},
|
||||
],
|
||||
extends: [
|
||||
{
|
||||
serviceName: Modules.ORDER,
|
||||
fieldAlias: {
|
||||
fulfillments: "fulfillment_link.fulfillments",
|
||||
},
|
||||
relationship: {
|
||||
serviceName: LINKS.OrderFulfillment,
|
||||
primaryKey: "order_id",
|
||||
foreignKey: "id",
|
||||
alias: "fulfillment_link",
|
||||
isList: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: Modules.FULFILLMENT,
|
||||
relationship: {
|
||||
serviceName: LINKS.OrderFulfillment,
|
||||
primaryKey: "fulfillment_id",
|
||||
foreignKey: "id",
|
||||
alias: "order_link",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -2214,7 +2214,7 @@ export default class OrderModuleService<
|
||||
if (!isString(data.shipping_method)) {
|
||||
const methods = await this.createShippingMethods(
|
||||
data.order_id,
|
||||
data.shipping_method as any,
|
||||
[{ order_id: data.order_id, ...data.shipping_method }],
|
||||
sharedContext
|
||||
)
|
||||
shippingMethodId = methods[0].id
|
||||
|
||||
Reference in New Issue
Block a user