@medusajs/pricing 0.1.13-snapshot-20240718083016 → 0.1.13-snapshot-20240719080828

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +5 -9
  4. package/dist/joiner-config.d.ts +2 -10
  5. package/dist/joiner-config.d.ts.map +1 -0
  6. package/dist/joiner-config.js +4 -52
  7. package/dist/migrations/Migration20230929122253.d.ts +1 -0
  8. package/dist/migrations/Migration20230929122253.d.ts.map +1 -0
  9. package/dist/migrations/Migration20240322094407.d.ts +1 -0
  10. package/dist/migrations/Migration20240322094407.d.ts.map +1 -0
  11. package/dist/migrations/Migration20240322113359.d.ts +1 -0
  12. package/dist/migrations/Migration20240322113359.d.ts.map +1 -0
  13. package/dist/migrations/Migration20240322120125.d.ts +1 -0
  14. package/dist/migrations/Migration20240322120125.d.ts.map +1 -0
  15. package/dist/migrations/Migration20240626133555.d.ts +5 -0
  16. package/dist/migrations/Migration20240626133555.d.ts.map +1 -0
  17. package/dist/migrations/Migration20240626133555.js +33 -0
  18. package/dist/migrations/Migration20240704094505.d.ts +6 -0
  19. package/dist/migrations/Migration20240704094505.d.ts.map +1 -0
  20. package/dist/migrations/Migration20240704094505.js +15 -0
  21. package/dist/models/index.d.ts +2 -3
  22. package/dist/models/index.d.ts.map +1 -0
  23. package/dist/models/index.js +3 -7
  24. package/dist/models/price-list-rule.d.ts +6 -8
  25. package/dist/models/price-list-rule.d.ts.map +1 -0
  26. package/dist/models/price-list-rule.js +8 -29
  27. package/dist/models/price-list.d.ts +2 -3
  28. package/dist/models/price-list.d.ts.map +1 -0
  29. package/dist/models/price-list.js +0 -9
  30. package/dist/models/price-preference.d.ts +13 -0
  31. package/dist/models/price-preference.d.ts.map +1 -0
  32. package/dist/models/{rule-type.js → price-preference.js} +35 -40
  33. package/dist/models/price-rule.d.ts +5 -9
  34. package/dist/models/price-rule.d.ts.map +1 -0
  35. package/dist/models/price-rule.js +6 -45
  36. package/dist/models/price-set.d.ts +1 -4
  37. package/dist/models/price-set.d.ts.map +1 -0
  38. package/dist/models/price-set.js +0 -19
  39. package/dist/models/price.d.ts +5 -4
  40. package/dist/models/price.d.ts.map +1 -0
  41. package/dist/models/price.js +5 -5
  42. package/dist/repositories/index.d.ts +1 -0
  43. package/dist/repositories/index.d.ts.map +1 -0
  44. package/dist/repositories/pricing.d.ts +1 -0
  45. package/dist/repositories/pricing.d.ts.map +1 -0
  46. package/dist/repositories/pricing.js +29 -36
  47. package/dist/schema/index.d.ts +1 -0
  48. package/dist/schema/index.d.ts.map +1 -0
  49. package/dist/services/index.d.ts +1 -2
  50. package/dist/services/index.d.ts.map +1 -0
  51. package/dist/services/index.js +1 -5
  52. package/dist/services/pricing-module.d.ts +66 -53
  53. package/dist/services/pricing-module.d.ts.map +1 -0
  54. package/dist/services/pricing-module.js +594 -605
  55. package/dist/types/index.d.ts +1 -0
  56. package/dist/types/index.d.ts.map +1 -0
  57. package/dist/types/services/index.d.ts +30 -2
  58. package/dist/types/services/index.d.ts.map +1 -0
  59. package/dist/types/services/index.js +0 -16
  60. package/dist/utils/events.d.ts +63 -0
  61. package/dist/utils/events.d.ts.map +1 -0
  62. package/dist/utils/events.js +66 -0
  63. package/dist/utils/index.d.ts +2 -0
  64. package/dist/utils/index.d.ts.map +1 -0
  65. package/dist/utils/index.js +1 -0
  66. package/dist/utils/validate-price-list-dates.d.ts +1 -0
  67. package/dist/utils/validate-price-list-dates.d.ts.map +1 -0
  68. package/package.json +8 -13
  69. package/dist/initialize/index.d.ts +0 -4
  70. package/dist/initialize/index.js +0 -17
  71. package/dist/loaders/connection.d.ts +0 -4
  72. package/dist/loaders/connection.js +0 -40
  73. package/dist/loaders/container.d.ts +0 -2
  74. package/dist/loaders/container.js +0 -34
  75. package/dist/loaders/index.d.ts +0 -2
  76. package/dist/loaders/index.js +0 -18
  77. package/dist/models/price-list-rule-value.d.ts +0 -17
  78. package/dist/models/price-list-rule-value.js +0 -102
  79. package/dist/models/price-set-rule-type.d.ts +0 -10
  80. package/dist/models/price-set-rule-type.js +0 -108
  81. package/dist/models/rule-type.d.ts +0 -17
  82. package/dist/module-definition.d.ts +0 -4
  83. package/dist/module-definition.js +0 -50
  84. package/dist/scripts/bin/run-seed.d.ts +0 -3
  85. package/dist/scripts/bin/run-seed.js +0 -38
  86. package/dist/scripts/seed.d.ts +0 -4
  87. package/dist/scripts/seed.js +0 -67
  88. package/dist/services/price-list.d.ts +0 -16
  89. package/dist/services/price-list.js +0 -34
  90. package/dist/services/rule-type.d.ts +0 -15
  91. package/dist/services/rule-type.js +0 -53
  92. package/dist/types/services/price-list.d.ts +0 -18
  93. package/dist/types/services/price-list.js +0 -2
  94. package/dist/types/services/price-set.d.ts +0 -4
  95. package/dist/types/services/price-set.js +0 -2
