feat(pricing, types): PriceSets as entry point to pricing module (#4978)
What: - Adds PriceSet, PriceSetMoneyAmount, updates schema - Adds service/repo for PriceSet - Shifts entry point to use PriceSet - Updates link/joiner config RESOLVES CORE-1495
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export * from "./inventory-level-stock-location"
|
||||
export * from "./product-variant-inventory-item"
|
||||
export * from "./product-variant-money-amount"
|
||||
export * from "./product-variant-price-set"
|
||||
export * from "./product-shipping-profile"
|
||||
|
||||
+13
-13
@@ -2,22 +2,22 @@ import { Modules } from "@medusajs/modules-sdk"
|
||||
import { ModuleJoinerConfig } from "@medusajs/types"
|
||||
import { LINKS } from "../links"
|
||||
|
||||
export const ProductVariantMoneyAmount: ModuleJoinerConfig = {
|
||||
serviceName: LINKS.ProductVariantMoneyAmount,
|
||||
export const ProductVariantPriceSet: ModuleJoinerConfig = {
|
||||
serviceName: LINKS.ProductVariantPriceSet,
|
||||
isLink: true,
|
||||
databaseConfig: {
|
||||
tableName: "product_variant_money_amount",
|
||||
idPrefix: "pvma",
|
||||
tableName: "product_variant_price_set",
|
||||
idPrefix: "pvps",
|
||||
},
|
||||
alias: [
|
||||
{
|
||||
name: "product_variant_money_amount",
|
||||
name: "product_variant_price_set",
|
||||
},
|
||||
{
|
||||
name: "product_variant_money_amounts",
|
||||
name: "product_variant_price_sets",
|
||||
},
|
||||
],
|
||||
primaryKeys: ["id", "variant_id", "money_amount_id"],
|
||||
primaryKeys: ["id", "variant_id", "price_set_id"],
|
||||
relationships: [
|
||||
{
|
||||
serviceName: Modules.PRODUCT,
|
||||
@@ -31,8 +31,8 @@ export const ProductVariantMoneyAmount: ModuleJoinerConfig = {
|
||||
{
|
||||
serviceName: Modules.PRICING,
|
||||
primaryKey: "id",
|
||||
foreignKey: "money_amount_id",
|
||||
alias: "money_amount",
|
||||
foreignKey: "price_set_id",
|
||||
alias: "price_set",
|
||||
deleteCascade: true,
|
||||
},
|
||||
],
|
||||
@@ -40,18 +40,18 @@ export const ProductVariantMoneyAmount: ModuleJoinerConfig = {
|
||||
{
|
||||
serviceName: Modules.PRODUCT,
|
||||
relationship: {
|
||||
serviceName: LINKS.ProductVariantMoneyAmount,
|
||||
serviceName: LINKS.ProductVariantPriceSet,
|
||||
primaryKey: "variant_id",
|
||||
foreignKey: "id",
|
||||
alias: "prices",
|
||||
isList: true,
|
||||
isList: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
serviceName: Modules.PRICING,
|
||||
relationship: {
|
||||
serviceName: LINKS.ProductVariantMoneyAmount,
|
||||
primaryKey: "money_amount_id",
|
||||
serviceName: LINKS.ProductVariantPriceSet,
|
||||
primaryKey: "price_set_id",
|
||||
foreignKey: "id",
|
||||
alias: "variant_link",
|
||||
},
|
||||
Reference in New Issue
Block a user