* feat: Completely revamp the pricing module * chore: Update all places to the new pricing interfaces * fix: Remove unnecessary join to itself * chore: Add data migration for existing users * fix: Apply the correct index to price rule
20 lines
535 B
TypeScript
20 lines
535 B
TypeScript
import {
|
|
buildEntitiesNameToLinkableKeysMap,
|
|
defineJoinerConfig,
|
|
MapToConfig,
|
|
Modules,
|
|
} from "@medusajs/utils"
|
|
import { Price, PriceList, PriceSet } from "@models"
|
|
|
|
export const joinerConfig = defineJoinerConfig(Modules.PRICING, {
|
|
entityQueryingConfig: [PriceSet, PriceList, Price],
|
|
linkableKeys: {
|
|
price_set_id: PriceSet.name,
|
|
price_list_id: PriceList.name,
|
|
price_id: Price.name,
|
|
},
|
|
})
|
|
|
|
export const entityNameToLinkableKeysMap: MapToConfig =
|
|
buildEntitiesNameToLinkableKeysMap(joinerConfig.linkableKeys)
|