@medusajs/pricing 3.0.0-snapshot-20250409125618 → 3.0.0-snapshot-20250410061231
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/models/price-rule.d.ts.map +1 -1
- package/dist/models/price-rule.js +0 -4
- 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 +22 -31
- package/dist/repositories/pricing.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/migrations/Migration20250409122219.d.ts +0 -6
- package/dist/migrations/Migration20250409122219.d.ts.map +0 -1
- package/dist/migrations/Migration20250409122219.js +0 -14
- package/dist/migrations/Migration20250409122219.js.map +0 -1
@@ -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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"price-rule.js","sourceRoot":"","sources":["../../src/models/price-rule.ts"],"names":[],"mappings":";;;;;AAAA,qDAAsE;AACtE,oDAA2B;AAE3B,MAAM,SAAS,GAAG,aAAK;KACpB,MAAM,CAAC,WAAW,EAAE;IACnB,EAAE,EAAE,aAAK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C,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,
|
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"}
|
@@ -23,41 +23,18 @@ class PricingRepository extends utils_1.MikroOrmBase {
|
|
23
23
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Method calculatePrices requires currency_code in the pricing context`);
|
24
24
|
}
|
25
25
|
// Generate flatten key-value pairs for rule matching
|
26
|
+
const [ruleAttributes, priceListRuleAttributes] = await this.getAttributesFromRuleTables(knex);
|
27
|
+
const allowedRuleAttributes = [
|
28
|
+
...ruleAttributes,
|
29
|
+
...priceListRuleAttributes,
|
30
|
+
];
|
26
31
|
const flattenedKeyValuePairs = (0, utils_1.flattenObjectToKeyValuePairs)(context);
|
27
|
-
|
28
|
-
const candidateContext = Object.entries(flattenedKeyValuePairs).filter(([, value]) => {
|
32
|
+
const flattenedContext = Object.entries(flattenedKeyValuePairs).filter(([key, value]) => {
|
29
33
|
const isValuePresent = !Array.isArray(value) && (0, utils_1.isPresent)(value);
|
30
34
|
const isArrayPresent = Array.isArray(value) && value.flat(1).length;
|
31
|
-
return
|
35
|
+
return (allowedRuleAttributes.includes(key) &&
|
36
|
+
(isValuePresent || isArrayPresent));
|
32
37
|
});
|
33
|
-
// If we have potential context keys, efficiently check which ones exist in rules
|
34
|
-
const flattenedContext = candidateContext;
|
35
|
-
// if (candidateContext.length > 0) {
|
36
|
-
// const contextKeys = candidateContext.map(([key]) => key)
|
37
|
-
// // Efficient query to check if keys exist in either rule table
|
38
|
-
// // This avoids fetching ALL rule attributes - only checks our specific keys
|
39
|
-
// const existingKeys = await knex
|
40
|
-
// .raw(
|
41
|
-
// `
|
42
|
-
// SELECT DISTINCT attribute
|
43
|
-
// FROM (
|
44
|
-
// SELECT attribute FROM price_rule WHERE attribute IN (${contextKeys
|
45
|
-
// .map(() => "?")
|
46
|
-
// .join(",")})
|
47
|
-
// UNION
|
48
|
-
// SELECT attribute FROM price_list_rule WHERE attribute IN (${contextKeys
|
49
|
-
// .map(() => "?")
|
50
|
-
// .join(",")})
|
51
|
-
// ) AS combined_attributes
|
52
|
-
// `,
|
53
|
-
// [...contextKeys, ...contextKeys]
|
54
|
-
// )
|
55
|
-
// .then((result) => result.rows.map((row) => row.attribute))
|
56
|
-
// // Filter context to only include keys that exist in rules
|
57
|
-
// flattenedContext = candidateContext.filter(([key]) =>
|
58
|
-
// existingKeys.includes(key)
|
59
|
-
// )
|
60
|
-
// }
|
61
38
|
const hasComplexContext = flattenedContext.length > 0;
|
62
39
|
// Base query with efficient index lookups
|
63
40
|
const query = knex
|
@@ -216,6 +193,20 @@ class PricingRepository extends utils_1.MikroOrmBase {
|
|
216
193
|
// Execute the optimized query
|
217
194
|
return await query;
|
218
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
|
+
]);
|
209
|
+
}
|
219
210
|
}
|
220
211
|
exports.PricingRepository = PricingRepository;
|
221
212
|
//# sourceMappingURL=pricing.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/repositories/pricing.ts"],"names":[],"mappings":";;;AAAA,
|
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,iB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C;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/migrations/Migration20250408145122.ts","../src/
|
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-20250410061231",
|
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-20250410061231",
|
40
|
+
"@medusajs/test-utils": "3.0.0-snapshot-20250410061231",
|
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-20250410061231",
|
54
54
|
"@mikro-orm/core": "6.4.3",
|
55
55
|
"@mikro-orm/migrations": "6.4.3",
|
56
56
|
"@mikro-orm/postgresql": "6.4.3",
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Migration20250409122219.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250409122219.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAIrC"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Migration20250409122219 = void 0;
|
4
|
-
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
-
class Migration20250409122219 extends migrations_1.Migration {
|
6
|
-
async up() {
|
7
|
-
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_price_rule_attribute" ON "price_rule" (attribute) WHERE deleted_at IS NULL;`);
|
8
|
-
}
|
9
|
-
async down() {
|
10
|
-
this.addSql(`drop index if exists "IDX_price_rule_attribute";`);
|
11
|
-
}
|
12
|
-
}
|
13
|
-
exports.Migration20250409122219 = Migration20250409122219;
|
14
|
-
//# sourceMappingURL=Migration20250409122219.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Migration20250409122219.js","sourceRoot":"","sources":["../../src/migrations/Migration20250409122219.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAElD,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,6GAA6G,CAAC,CAAC;IAC7H,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,kDAAkD,CAAC,CAAC;IAClE,CAAC;CAEF;AAVD,0DAUC"}
|