feat: Cart Customer link + create cart with customer (#6426)

This commit is contained in:
Oli Juhl
2024-02-19 08:28:44 +01:00
committed by GitHub
parent f6d38163bb
commit 5db3ec09e2
16 changed files with 544 additions and 169 deletions
@@ -0,0 +1,28 @@
import { Modules } from "@medusajs/modules-sdk"
import { ModuleJoinerConfig } from "@medusajs/types"
export const CartCustomer: ModuleJoinerConfig = {
isLink: true,
isReadOnlyLink: true,
extends: [
{
serviceName: Modules.CART,
relationship: {
serviceName: Modules.CUSTOMER,
primaryKey: "id",
foreignKey: "customer_id",
alias: "customer",
},
},
{
serviceName: Modules.CUSTOMER,
relationship: {
serviceName: Modules.CART,
primaryKey: "customer_id",
foreignKey: "id",
alias: "carts",
isList: true,
},
},
],
}
@@ -1,3 +1,4 @@
export * from "./cart-customer"
export * from "./cart-region"
export * from "./cart-sales-channel"
export * from "./inventory-level-stock-location"