@@ -15,27 +15,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const utils_1 = require("@medusajs/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
17
  const price_1 = __importDefault(require("./price"));
18
- const price_set_1 = __importDefault(require("./price-set"));
19
- const rule_type_1 = __importDefault(require("./rule-type"));
20
18
  const tableName = "price_rule";
21
19
  const PriceRuleDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
22
20
  tableName: tableName,
23
21
  columns: "deleted_at",
24
22
  where: "deleted_at IS NOT NULL",
25
23
  });
26
- const PriceRulePriceSetIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
27
- tableName: tableName,
28
- columns: "price_set_id",
29
- where: "deleted_at IS NULL",
30
- });
31
- const PriceRuleRuleTypeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
32
- tableName: tableName,
33
- columns: "rule_type_id",
34
- where: "deleted_at IS NULL",
35
- });
36
24
  const PriceRulePriceIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
37
25
  tableName: tableName,
38
- columns: ["price_id", "rule_type_id"],
26
+ columns: ["price_id", "attribute"],
39
27
  where: "deleted_at IS NULL",
40
28
  unique: true,
41
29
  });
@@ -46,15 +34,11 @@ let PriceRule = class PriceRule {
46
34
  }
47
35
  beforeCreate() {
48
36
  this.id = (0, utils_1.generateEntityId)(this.id, "prule");
49
- this.rule_type_id ?? (this.rule_type_id = this.rule_type?.id);
50
- this.price_set_id ?? (this.price_set_id = this.price_set?.id);
51
- this.price_id ?? (this.price_id = this.price?.id);
37
+ this.price_id ??= this.price?.id;
52
38
  }
53
39
  onInit() {
54
40
  this.id = (0, utils_1.generateEntityId)(this.id, "prule");
55
- this.rule_type_id ?? (this.rule_type_id = this.rule_type?.id);
56
- this.price_set_id ?? (this.price_set_id = this.price_set?.id);
57
- this.price_id ?? (this.price_id = this.price?.id);
41
+ this.price_id ??= this.price?.id;
58
42
  }
59
43
  };
