chore(core-flows): return fulfillment link (#8304)
This commit is contained in:
committed by
GitHub
parent
feabe0e6c0
commit
d63ca00214
@@ -6,6 +6,7 @@ export * from "./order-cart"
|
||||
export * from "./order-fulfillment"
|
||||
export * from "./order-payment-collection"
|
||||
export * from "./order-promotion"
|
||||
export * from "./order-return-fulfillment"
|
||||
export * from "./product-sales-channel"
|
||||
export * from "./product-variant-inventory-item"
|
||||
export * from "./product-variant-price-set"
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import { ModuleJoinerConfig } from "@medusajs/types"
|
||||
import { LINKS, Modules } from "@medusajs/utils"
|
||||
|
||||
export const ReturnFulfillment: ModuleJoinerConfig = {
|
||||
serviceName: LINKS.ReturnFulfillment,
|
||||
isLink: true,
|
||||
databaseConfig: {
|
||||
tableName: "return_fulfillment",
|
||||
idPrefix: "retful",
|
||||
},
|
||||
alias: [
|
||||
{
|
||||
name: ["return_fulfillment", "return_fulfillments"],
|
||||
args: {
|
||||
entity: "LinkReturnFulfillment",
|
||||
},
|
||||
},
|
||||
],
|
||||
primaryKeys: ["id", "return_id", "fulfillment_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: Modules.ORDER,
|
||||
primaryKey: "id",
|
||||
foreignKey: "return_id",
|
||||
alias: "return",
|
||||
args: {
|
||||
methodSuffix: "Returns",
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: Modules.FULFILLMENT,
|
||||
primaryKey: "id",
|
||||
foreignKey: "fulfillment_id",
|
||||
alias: "fulfillments",
|
||||
args: {
|
||||
methodSuffix: "Fulfillments",
|
||||
},
|
||||
},
|
||||
],
|
||||
extends: [
|
||||
{
|
||||
serviceName: Modules.ORDER,
|
||||
fieldAlias: {
|
||||
return_fulfillments: {
|
||||
path: "return_fulfillment_link.fulfillments",
|
||||
isList: true,
|
||||
},
|
||||
},
|
||||
relationship: {
|
||||
serviceName: LINKS.OrderFulfillment,
|
||||
primaryKey: "return_id",
|
||||
foreignKey: "id",
|
||||
alias: "return_fulfillment_link",
|
||||
isList: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: Modules.FULFILLMENT,
|
||||
relationship: {
|
||||
serviceName: LINKS.OrderFulfillment,
|
||||
primaryKey: "fulfillment_id",
|
||||
foreignKey: "id",
|
||||
alias: "return_link",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user