feat: Fix subscribers loading + add order <> cart link (#7617)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
export * from "./cart-payment-collection"
|
||||
export * from "./cart-promotion"
|
||||
export * from "./fulfillment-set-location"
|
||||
export * from "./order-cart"
|
||||
export * from "./order-fulfillment"
|
||||
export * from "./order-payment-collection"
|
||||
export * from "./order-promotion"
|
||||
export * from "./product-sales-channel"
|
||||
@@ -8,8 +10,7 @@ export * from "./product-variant-inventory-item"
|
||||
export * from "./product-variant-price-set"
|
||||
export * from "./publishable-api-key-sales-channel"
|
||||
export * from "./readonly"
|
||||
export * from "./order-fulfillment"
|
||||
export * from "./region-payment-provider"
|
||||
export * from "./sales-channel-location"
|
||||
export * from "./shipping-option-price-set"
|
||||
export * from "./order-fulfillment"
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import { Modules } from "@medusajs/modules-sdk"
|
||||
import { ModuleJoinerConfig } from "@medusajs/types"
|
||||
import { LINKS } from "@medusajs/utils"
|
||||
|
||||
export const OrderCart: ModuleJoinerConfig = {
|
||||
serviceName: LINKS.OrderCart,
|
||||
isLink: true,
|
||||
databaseConfig: {
|
||||
tableName: "order_cart",
|
||||
idPrefix: "ordercart",
|
||||
},
|
||||
alias: [
|
||||
{
|
||||
name: ["order_cart", "order_carts"],
|
||||
args: {
|
||||
entity: "LinkOrderCart",
|
||||
},
|
||||
},
|
||||
],
|
||||
primaryKeys: ["id", "order_id", "cart_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: Modules.ORDER,
|
||||
primaryKey: "id",
|
||||
foreignKey: "order_id",
|
||||
alias: "order",
|
||||
},
|
||||
{
|
||||
serviceName: Modules.CART,
|
||||
primaryKey: "id",
|
||||
foreignKey: "cart_id",
|
||||
alias: "cart",
|
||||
},
|
||||
],
|
||||
extends: [
|
||||
{
|
||||
serviceName: Modules.ORDER,
|
||||
fieldAlias: {
|
||||
cart: "cart_link.cart",
|
||||
},
|
||||
relationship: {
|
||||
serviceName: LINKS.OrderCart,
|
||||
primaryKey: "order_id",
|
||||
foreignKey: "id",
|
||||
alias: "cart_link",
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: Modules.CART,
|
||||
fieldAlias: {
|
||||
order: "order_link.order",
|
||||
},
|
||||
relationship: {
|
||||
serviceName: LINKS.OrderCart,
|
||||
primaryKey: "cart_id",
|
||||
foreignKey: "id",
|
||||
alias: "order_link",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -5,12 +5,12 @@ import {
|
||||
TransactionStep,
|
||||
} from "@medusajs/orchestration"
|
||||
import { ContainerLike, Context, MedusaContainer } from "@medusajs/types"
|
||||
import { InjectSharedContext, isString, MedusaContext } from "@medusajs/utils"
|
||||
import { InjectSharedContext, MedusaContext, isString } from "@medusajs/utils"
|
||||
import {
|
||||
type FlowRunOptions,
|
||||
MedusaWorkflow,
|
||||
resolveValue,
|
||||
ReturnWorkflow,
|
||||
resolveValue,
|
||||
type FlowRunOptions,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { ulid } from "ulid"
|
||||
import { InMemoryDistributedTransactionStorage } from "../utils"
|
||||
|
||||
Reference in New Issue
Block a user