60
44
  __decorate([
@@ -62,32 +46,9 @@ __decorate([
62
46
  __metadata("design:type", String)
63
47
  ], PriceRule.prototype, "id", void 0);
64
48
  __decorate([
65
- PriceRulePriceSetIdIndex.MikroORMIndex(),
66
- (0, core_1.ManyToOne)(() => price_set_1.default, {
67
- columnType: "text",
68
- mapToPk: true,
69
- fieldName: "price_set_id",
70
- onDelete: "cascade",
71
- }),
72
- __metadata("design:type", String)
73
- ], PriceRule.prototype, "price_set_id", void 0);
74
- __decorate([
75
- (0, core_1.ManyToOne)(() => price_set_1.default, { persist: false }),
76
- __metadata("design:type", price_set_1.default)
77
- ], PriceRule.prototype, "price_set", void 0);
78
- __decorate([
79
- PriceRuleRuleTypeIdIndex.MikroORMIndex(),
80
- (0, core_1.ManyToOne)(() => rule_type_1.default, {
81
- columnType: "text",
82
- mapToPk: true,
83
- fieldName: "rule_type_id",
84
- }),
49
+ (0, core_1.Property)({ columnType: "text" }),
85
50
  __metadata("design:type", String)
86
- ], PriceRule.prototype, "rule_type_id", void 0);
87
- __decorate([
88
- (0, core_1.ManyToOne)(() => rule_type_1.default, { persist: false }),
89
- __metadata("design:type", rule_type_1.default)
90
- ], PriceRule.prototype, "rule_type", void 0);
51
+ ], PriceRule.prototype, "attribute", void 0);
91
52
  __decorate([
92
53
  (0, core_1.Property)({ columnType: "text" }),
93
54
  __metadata("design:type", String)
@@ -108,7 +69,7 @@ __decorate([
108
69
  ], PriceRule.prototype, "price_id", void 0);
109
70
  __decorate([
110
71
  (0, core_1.ManyToOne)(() => price_1.default, { persist: false }),
111
- __metadata("design:type", price_1.default)
72
+ __metadata("design:type", Object)
112
73
  ], PriceRule.prototype, "price", void 0);
113
74
  __decorate([
114
75
  (0, core_1.Property)({
@@ -1,16 +1,13 @@
1
1
  import { Collection } from "@mikro-orm/core";
2
2
  import Price from "./price";
3
- import PriceRule from "./price-rule";
4
- import RuleType from "./rule-type";
5
3
  export declare const PriceSetIdPrefix = "pset";
6
4
  export default class PriceSet {
7
5
  id: string;
8
6
  prices: Collection<Price, object>;
9
- price_rules: Collection<PriceRule, object>;
10
- rule_types: Collection<RuleType, object>;
11
7
  created_at: Date;
12
8
  updated_at: Date;
13
9
  deleted_at: Date | null;
14
10
  onCreate(): void;
15
11
  onInit(): void;
16
12
  }
13
+ //# sourceMappingURL=price-set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price-set.d.ts","sourceRoot":"","sources":["../../src/models/price-set.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,UAAU,EAQX,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,MAAM,SAAS,CAAA;AAS3B,eAAO,MAAM,gBAAgB,SAAS,CAAA;AAItC,MAAM,CAAC,OAAO,OAAO,QAAQ;IAE3B,EAAE,EAAG,MAAM,CAAA;IAKX,MAAM,4BAAmC;IAOzC,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAKR,MAAM;CAGP"}
@@ -16,9 +16,6 @@ exports.PriceSetIdPrefix = void 0;
16
16
  const utils_1 = require("@medusajs/utils");
17
17
  const core_1 = require("@mikro-orm/core");
18
18
  const price_1 = __importDefault(require("./price"));
19
- const price_rule_1 = __importDefault(require("./price-rule"));
20
- const price_set_rule_type_1 = __importDefault(require("./price-set-rule-type"));
21
- const rule_type_1 = __importDefault(require("./rule-type"));
22
19
  const tableName = "price_set";
23
20
  const PriceSetDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
24
21
  tableName: tableName,
@@ -29,8 +26,6 @@ exports.PriceSetIdPrefix = "pset";
29
26
  let PriceSet = class PriceSet {
30
27
  constructor() {
31
28
  this.prices = new core_1.Collection(this);
32
- this.price_rules = new core_1.Collection(this);
33
- this.rule_types = new core_1.Collection(this);
34
29
  this.deleted_at = null;
35
30
  }
36
31
  onCreate() {
@@ -50,20 +45,6 @@ __decorate([
50
45
  }),
51
46
  __metadata("design:type", Object)
52
47
  ], PriceSet.prototype, "prices", void 0);
53
- __decorate([
54
- (0, core_1.OneToMany)(() => price_rule_1.default, (pr) => pr.price_set, {
55
- cascade: [core_1.Cascade.PERSIST, "soft-remove"],
56
- }),
57
- __metadata("design:type", Object)
58
- ], PriceSet.prototype, "price_rules", void 0);
59
- __decorate([
60
- (0, core_1.ManyToMany)({
61
- entity: () => rule_type_1.default,
62
- pivotEntity: () => price_set_rule_type_1.default,
63
- cascade: ["soft-remove"],
64
- }),
65
- __metadata("design:type", Object)
66
- ], PriceSet.prototype, "rule_types", void 0);
67
48
  __decorate([
68
49
  (0, core_1.Property)({
69
50
  onCreate: () => new Date(),
@@ -1,10 +1,10 @@
1
1
  import { DAL } from "@medusajs/types";
2
2
  import { BigNumber } from "@medusajs/utils";
3
- import { Collection, OptionalProps } from "@mikro-orm/core";
3
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
4
4
  import PriceList from "./price-list";
5
5
  import PriceRule from "./price-rule";
6
6
  import PriceSet from "./price-set";
7
- type OptionalFields = DAL.SoftDeletableEntityDateColumns;
7
+ type OptionalFields = DAL.SoftDeletableModelDateColumns;
8
8
  export default class Price {
9
9
  [OptionalProps]?: OptionalFields;
10
10
  id: string;
@@ -15,11 +15,11 @@ export default class Price {
15
15
  min_quantity: number | null;
16
16
  max_quantity: number | null;
17
17
  price_set_id: string;
18
- price_set?: PriceSet;
18
+ price_set?: Rel<PriceSet>;
19
19
  rules_count: number;
20
20
  price_rules: Collection<PriceRule, object>;
21
21
  price_list_id: string | null;
22
- price_list: PriceList | null;
22
+ price_list: Rel<PriceList> | null;
23
23
  created_at: Date;
24
24
  updated_at: Date;
25
25
  deleted_at: Date | null;
@@ -27,3 +27,4 @@ export default class Price {
27
27
  onInit(): void;
28
28
  }
29
29
  export {};
30
+ //# sourceMappingURL=price.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../src/models/price.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EACL,SAAS,EAKV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,UAAU,EAMV,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,QAAQ,MAAM,aAAa,CAAA;AAElC,KAAK,cAAc,GAAG,GAAG,CAAC,6BAA6B,CAAA;AA6BvD,MAAM,CAAC,OAAO,OAAO,KAAK;IACxB,CAAC,aAAa,CAAC,CAAC,EAAE,cAAc,CAAA;IAGhC,EAAE,EAAG,MAAM,CAAA;IAGX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAO;IAI3B,aAAa,EAAE,MAAM,CAAA;IAGrB,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;IAG1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAGnC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAO;IAGlC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAO;IASlC,YAAY,EAAE,MAAM,CAAA;IAGpB,SAAS,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IAGzB,WAAW,EAAE,MAAM,CAAI;IAOvB,WAAW,gCAAuC;IAUlD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAO;IAGnC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI,CAAO;IAOxC,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAOR,MAAM;CAKP"}
@@ -51,13 +51,13 @@ let Price = class Price {
51
51
  }
52
52
  onCreate() {
53
53
  this.id = (0, utils_1.generateEntityId)(this.id, "price");
54
- this.price_set_id ?? (this.price_set_id = this.price_set?.id);
55
- this.price_list_id ?? (this.price_list_id = this.price_list?.id);
54
+ this.price_set_id ??= this.price_set?.id;
55
+ this.price_list_id ??= this.price_list?.id;
56
56
  }
57
57
  onInit() {
58
58
  this.id = (0, utils_1.generateEntityId)(this.id, "price");
59
- this.price_set_id ?? (this.price_set_id = this.price_set?.id);
60
- this.price_list_id ?? (this.price_list_id = this.price_list?.id);
59
+ this.price_set_id ??= this.price_set?.id;
60
+ this.price_list_id ??= this.price_list?.id;
61
61
  }
62
62
  };
63
63
  __decorate([
@@ -101,7 +101,7 @@ __decorate([
101
101
  ], Price.prototype, "price_set_id", void 0);
102
102
  __decorate([
103
103
  (0, core_1.ManyToOne)(() => price_set_1.default, { persist: false }),
104
- __metadata("design:type", price_set_1.default)
104
+ __metadata("design:type", Object)
105
105
  ], Price.prototype, "price_set", void 0);
106
106
  __decorate([
107
107
  (0, core_1.Property)({ columnType: "integer", default: 0 }),
@@ -1,2 +1,3 @@
1
1
  export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils";
2
2
  export { PricingRepository } from "./pricing";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA"}
@@ -4,3 +4,4 @@ export declare class PricingRepository extends MikroOrmBase implements PricingRe
4
4
  constructor();
5
5
  calculatePrices(pricingFilters: PricingFilters, pricingContext?: PricingContext, sharedContext?: Context): Promise<CalculatedPriceSetDTO[]>;
6
6
  }
7
+ //# sourceMappingURL=pricing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../src/repositories/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAmB,MAAM,iBAAiB,CAAA;AAE5E,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,cAAc,EACd,wBAAwB,EACzB,MAAM,iBAAiB,CAAA;AAGxB,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;CAqKpC"}
@@ -37,44 +37,39 @@ class PricingRepository extends utils_1.MikroOrmBase {
37
37
  price: "price",
38
38
  })
39
39
  .select({
40
- id: "price1.id",
41
- amount: "price1.amount",
42
- min_quantity: "price1.min_quantity",
43
- max_quantity: "price1.max_quantity",
44
- currency_code: "price1.currency_code",
45
- price_set_id: "price1.price_set_id",
46
- rules_count: "price1.rules_count",
47
- price_list_id: "price1.price_list_id",
40
+ id: "price.id",
41
+ amount: "price.amount",
42
+ raw_amount: "price.raw_amount",
43
+ min_quantity: "price.min_quantity",
44
+ max_quantity: "price.max_quantity",
45
+ currency_code: "price.currency_code",
46
+ price_set_id: "price.price_set_id",
47
+ rules_count: "price.rules_count",
48
+ price_list_id: "price.price_list_id",
48
49
  pl_rules_count: "pl.rules_count",
49
50
  pl_type: "pl.type",
50
- has_price_list: knex.raw("case when price1.price_list_id IS NULL then False else True end"),
51
+ has_price_list: knex.raw("case when price.price_list_id IS NULL then False else True end"),
52
+ })
53
+ .leftJoin("price_rule as pr", "pr.price_id", "price.id")
54
+ .leftJoin("price_list as pl", function () {
55
+ this.on("pl.id", "price.price_list_id").andOn("pl.status", knex.raw("?", [utils_1.PriceListStatus.ACTIVE]));
51
56
  })
52
- .leftJoin("price as price1", "price1.id", "price1.id")
53
- .leftJoin("price_rule as pr", "pr.price_id", "price1.id")
54
- .leftJoin("price_list as pl", "pl.id", "price1.price_list_id")
55
57
  .leftJoin("price_list_rule as plr", "plr.price_list_id", "pl.id")
56
- .leftJoin("price_list_rule_value as plrv", "plrv.price_list_rule_id", "plr.id")
57
- .leftJoin("rule_type as plrt", "plrt.id", "plr.rule_type_id")
58
- .leftJoin("rule_type as rt", "rt.id", "pr.rule_type_id")
59
- .orderBy([
60
- { column: "rules_count", order: "desc" },
61
- { column: "pl.rules_count", order: "desc" },
62
- ])
63
- .groupBy("price1.id", "pl.id")
64
- .having(knex.raw("count(DISTINCT rt.rule_attribute) = price1.rules_count AND price1.price_list_id IS NULL"))
65
- .orHaving(knex.raw("count(DISTINCT plrt.rule_attribute) = pl.rules_count AND price1.price_list_id IS NOT NULL"));
58
+ .groupBy("price.id", "pl.id")
59
+ .having(knex.raw("count(DISTINCT pr.attribute) = price.rules_count AND price.price_list_id IS NULL"))
60
+ .orHaving(knex.raw("count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL"));
66
61
  priceSubQueryKnex.orWhere((q) => {
67
62
  for (const [key, value] of Object.entries(context)) {
68
63
  q.orWhere({
69
- "rt.rule_attribute": key,
64
+ "pr.attribute": key,
70
65
  "pr.value": value,
71
66
  });
72
67
  }
73
- q.orWhere("price1.rules_count", "=", 0);
74
- q.whereNull("price1.price_list_id");
68
+ q.orWhere("price.rules_count", "=", 0);
69
+ q.whereNull("price.price_list_id");
75
70
  });
76
71
  priceSubQueryKnex.orWhere((q) => {
77
- q.whereNotNull("price1.price_list_id")
72
+ q.whereNotNull("price.price_list_id")
78
73
  .andWhere(function () {
79
74
  this.whereNull("pl.starts_at").orWhere("pl.starts_at", "<=", date);
80
75
  })
@@ -85,9 +80,9 @@ class PricingRepository extends utils_1.MikroOrmBase {
85
80
  this.andWhere(function () {
86
81
  for (const [key, value] of Object.entries(context)) {
87
82
  this.orWhere({
88
- "plrt.rule_attribute": key,
83
+ "plr.attribute": key,
89
84
  });
90
- this.whereIn("plrv.value", [value]);
85
+ this.where("plr.value", "@>", JSON.stringify(Array.isArray(value) ? value : [value]));
91
86
  }
92
87
  this.orWhere("pl.rules_count", "=", 0);
93
88
  });
@@ -95,13 +90,13 @@ class PricingRepository extends utils_1.MikroOrmBase {
95
90
  this.andWhere(function () {
96
91
  for (const [key, value] of Object.entries(context)) {
97
92
  this.orWhere({
98
- "rt.rule_attribute": key,
93
+ "pr.attribute": key,
99
94
  "pr.value": value,
100
95
  });
101
96
  }
102
- this.andWhere("price1.rules_count", ">", 0);
97
+ this.andWhere("price.rules_count", ">", 0);
103
98
  });
104
- this.orWhere("price1.rules_count", "=", 0);
99
+ this.orWhere("price.rules_count", "=", 0);
105
100
  });
106
101
  });
107
102
  });
@@ -112,25 +107,23 @@ class PricingRepository extends utils_1.MikroOrmBase {
112
107
  id: "price.id",
113
108
  price_set_id: "ps.id",
114
109
  amount: "price.amount",
110
+ raw_amount: "price.raw_amount",
115
111
  min_quantity: "price.min_quantity",
116
112
  max_quantity: "price.max_quantity",
117
113
  currency_code: "price.currency_code",
118
- default_priority: "rt.default_priority",
119
114
  rules_count: "price.rules_count",
120
115
  pl_rules_count: "price.pl_rules_count",
121
116
  price_list_type: "price.pl_type",
122
117
  price_list_id: "price.price_list_id",
118
+ all_rules_count: knex.raw("COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0)"),
123
119
  })
124
120
  .join(priceSubQueryKnex.as("price"), "price.price_set_id", "ps.id")
125
- .leftJoin("price_rule as pr", "pr.price_id", "price.id")
126
- .leftJoin("rule_type as rt", "rt.id", "pr.rule_type_id")
127
121
  .whereIn("ps.id", pricingFilters.id)
128
122
  .andWhere("price.currency_code", "=", currencyCode)
129
123
  .orderBy([
130
124
  { column: "price.has_price_list", order: "asc" },
125
+ { column: "all_rules_count", order: "desc" },
131
126
  { column: "amount", order: "asc" },
132
- { column: "rules_count", order: "desc" },
133
- { column: "default_priority", order: "desc" },
134
127
  ]);
135
128
  if (quantity) {
136
129
  priceSetQueryKnex.where("price.min_quantity", "<=", quantity);
@@ -1,2 +1,3 @@
1
1
  export declare const schema = "\ntype PriceSet {\n id: String!\n money_amounts: [MoneyAmount]\n}\n\ntype MoneyAmount {\n id: String!\n currency_code: String\n amount: Float\n min_quantity: Float\n max_quantity: Float\n}\n";
2
2
  export default schema;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,0MAalB,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1,3 +1,2 @@
1
- export { default as PriceListService } from "./price-list";
2
1
  export { default as PricingModuleService } from "./pricing-module";
3
- export { default as RuleTypeService } from "./rule-type";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -3,10 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.RuleTypeService = exports.PricingModuleService = exports.PriceListService = void 0;
7
- var price_list_1 = require("./price-list");
8
- Object.defineProperty(exports, "PriceListService", { enumerable: true, get: function () { return __importDefault(price_list_1).default; } });
6
+ exports.PricingModuleService = void 0;
9
7
  var pricing_module_1 = require("./pricing-module");
10
8
  Object.defineProperty(exports, "PricingModuleService", { enumerable: true, get: function () { return __importDefault(pricing_module_1).default; } });
11
- var rule_type_1 = require("./rule-type");
12
- Object.defineProperty(exports, "RuleTypeService", { enumerable: true, get: function () { return __importDefault(rule_type_1).default; } });
@@ -1,21 +1,21 @@
1
- import { AddPricesDTO, Context, CreatePriceRuleDTO, DAL, FindConfig, InternalModuleDeclaration, ModuleJoinerConfig, ModulesSdkTypes, PriceSetDTO, PricingContext, PricingFilters, PricingRepositoryService, PricingTypes, RuleTypeDTO, UpsertPriceSetDTO } from "@medusajs/types";
2
- import { ModulesSdkUtils } from "@medusajs/utils";
3
- import { Price, PriceList, PriceListRule, PriceListRuleValue, PriceRule, PriceSet, PriceSetRuleType, RuleType } from "../models";
4
- import { PriceListService, RuleTypeService } from ".";
5
- import { UpdatePriceSetInput } from "src/types/services";
1
+ import { AddPricesDTO, Context, CreatePriceRuleDTO, DAL, FindConfig, InternalModuleDeclaration, ModuleJoinerConfig, ModulesSdkTypes, PricePreferenceDTO, PriceSetDTO, PricingContext, PricingFilters, PricingRepositoryService, PricingTypes, UpsertPricePreferenceDTO, UpsertPriceSetDTO } from "@medusajs/types";
2
+ import { Price, PriceList, PriceListRule, PricePreference, PriceRule, PriceSet } from "../models";
3
+ import { ServiceTypes } from "../types";
4
+ import { CreatePriceListDTO } from "src/types/services";
6
5
  type InjectedDependencies = {
7
6
  baseRepository: DAL.RepositoryService;
8
7
  pricingRepository: PricingRepositoryService;
9
- priceSetService: ModulesSdkTypes.InternalModuleService<any>;
10
- ruleTypeService: RuleTypeService<any>;
11
- priceRuleService: ModulesSdkTypes.InternalModuleService<any>;
12
- priceSetRuleTypeService: ModulesSdkTypes.InternalModuleService<any>;
13
- priceService: ModulesSdkTypes.InternalModuleService<any>;
14
- priceListService: PriceListService<any>;
15
- priceListRuleService: ModulesSdkTypes.InternalModuleService<any>;
16
- priceListRuleValueService: ModulesSdkTypes.InternalModuleService<any>;
8
+ priceSetService: ModulesSdkTypes.IMedusaInternalService<any>;
9
+ priceRuleService: ModulesSdkTypes.IMedusaInternalService<any>;
10
+ priceService: ModulesSdkTypes.IMedusaInternalService<any>;
11
+ priceListService: ModulesSdkTypes.IMedusaInternalService<any>;
12
+ pricePreferenceService: ModulesSdkTypes.IMedusaInternalService<any>;
13
+ priceListRuleService: ModulesSdkTypes.IMedusaInternalService<any>;
17
14
  };
18
- declare const PricingModuleService_base: new (container: InjectedDependencies) => ModulesSdkUtils.AbstractModuleService<InjectedDependencies, PriceSetDTO, {
15
+ declare const PricingModuleService_base: import("@medusajs/utils/dist/modules-sdk/types/medusa-service").MedusaServiceReturnType<{
16
+ PriceSet: {
17
+ dto: PricingTypes.PriceSetDTO;
18
+ };
19
19
  Price: {
20
20
  dto: PricingTypes.PriceDTO;
21
21
  };
@@ -24,68 +24,81 @@ declare const PricingModuleService_base: new (container: InjectedDependencies) =
24
24
  create: PricingTypes.CreatePriceRuleDTO;
25
25
  update: PricingTypes.UpdatePriceRuleDTO;
26
26
  };
27
- RuleType: {
28
- dto: PricingTypes.RuleTypeDTO;
29
- create: PricingTypes.CreateRuleTypeDTO;
30
- update: PricingTypes.UpdateRuleTypeDTO;
31
- };
32
27
  PriceList: {
33
28
  dto: PricingTypes.PriceListDTO;
34
29
  };
35
30
  PriceListRule: {
36
31
  dto: PricingTypes.PriceListRuleDTO;
37
32
  };
33
+ PricePreference: {
34
+ dto: any;
35
+ };
38
36
  }>;
39
- export default class PricingModuleService<TPriceSet extends PriceSet = PriceSet, TRuleType extends RuleType = RuleType, TPriceRule extends PriceRule = PriceRule, TPriceSetRuleType extends PriceSetRuleType = PriceSetRuleType, TPrice extends Price = Price, TPriceList extends PriceList = PriceList, TPriceListRule extends PriceListRule = PriceListRule, TPriceListRuleValue extends PriceListRuleValue = PriceListRuleValue> extends PricingModuleService_base implements PricingTypes.IPricingModuleService {
37
+ export default class PricingModuleService extends PricingModuleService_base implements PricingTypes.IPricingModuleService {
40
38
  protected readonly moduleDeclaration: InternalModuleDeclaration;
41
39
  protected baseRepository_: DAL.RepositoryService;
42
40
  protected readonly pricingRepository_: PricingRepositoryService;
43
- protected readonly ruleTypeService_: RuleTypeService<TRuleType>;
44
- protected readonly priceSetService_: ModulesSdkTypes.InternalModuleService<TPriceSet>;
45
- protected readonly priceRuleService_: ModulesSdkTypes.InternalModuleService<TPriceRule>;
46
- protected readonly priceSetRuleTypeService_: ModulesSdkTypes.InternalModuleService<TPriceSetRuleType>;
47
- protected readonly priceService_: ModulesSdkTypes.InternalModuleService<TPrice>;
48
- protected readonly priceListService_: PriceListService<TPriceList>;
49
- protected readonly priceListRuleService_: ModulesSdkTypes.InternalModuleService<TPriceListRule>;
50
- protected readonly priceListRuleValueService_: ModulesSdkTypes.InternalModuleService<TPriceListRuleValue>;
51
- constructor({ baseRepository, pricingRepository, ruleTypeService, priceSetService, priceRuleService, priceSetRuleTypeService, priceService, priceListService, priceListRuleService, priceListRuleValueService, }: InjectedDependencies, moduleDeclaration: InternalModuleDeclaration);
41
+ protected readonly priceSetService_: ModulesSdkTypes.IMedusaInternalService<PriceSet>;
42
+ protected readonly priceRuleService_: ModulesSdkTypes.IMedusaInternalService<PriceRule>;
43
+ protected readonly priceService_: ModulesSdkTypes.IMedusaInternalService<Price>;
44
+ protected readonly priceListService_: ModulesSdkTypes.IMedusaInternalService<PriceList>;
45
+ protected readonly priceListRuleService_: ModulesSdkTypes.IMedusaInternalService<PriceListRule>;
46
+ protected readonly pricePreferenceService_: ModulesSdkTypes.IMedusaInternalService<PricePreference>;
47
+ constructor({ baseRepository, pricingRepository, priceSetService, priceRuleService, priceService, pricePreferenceService, priceListService, priceListRuleService, }: InjectedDependencies, moduleDeclaration: InternalModuleDeclaration);
52
48
  __joinerConfig(): ModuleJoinerConfig;
53
49
  private setupCalculatedPriceConfig_;
54
- list(filters?: PricingTypes.FilterablePriceSetProps, config?: FindConfig<PricingTypes.PriceSetDTO>, sharedContext?: Context): Promise<PriceSetDTO[]>;
55
- listAndCount(filters?: PricingTypes.FilterablePriceSetProps, config?: FindConfig<PricingTypes.PriceSetDTO>, sharedContext?: Context): Promise<[PriceSetDTO[], number]>;
50
+ retrievePriceSet(id: string, config?: FindConfig<PriceSetDTO> | undefined, sharedContext?: Context | undefined): Promise<PriceSetDTO>;
51
+ listPriceSets(filters?: PricingTypes.FilterablePriceSetProps, config?: FindConfig<PricingTypes.PriceSetDTO>, sharedContext?: Context): Promise<PriceSetDTO[]>;
52
+ listAndCountPriceSets(filters?: PricingTypes.FilterablePriceSetProps, config?: FindConfig<PricingTypes.PriceSetDTO>, sharedContext?: Context): Promise<[PriceSetDTO[], number]>;
56
53
  calculatePrices(pricingFilters: PricingFilters, pricingContext?: PricingContext, sharedContext?: Context): Promise<PricingTypes.CalculatedPriceSet[]>;
57
- create(data: PricingTypes.CreatePriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO>;
58
- create(data: PricingTypes.CreatePriceSetDTO[], sharedContext?: Context): Promise<PriceSetDTO[]>;
59
- upsert(data: UpsertPriceSetDTO[], sharedContext?: Context): Promise<PriceSetDTO[]>;
60
- upsert(data: UpsertPriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO>;
61
- update(id: string, data: PricingTypes.UpdatePriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO>;
62
- update(selector: PricingTypes.FilterablePriceSetProps, data: PricingTypes.UpdatePriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO[]>;
54
+ createPriceSets(data: PricingTypes.CreatePriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO>;
55
+ createPriceSets(data: PricingTypes.CreatePriceSetDTO[], sharedContext?: Context): Promise<PriceSetDTO[]>;
56
+ upsertPriceSets(data: UpsertPriceSetDTO[], sharedContext?: Context): Promise<PriceSetDTO[]>;
57
+ upsertPriceSets(data: UpsertPriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO>;
58
+ updatePriceSets(id: string, data: PricingTypes.UpdatePriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO>;
59
+ updatePriceSets(selector: PricingTypes.FilterablePriceSetProps, data: PricingTypes.UpdatePriceSetDTO, sharedContext?: Context): Promise<PriceSetDTO[]>;
60
+ protected updatePriceSets_(data: ServiceTypes.UpdatePriceSetInput[], sharedContext?: Context): Promise<PriceSet[]>;
63
61
  private normalizeUpdateData;
64
- protected update_(data: UpdatePriceSetInput[], sharedContext?: Context): Promise<PriceSet[]>;
65
- addRules(data: PricingTypes.AddRulesDTO, sharedContext?: Context): Promise<PricingTypes.PriceSetDTO>;
66
- addRules(data: PricingTypes.AddRulesDTO[], sharedContext?: Context): Promise<PricingTypes.PriceSetDTO[]>;
62
+ private normalizePrices;
67
63
  addPrices(data: AddPricesDTO, sharedContext?: Context): Promise<PricingTypes.PriceSetDTO>;
68
64
  addPrices(data: AddPricesDTO[], sharedContext?: Context): Promise<PricingTypes.PriceSetDTO[]>;
69
- removeRules(data: PricingTypes.RemovePriceSetRulesDTO[], sharedContext?: Context): Promise<void>;
70
65
  createPriceLists(data: PricingTypes.CreatePriceListDTO[], sharedContext?: Context): Promise<PricingTypes.PriceListDTO[]>;
71
66
  updatePriceLists(data: PricingTypes.UpdatePriceListDTO[], sharedContext?: Context): Promise<PricingTypes.PriceListDTO[]>;
72
- createPriceListRules(data: PricingTypes.CreatePriceListRuleDTO[], sharedContext?: Context): Promise<PricingTypes.PriceListRuleDTO[]>;
73
- createPriceListRules_(data: PricingTypes.CreatePriceListRuleDTO[], sharedContext?: Context): Promise<TPriceListRule[]>;
74
- updatePriceListRules(data: PricingTypes.UpdatePriceListRuleDTO[], sharedContext?: Context): Promise<PricingTypes.PriceListRuleDTO[]>;
75
67
  updatePriceListPrices(data: PricingTypes.UpdatePriceListPricesDTO[], sharedContext?: Context): Promise<PricingTypes.PriceDTO[]>;
76
68
  removePrices(ids: string[], sharedContext?: Context): Promise<void>;
77
69
  addPriceListPrices(data: PricingTypes.AddPriceListPricesDTO[], sharedContext?: Context): Promise<PricingTypes.PriceDTO[]>;
78
70
  setPriceListRules(data: PricingTypes.SetPriceListRulesDTO, sharedContext?: Context): Promise<PricingTypes.PriceListDTO>;
79
71
  removePriceListRules(data: PricingTypes.RemovePriceListRulesDTO, sharedContext?: Context): Promise<PricingTypes.PriceListDTO>;
80
- protected create_(data: PricingTypes.CreatePriceSetDTO[], sharedContext?: Context): Promise<TPriceSet[]>;
81
- protected addRules_(inputs: PricingTypes.AddRulesDTO[], sharedContext?: Context): Promise<TPriceSet[]>;
82
- protected addPrices_(input: AddPricesDTO[], sharedContext?: Context): Promise<void>;
83
- protected createPriceLists_(data: PricingTypes.CreatePriceListDTO[], sharedContext?: Context): Promise<TPriceList[]>;
84
- protected updatePriceLists_(data: PricingTypes.UpdatePriceListDTO[], sharedContext?: Context): Promise<PricingTypes.PriceListDTO[]>;
85
- protected updatePriceListPrices_(data: PricingTypes.UpdatePriceListPricesDTO[], sharedContext?: Context): Promise<TPrice[]>;
72
+ createPricePreferences(data: PricingTypes.CreatePricePreferenceDTO, sharedContext?: Context): Promise<PricePreferenceDTO>;
73
+ createPricePreferences(data: PricingTypes.CreatePricePreferenceDTO[], sharedContext?: Context): Promise<PricePreferenceDTO[]>;
74
+ upsertPricePreferences(data: UpsertPricePreferenceDTO[], sharedContext?: Context): Promise<PricePreferenceDTO[]>;
75
+ upsertPricePreferences(data: UpsertPricePreferenceDTO, sharedContext?: Context): Promise<PricePreferenceDTO>;
76
+ updatePricePreferences(id: string, data: PricingTypes.UpdatePricePreferenceDTO, sharedContext?: Context): Promise<PricePreferenceDTO>;
77
+ updatePricePreferences(selector: PricingTypes.FilterablePricePreferenceProps, data: PricingTypes.UpdatePricePreferenceDTO, sharedContext?: Context): Promise<PricePreferenceDTO[]>;
78
+ protected createPricePreferences_(data: PricingTypes.CreatePricePreferenceDTO[], sharedContext?: Context): Promise<PricePreference[]>;
79
+ protected updatePricePreferences_(data: PricingTypes.UpdatePricePreferenceDTO[], sharedContext?: Context): Promise<PricePreference[]>;
80
+ protected createPriceSets_(data: PricingTypes.CreatePriceSetDTO[], sharedContext?: Context): Promise<PriceSet[]>;
81
+ protected addPrices_(input: AddPricesDTO[], sharedContext?: Context): Promise<Price[]>;
82
+ protected createPriceLists_(data: PricingTypes.CreatePriceListDTO[], sharedContext?: Context): Promise<PriceList[]>;
83
+ protected updatePriceLists_(data: PricingTypes.UpdatePriceListDTO[], sharedContext?: Context): Promise<PriceList[]>;
84
+ protected updatePriceListPrices_(data: PricingTypes.UpdatePriceListPricesDTO[], sharedContext?: Context): Promise<Price[]>;
86
85
  protected removePrices_(ids: string[], sharedContext?: Context): Promise<void>;
87
- protected addPriceListPrices_(data: PricingTypes.AddPriceListPricesDTO[], sharedContext?: Context): Promise<TPrice[]>;
88
- protected setPriceListRules_(data: PricingTypes.SetPriceListRulesDTO[], sharedContext?: Context): Promise<TPriceList[]>;
89
- protected removePriceListRules_(data: PricingTypes.RemovePriceListRulesDTO[], sharedContext?: Context): Promise<TPriceList[]>;
86
+ protected addPriceListPrices_(data: PricingTypes.AddPriceListPricesDTO[], sharedContext?: Context): Promise<Price[]>;
87
+ protected setPriceListRules_(data: PricingTypes.SetPriceListRulesDTO[], sharedContext?: Context): Promise<PriceList[]>;
88
+ protected removePriceListRules_(data: PricingTypes.RemovePriceListRulesDTO[], sharedContext?: Context): Promise<PriceList[]>;
89
+ protected normalizePriceListDate(data: (ServiceTypes.UpdatePriceListDTO | ServiceTypes.CreatePriceListDTO | CreatePriceListDTO)[]): any[];
90
+ protected normalizePriceSetConfig(config: FindConfig<PricingTypes.PriceSetDTO> | undefined): {
91
+ select?: string[] | undefined;
92
+ skip?: number | null | undefined;
93
+ take?: number | null | undefined;
94
+ relations?: string[] | undefined;
95
+ order?: {
96
+ [K: string]: "ASC" | "DESC";
97
+ } | undefined;
98
+ withDeleted?: boolean | undefined;
99
+ filters?: Record<string, any> | undefined;
100
+ options: Record<string, any>;
101
+ };
90
102
  }
91
103
  export {};
104
+ //# sourceMappingURL=pricing-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing-module.d.ts","sourceRoot":"","sources":["../../src/services/pricing-module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EAEP,kBAAkB,EAGlB,GAAG,EACH,UAAU,EACV,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAoBxB,OAAO,EACL,KAAK,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,SAAS,EACT,QAAQ,EACT,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,EAAE,kBAAkB,EAAkB,MAAM,oBAAoB,CAAA;AAGvE,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,GAAG,CAAC,iBAAiB,CAAA;IACrC,iBAAiB,EAAE,wBAAwB,CAAA;IAC3C,eAAe,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAC5D,gBAAgB,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAC7D,YAAY,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IACzD,gBAAgB,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAC7D,sBAAsB,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IACnE,oBAAoB,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;CAClE,CAAA;;cAaa;QAAE,GAAG,EAAE,wBAAwB,CAAA;KAAE;WACpC;QAAE,GAAG,EAAE,aAAa,QAAQ,CAAA;KAAE;eAC1B;QACT,GAAG,EAAE,aAAa,YA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