Files
medusa-store/packages/modules/pricing/src/models/price-list-rule.ts
Adrien de Peretti cb26c224ea chore(pricing): improve calculate prices performances (#12120)
* chore(pricing): Try to improve performances

* chore(pricing): new indexes

* chore(pricing): new indexes

* fix orderr

* Create olive-horses-judge.md

* feedback
2025-04-09 13:21:33 +02:00

25 lines
560 B
TypeScript

import { model } from "@medusajs/framework/utils"
import PriceList from "./price-list"
const PriceListRule = model
.define("PriceListRule", {
id: model.id({ prefix: "prule" }).primaryKey(),
attribute: model.text(),
value: model.json().nullable(),
price_list: model.belongsTo(() => PriceList, {
mappedBy: "price_list_rules",
}),
})
.indexes([
{
on: ["price_list_id"],
where: "deleted_at IS NULL",
},
{
on: ["attribute"],
where: "deleted_at IS NULL",
},
])
export default PriceListRule