@medusajs/pricing 3.0.0-snapshot-20250408170244 → 3.0.0-snapshot-20250409083720
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/migrations/Migration20250408145122.d.ts +6 -0
- package/dist/migrations/Migration20250408145122.d.ts.map +1 -0
- package/dist/migrations/Migration20250408145122.js +18 -0
- package/dist/migrations/Migration20250408145122.js.map +1 -0
- package/dist/models/price-list-rule.d.ts.map +1 -1
- package/dist/models/price-list-rule.js +4 -0
- package/dist/models/price-list-rule.js.map +1 -1
- package/dist/models/price-rule.d.ts.map +1 -1
- package/dist/models/price-rule.js +8 -0
- package/dist/models/price-rule.js.map +1 -1
- package/dist/repositories/pricing.d.ts +1 -0
- package/dist/repositories/pricing.d.ts.map +1 -1
- package/dist/repositories/pricing.js +155 -152
- package/dist/repositories/pricing.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20250408145122.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250408145122.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAOnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAOrC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20250408145122 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20250408145122 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_price_list_rule_attribute" ON "price_list_rule" (attribute) WHERE deleted_at IS NULL;`);
|
8
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_price_rule_attribute_value" ON "price_rule" (attribute, value) WHERE deleted_at IS NULL;`);
|
9
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_price_rule_operator_value" ON "price_rule" (operator, value) WHERE deleted_at IS NULL;`);
|
10
|
+
}
|
11
|
+
async down() {
|
12
|
+
this.addSql(`drop index if exists "IDX_price_list_rule_attribute";`);
|
13
|
+
this.addSql(`drop index if exists "IDX_price_rule_attribute_value";`);
|
14
|
+
this.addSql(`drop index if exists "IDX_price_rule_operator_value";`);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
exports.Migration20250408145122 = Migration20250408145122;
|
18
|
+
//# sourceMappingURL=Migration20250408145122.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20250408145122.js","sourceRoot":"","sources":["../../src/migrations/Migration20250408145122.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAElD,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,uHAAuH,CAAC,CAAC;QAErI,IAAI,CAAC,MAAM,CAAC,0HAA0H,CAAC,CAAC;QACxI,IAAI,CAAC,MAAM,CAAC,wHAAwH,CAAC,CAAC;IACxI,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,uDAAuD,CAAC,CAAC;QAErE,IAAI,CAAC,MAAM,CAAC,wDAAwD,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,uDAAuD,CAAC,CAAC;IACvE,CAAC;CAEF;AAhBD,0DAgBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"price-list-rule.d.ts","sourceRoot":"","sources":["../../src/models/price-list-rule.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"price-list-rule.d.ts","sourceRoot":"","sources":["../../src/models/price-list-rule.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkBf,CAAA;AAEJ,eAAe,aAAa,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"price-list-rule.js","sourceRoot":"","sources":["../../src/models/price-list-rule.ts"],"names":[],"mappings":";;;;;AAAA,qDAAiD;AACjD,8DAAoC;AAEpC,MAAM,aAAa,GAAG,aAAK;KACxB,MAAM,CAAC,eAAe,EAAE;IACvB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE;IACvB,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC9B,UAAU,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,oBAAS,EAAE;QAC3C,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;CACH,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,eAAe,CAAC;QACrB,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,aAAa,CAAA"}
|
1
|
+
{"version":3,"file":"price-list-rule.js","sourceRoot":"","sources":["../../src/models/price-list-rule.ts"],"names":[],"mappings":";;;;;AAAA,qDAAiD;AACjD,8DAAoC;AAEpC,MAAM,aAAa,GAAG,aAAK;KACxB,MAAM,CAAC,eAAe,EAAE;IACvB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE;IACvB,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC9B,UAAU,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,oBAAS,EAAE;QAC3C,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;CACH,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,eAAe,CAAC;QACrB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,WAAW,CAAC;QACjB,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,aAAa,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"price-rule.d.ts","sourceRoot":"","sources":["../../src/models/price-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAGtE,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"price-rule.d.ts","sourceRoot":"","sources":["../../src/models/price-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAGtE,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyBX,CAAA;AAEJ,eAAe,SAAS,CAAA"}
|
@@ -22,6 +22,14 @@ const PriceRule = utils_1.model
|
|
22
22
|
where: "deleted_at IS NULL",
|
23
23
|
unique: true,
|
24
24
|
},
|
25
|
+
{
|
26
|
+
on: ["attribute", "value"],
|
27
|
+
where: "deleted_at IS NULL",
|
28
|
+
},
|
29
|
+
{
|
30
|
+
on: ["operator", "value"],
|
31
|
+
where: "deleted_at IS NULL",
|
32
|
+
},
|
25
33
|
]);
|
26
34
|
exports.default = PriceRule;
|
27
35
|
//# sourceMappingURL=price-rule.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"price-rule.js","sourceRoot":"","sources":["../../src/models/price-rule.ts"],"names":[],"mappings":";;;;;AAAA,qDAAsE;AACtE,oDAA2B;AAE3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C,CAAC,CAAC;IACnC,KAAK,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,eAAK,EAAE;QAClC,QAAQ,EAAE,aAAa;KACxB,CAAC;CACH,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC;QACzC,KAAK,EAAE,oBAAoB;QAC3B,MAAM,EAAE,IAAI;KACb;IACD;QACE,EAAE,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;QAC1B,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;QACzB,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,SAAS,CAAA"}
|
@@ -3,5 +3,6 @@ import { CalculatedPriceSetDTO, Context, PricingContext, PricingFilters, Pricing
|
|
3
3
|
export declare class PricingRepository extends MikroOrmBase implements PricingRepositoryService {
|
4
4
|
constructor();
|
5
5
|
calculatePrices(pricingFilters: PricingFilters, pricingContext?: PricingContext, sharedContext?: Context): Promise<CalculatedPriceSetDTO[]>;
|
6
|
+
private getAttributesFromRuleTables;
|
6
7
|
}
|
7
8
|
//# sourceMappingURL=pricing.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../src/repositories/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAGb,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,cAAc,EACd,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;
|
1
|
+
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../src/repositories/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAGb,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,cAAc,EACd,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;AAKlC,qBAAa,iBACX,SAAQ,YACR,YAAW,wBAAwB;;IAQ7B,eAAe,CACnB,cAAc,EAAE,cAAc,EAC9B,cAAc,GAAE,cAAgC,EAChD,aAAa,GAAE,OAAY,GAC1B,OAAO,CAAC,qBAAqB,EAAE,CAAC;YA6NrB,2BAA2B;CAe1C"}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.PricingRepository = void 0;
|
4
4
|
const utils_1 = require("@medusajs/framework/utils");
|
5
|
+
// Simple cache implementation
|
5
6
|
class PricingRepository extends utils_1.MikroOrmBase {
|
6
7
|
constructor() {
|
7
8
|
// @ts-ignore
|
@@ -12,36 +13,17 @@ class PricingRepository extends utils_1.MikroOrmBase {
|
|
12
13
|
const manager = this.getActiveManager(sharedContext);
|
13
14
|
const knex = manager.getKnex();
|
14
15
|
const context = pricingContext.context || {};
|
15
|
-
//
|
16
|
-
// We should potentially think of reserved words in pricingContext that can't be used in rules
|
17
|
-
// or have a separate pricing options that accept things like quantity, price_list_id and other
|
18
|
-
// pricing module features
|
16
|
+
// Extract quantity and currency from context
|
19
17
|
const quantity = context.quantity;
|
20
18
|
delete context.quantity;
|
21
|
-
// Currency code
|
19
|
+
// Currency code is required
|
22
20
|
const currencyCode = context.currency_code;
|
23
21
|
delete context.currency_code;
|
24
22
|
if (!currencyCode) {
|
25
23
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Method calculatePrices requires currency_code in the pricing context`);
|
26
24
|
}
|
27
|
-
|
28
|
-
|
29
|
-
// We don't get anything from the db otherwise.
|
30
|
-
if (!isContextPresent) {
|
31
|
-
return [];
|
32
|
-
}
|
33
|
-
// We query the rule tables to get all whitelisted rule attributes
|
34
|
-
// This will help cleanup the query and do a db query on only necessary rule attributes.
|
35
|
-
const priceRuleAttributesQuery = knex("price_rule")
|
36
|
-
.distinct("attribute")
|
37
|
-
.pluck("attribute");
|
38
|
-
const priceListRuleAttributesQuery = knex("price_list_rule")
|
39
|
-
.distinct("attribute")
|
40
|
-
.pluck("attribute");
|
41
|
-
const [ruleAttributes, priceListRuleAttributes] = await (0, utils_1.promiseAll)([
|
42
|
-
priceRuleAttributesQuery,
|
43
|
-
priceListRuleAttributesQuery,
|
44
|
-
]);
|
25
|
+
// Generate flatten key-value pairs for rule matching
|
26
|
+
const [ruleAttributes, priceListRuleAttributes] = await this.getAttributesFromRuleTables(knex);
|
45
27
|
const allowedRuleAttributes = [
|
46
28
|
...ruleAttributes,
|
47
29
|
...priceListRuleAttributes,
|
@@ -53,156 +35,177 @@ class PricingRepository extends utils_1.MikroOrmBase {
|
|
53
35
|
return (allowedRuleAttributes.includes(key) &&
|
54
36
|
(isValuePresent || isArrayPresent));
|
55
37
|
});
|
56
|
-
|
57
|
-
//
|
58
|
-
const
|
59
|
-
price: "price",
|
60
|
-
})
|
38
|
+
const hasComplexContext = flattenedContext.length > 0;
|
39
|
+
// Base query with efficient index lookups
|
40
|
+
const query = knex
|
61
41
|
.select({
|
62
42
|
id: "price.id",
|
43
|
+
price_set_id: "price.price_set_id",
|
63
44
|
amount: "price.amount",
|
64
45
|
raw_amount: "price.raw_amount",
|
65
46
|
min_quantity: "price.min_quantity",
|
66
47
|
max_quantity: "price.max_quantity",
|
67
48
|
currency_code: "price.currency_code",
|
68
|
-
deleted_at: "price.deleted_at",
|
69
|
-
price_set_id: "price.price_set_id",
|
70
|
-
rules_count: "price.rules_count",
|
71
49
|
price_list_id: "price.price_list_id",
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
})
|
76
|
-
.leftJoin("price_rule as pr", "pr.price_id", "price.id")
|
77
|
-
.leftJoin("price_list as pl", function () {
|
78
|
-
this.on("pl.id", "price.price_list_id").andOn("pl.status", knex.raw("?", [utils_1.PriceListStatus.ACTIVE]));
|
50
|
+
price_list_type: "pl.type",
|
51
|
+
rules_count: "price.rules_count",
|
52
|
+
price_list_rules_count: "pl.rules_count",
|
79
53
|
})
|
80
|
-
.
|
81
|
-
.
|
82
|
-
.
|
83
|
-
.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
.where("
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
.
|
97
|
-
|
98
|
-
|
99
|
-
|
54
|
+
.from("price")
|
55
|
+
.whereIn("price.price_set_id", pricingFilters.id)
|
56
|
+
.andWhere("price.currency_code", currencyCode)
|
57
|
+
.whereNull("price.deleted_at");
|
58
|
+
// Apply quantity filter
|
59
|
+
if (quantity !== undefined) {
|
60
|
+
query.andWhere(function () {
|
61
|
+
this.where(function () {
|
62
|
+
this.where("price.min_quantity", "<=", quantity).andWhere("price.max_quantity", ">=", quantity);
|
63
|
+
}).orWhere(function () {
|
64
|
+
this.whereNull("price.min_quantity").whereNull("price.max_quantity");
|
65
|
+
});
|
66
|
+
});
|
67
|
+
}
|
68
|
+
else {
|
69
|
+
query.andWhere(function () {
|
70
|
+
this.where("price.min_quantity", "<=", 1).orWhereNull("price.min_quantity");
|
71
|
+
});
|
72
|
+
}
|
73
|
+
// Efficient price list join with index usage
|
74
|
+
query.leftJoin("price_list as pl", function () {
|
75
|
+
this.on("pl.id", "=", "price.price_list_id")
|
76
|
+
.andOn("pl.status", "=", knex.raw("?", [utils_1.PriceListStatus.ACTIVE]))
|
77
|
+
.andOn(function () {
|
78
|
+
this.onNull("pl.deleted_at");
|
100
79
|
})
|
101
|
-
.
|
102
|
-
|
103
|
-
.where("pr.operator", "lte")
|
104
|
-
.whereRaw("? <= pr.value::numeric", [value]);
|
80
|
+
.andOn(function () {
|
81
|
+
this.onNull("pl.starts_at").orOn("pl.starts_at", "<=", knex.fn.now());
|
105
82
|
})
|
106
|
-
.
|
107
|
-
|
108
|
-
.where("pr.operator", "eq")
|
109
|
-
.whereRaw("? = pr.value::numeric", [value]);
|
110
|
-
});
|
111
|
-
};
|
112
|
-
priceSubQueryKnex.orWhere((priceBuilder) => {
|
113
|
-
priceBuilder
|
114
|
-
.whereNull("price.price_list_id")
|
115
|
-
.andWhere((withoutPriceListBuilder) => {
|
116
|
-
for (const [key, value] of flattenedContext) {
|
117
|
-
withoutPriceListBuilder.orWhere((orBuilder) => {
|
118
|
-
orBuilder.where("pr.attribute", key);
|
119
|
-
if (typeof value === "number") {
|
120
|
-
buildOperatorQueries(orBuilder, value);
|
121
|
-
}
|
122
|
-
else {
|
123
|
-
const normalizeValue = Array.isArray(value) ? value : [value];
|
124
|
-
orBuilder.whereIn("pr.value", normalizeValue);
|
125
|
-
}
|
126
|
-
});
|
127
|
-
}
|
128
|
-
withoutPriceListBuilder.orWhere("price.rules_count", "=", 0);
|
83
|
+
.andOn(function () {
|
84
|
+
this.onNull("pl.ends_at").orOn("pl.ends_at", ">=", knex.fn.now());
|
129
85
|
});
|
130
86
|
});
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
87
|
+
// OPTIMIZATION: Only add complex rule filtering when necessary
|
88
|
+
if (hasComplexContext) {
|
89
|
+
// For price rules - direct check that ALL rules match
|
90
|
+
const priceRuleConditions = knex.raw(`
|
91
|
+
(
|
92
|
+
price.rules_count = 0 OR
|
93
|
+
(
|
94
|
+
/* Count all matching rules and compare to total rule count */
|
95
|
+
SELECT COUNT(*)
|
96
|
+
FROM price_rule pr
|
97
|
+
WHERE pr.price_id = price.id
|
98
|
+
AND pr.deleted_at IS NULL
|
99
|
+
AND (
|
100
|
+
${flattenedContext
|
101
|
+
.map(([key, value]) => {
|
102
|
+
if (typeof value === "number") {
|
103
|
+
return `
|
104
|
+
(pr.attribute = ? AND (
|
105
|
+
(pr.operator = 'eq' AND pr.value = ?) OR
|
106
|
+
(pr.operator = 'gt' AND ? > pr.value::numeric) OR
|
107
|
+
(pr.operator = 'gte' AND ? >= pr.value::numeric) OR
|
108
|
+
(pr.operator = 'lt' AND ? < pr.value::numeric) OR
|
109
|
+
(pr.operator = 'lte' AND ? <= pr.value::numeric)
|
110
|
+
))
|
111
|
+
`;
|
112
|
+
}
|
113
|
+
else {
|
114
|
+
const normalizeValue = Array.isArray(value)
|
115
|
+
? value
|
116
|
+
: [value];
|
117
|
+
const placeholders = normalizeValue.map(() => "?").join(",");
|
118
|
+
return `(pr.attribute = ? AND pr.value IN (${placeholders}))`;
|
119
|
+
}
|
136
120
|
})
|
137
|
-
.
|
138
|
-
|
121
|
+
.join(" OR ")}
|
122
|
+
)
|
123
|
+
) = (
|
124
|
+
/* Get total rule count */
|
125
|
+
SELECT COUNT(*)
|
126
|
+
FROM price_rule pr
|
127
|
+
WHERE pr.price_id = price.id
|
128
|
+
AND pr.deleted_at IS NULL
|
129
|
+
)
|
130
|
+
)
|
131
|
+
`, flattenedContext.flatMap(([key, value]) => {
|
132
|
+
if (typeof value === "number") {
|
133
|
+
return [key, value.toString(), value, value, value, value];
|
134
|
+
}
|
135
|
+
else {
|
136
|
+
const normalizeValue = Array.isArray(value) ? value : [value];
|
137
|
+
return [key, ...normalizeValue];
|
138
|
+
}
|
139
|
+
}));
|
140
|
+
// For price list rules - direct check that ALL rules match
|
141
|
+
const priceListRuleConditions = knex.raw(`
|
142
|
+
(
|
143
|
+
pl.rules_count = 0 OR
|
144
|
+
(
|
145
|
+
/* Count all matching rules and compare to total rule count */
|
146
|
+
SELECT COUNT(*)
|
147
|
+
FROM price_list_rule plr
|
148
|
+
WHERE plr.price_list_id = pl.id
|
149
|
+
AND plr.deleted_at IS NULL
|
150
|
+
AND (
|
151
|
+
${flattenedContext
|
152
|
+
.map(([key, value]) => {
|
153
|
+
return `(plr.attribute = ? AND plr.value @> ?)`;
|
139
154
|
})
|
140
|
-
.
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
}
|
162
|
-
});
|
163
|
-
}
|
164
|
-
contextBuilder.andWhere("price.rules_count", ">", 0);
|
165
|
-
});
|
166
|
-
this.orWhere("price.rules_count", "=", 0);
|
155
|
+
.join(" OR ")}
|
156
|
+
)
|
157
|
+
) = (
|
158
|
+
/* Get total rule count */
|
159
|
+
SELECT COUNT(*)
|
160
|
+
FROM price_list_rule plr
|
161
|
+
WHERE plr.price_list_id = pl.id
|
162
|
+
AND plr.deleted_at IS NULL
|
163
|
+
)
|
164
|
+
)
|
165
|
+
`, flattenedContext.flatMap(([key, value]) => {
|
166
|
+
return [key, JSON.stringify(Array.isArray(value) ? value : [value])];
|
167
|
+
}));
|
168
|
+
query.where((qb) => {
|
169
|
+
qb.whereNull("price.price_list_id")
|
170
|
+
.andWhereRaw(priceRuleConditions)
|
171
|
+
.orWhere((qb2) => {
|
172
|
+
qb2
|
173
|
+
.whereNotNull("price.price_list_id")
|
174
|
+
.whereRaw(priceListRuleConditions)
|
175
|
+
.andWhereRaw(priceRuleConditions);
|
167
176
|
});
|
168
177
|
});
|
169
|
-
});
|
170
|
-
const priceSetQueryKnex = knex({
|
171
|
-
ps: "price_set",
|
172
|
-
})
|
173
|
-
.select({
|
174
|
-
id: "price.id",
|
175
|
-
price_set_id: "ps.id",
|
176
|
-
amount: "price.amount",
|
177
|
-
raw_amount: "price.raw_amount",
|
178
|
-
min_quantity: "price.min_quantity",
|
179
|
-
max_quantity: "price.max_quantity",
|
180
|
-
currency_code: "price.currency_code",
|
181
|
-
rules_count: "price.rules_count",
|
182
|
-
pl_rules_count: "price.pl_rules_count",
|
183
|
-
price_list_type: "price.pl_type",
|
184
|
-
price_list_id: "price.price_list_id",
|
185
|
-
all_rules_count: knex.raw("COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0)"),
|
186
|
-
})
|
187
|
-
.join(priceSubQueryKnex.as("price"), "price.price_set_id", "ps.id")
|
188
|
-
.whereIn("ps.id", pricingFilters.id)
|
189
|
-
.andWhere("price.currency_code", "=", currencyCode)
|
190
|
-
.whereNull("price.deleted_at")
|
191
|
-
.orderBy([
|
192
|
-
{ column: "price.has_price_list", order: "asc" },
|
193
|
-
{ column: "all_rules_count", order: "desc" },
|
194
|
-
{ column: "amount", order: "asc" },
|
195
|
-
]);
|
196
|
-
if (quantity) {
|
197
|
-
priceSetQueryKnex.where("price.min_quantity", "<=", quantity);
|
198
|
-
priceSetQueryKnex.andWhere("price.max_quantity", ">=", quantity);
|
199
178
|
}
|
200
179
|
else {
|
201
|
-
|
202
|
-
|
180
|
+
// Simple case - just get prices with no rules or price lists with no rules
|
181
|
+
query.where(function () {
|
182
|
+
this.where("price.rules_count", 0).orWhere(function () {
|
183
|
+
this.whereNotNull("price.price_list_id").where("pl.rules_count", 0);
|
184
|
+
});
|
203
185
|
});
|
204
186
|
}
|
205
|
-
|
187
|
+
// Optimized ordering to help query planner and preserve price list precedence
|
188
|
+
query
|
189
|
+
.orderByRaw("price.price_list_id IS NOT NULL DESC")
|
190
|
+
.orderByRaw("price.rules_count + COALESCE(pl.rules_count, 0) DESC") // More specific rules first
|
191
|
+
.orderBy("pl.id", "asc") // Order by price list ID to ensure first created price list takes precedence
|
192
|
+
.orderBy("price.amount", "asc"); // For non-price list prices, cheaper ones first
|
193
|
+
// Execute the optimized query
|
194
|
+
return await query;
|
195
|
+
}
|
196
|
+
// Helper method to get attributes from rule tables
|
197
|
+
async getAttributesFromRuleTables(knex) {
|
198
|
+
// Using distinct queries for better performance
|
199
|
+
const priceRuleAttributesQuery = knex("price_rule")
|
200
|
+
.distinct("attribute")
|
201
|
+
.pluck("attribute");
|
202
|
+
const priceListRuleAttributesQuery = knex("price_list_rule")
|
203
|
+
.distinct("attribute")
|
204
|
+
.pluck("attribute");
|
205
|
+
return await (0, utils_1.promiseAll)([
|
206
|
+
priceRuleAttributesQuery,
|
207
|
+
priceListRuleAttributesQuery,
|
208
|
+
]);
|
206
209
|
}
|
207
210
|
}
|
208
211
|
exports.PricingRepository = PricingRepository;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/repositories/pricing.ts"],"names":[],"mappings":";;;AAAA,qDAOkC;AAWlC,MAAa,iBACX,SAAQ,oBAAY;IAGpB;QACE,aAAa;QACb,8CAA8C;QAC9C,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,cAA8B,EAC9B,iBAAiC,EAAE,OAAO,EAAE,EAAE,EAAE,EAChD,gBAAyB,EAAE;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAmB,aAAa,CAAC,CAAA;QACtE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAA;QAC9B,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,IAAI,EAAE,CAAA;QAE5C,
|
1
|
+
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/repositories/pricing.ts"],"names":[],"mappings":";;;AAAA,qDAOkC;AAWlC,8BAA8B;AAE9B,MAAa,iBACX,SAAQ,oBAAY;IAGpB;QACE,aAAa;QACb,8CAA8C;QAC9C,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,cAA8B,EAC9B,iBAAiC,EAAE,OAAO,EAAE,EAAE,EAAE,EAChD,gBAAyB,EAAE;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAmB,aAAa,CAAC,CAAA;QACtE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAA;QAC9B,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,IAAI,EAAE,CAAA;QAE5C,6CAA6C;QAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QACjC,OAAO,OAAO,CAAC,QAAQ,CAAA;QAEvB,4BAA4B;QAC5B,MAAM,YAAY,GAAG,OAAO,CAAC,aAA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YACN,2EAA2E;YAC3E,KAAK,CAAC,KAAK,CAAC;gBACV,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;oBAGzC,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA;gBACrE,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,8EAA8E;QAC9E,KAAK;aACF,UAAU,CAAC,sCAAsC,CAAC;aAClD,UAAU,CAAC,sDAAsD,CAAC,CAAC,4BAA4B;aAC/F,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,6EAA6E;aACrG,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA,CAAC,gDAAgD;QAElF,8BAA8B;QAC9B,OAAO,MAAM,KAAK,CAAA;IACpB,CAAC;IAED,mDAAmD;IAC3C,KAAK,CAAC,2BAA2B,CAAC,IAAU;QAClD,gDAAgD;QAChD,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,CAAC;aAChD,QAAQ,CAAC,WAAW,CAAC;aACrB,KAAK,CAAC,WAAW,CAAC,CAAA;QAErB,MAAM,4BAA4B,GAAG,IAAI,CAAC,iBAAiB,CAAC;aACzD,QAAQ,CAAC,WAAW,CAAC;aACrB,KAAK,CAAC,WAAW,CAAC,CAAA;QAErB,OAAO,MAAM,IAAA,kBAAU,EAAC;YACtB,wBAAwB;YACxB,4BAA4B;SAC7B,CAAC,CAAA;IACJ,CAAC;CACF;AA1PD,8CA0PC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"root":["../src/index.ts","../src/joiner-config.ts","../src/migrations/Migration20230929122253.ts","../src/migrations/Migration20240322094407.ts","../src/migrations/Migration20240322113359.ts","../src/migrations/Migration20240322120125.ts","../src/migrations/Migration20240626133555.ts","../src/migrations/Migration20240704094505.ts","../src/migrations/Migration20241127114534.ts","../src/migrations/Migration20241127223829.ts","../src/migrations/Migration20241128055359.ts","../src/migrations/Migration20241212190401.ts","../src/models/index.ts","../src/models/price-list-rule.ts","../src/models/price-list.ts","../src/models/price-preference.ts","../src/models/price-rule.ts","../src/models/price-set.ts","../src/models/price.ts","../src/repositories/index.ts","../src/repositories/pricing.ts","../src/schema/index.ts","../src/services/index.ts","../src/services/pricing-module.ts","../src/services/__tests__/index.spec.ts","../src/types/index.ts","../src/types/services/index.ts","../src/utils/events.ts","../src/utils/index.ts","../src/utils/validate-price-list-dates.ts"],"version":"5.6.2"}
|
1
|
+
{"root":["../src/index.ts","../src/joiner-config.ts","../src/migrations/Migration20230929122253.ts","../src/migrations/Migration20240322094407.ts","../src/migrations/Migration20240322113359.ts","../src/migrations/Migration20240322120125.ts","../src/migrations/Migration20240626133555.ts","../src/migrations/Migration20240704094505.ts","../src/migrations/Migration20241127114534.ts","../src/migrations/Migration20241127223829.ts","../src/migrations/Migration20241128055359.ts","../src/migrations/Migration20241212190401.ts","../src/migrations/Migration20250408145122.ts","../src/models/index.ts","../src/models/price-list-rule.ts","../src/models/price-list.ts","../src/models/price-preference.ts","../src/models/price-rule.ts","../src/models/price-set.ts","../src/models/price.ts","../src/repositories/index.ts","../src/repositories/pricing.ts","../src/schema/index.ts","../src/services/index.ts","../src/services/pricing-module.ts","../src/services/__tests__/index.spec.ts","../src/types/index.ts","../src/types/services/index.ts","../src/utils/events.ts","../src/utils/index.ts","../src/utils/validate-price-list-dates.ts"],"version":"5.6.2"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/pricing",
|
3
|
-
"version": "3.0.0-snapshot-
|
3
|
+
"version": "3.0.0-snapshot-20250409083720",
|
4
4
|
"description": "Medusa Pricing module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -36,8 +36,8 @@
|
|
36
36
|
"orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
40
|
-
"@medusajs/test-utils": "3.0.0-snapshot-
|
39
|
+
"@medusajs/framework": "3.0.0-snapshot-20250409083720",
|
40
|
+
"@medusajs/test-utils": "3.0.0-snapshot-20250409083720",
|
41
41
|
"@mikro-orm/cli": "6.4.3",
|
42
42
|
"@mikro-orm/core": "6.4.3",
|
43
43
|
"@mikro-orm/migrations": "6.4.3",
|
@@ -50,7 +50,7 @@
|
|
50
50
|
"typescript": "^5.6.2"
|
51
51
|
},
|
52
52
|
"peerDependencies": {
|
53
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
53
|
+
"@medusajs/framework": "3.0.0-snapshot-20250409083720",
|
54
54
|
"@mikro-orm/core": "6.4.3",
|
55
55
|
"@mikro-orm/migrations": "6.4.3",
|
56
56
|
"@mikro-orm/postgresql": "6.4.3",
|