@medusajs/pricing 0.2.0-snapshot-20240429113131 → 1.0.0-rc-20241001083650

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +6 -9
  4. package/dist/index.js.map +1 -0
  5. package/dist/joiner-config.d.ts +2 -10
  6. package/dist/joiner-config.d.ts.map +1 -0
  7. package/dist/joiner-config.js +6 -48
  8. package/dist/joiner-config.js.map +1 -0
  9. package/dist/migrations/Migration20230929122253.d.ts +1 -0
  10. package/dist/migrations/Migration20230929122253.d.ts.map +1 -0
  11. package/dist/migrations/Migration20230929122253.js +1 -0
  12. package/dist/migrations/Migration20230929122253.js.map +1 -0
  13. package/dist/migrations/Migration20240322094407.d.ts +1 -0
  14. package/dist/migrations/Migration20240322094407.d.ts.map +1 -0
  15. package/dist/migrations/Migration20240322094407.js +1 -0
  16. package/dist/migrations/Migration20240322094407.js.map +1 -0
  17. package/dist/migrations/Migration20240322113359.d.ts +1 -0
  18. package/dist/migrations/Migration20240322113359.d.ts.map +1 -0
  19. package/dist/migrations/Migration20240322113359.js +1 -0
  20. package/dist/migrations/Migration20240322113359.js.map +1 -0
  21. package/dist/migrations/Migration20240322120125.d.ts +1 -0
  22. package/dist/migrations/Migration20240322120125.d.ts.map +1 -0
  23. package/dist/migrations/Migration20240322120125.js +1 -0
  24. package/dist/migrations/Migration20240322120125.js.map +1 -0
  25. package/dist/migrations/Migration20240626133555.d.ts +5 -0
  26. package/dist/migrations/Migration20240626133555.d.ts.map +1 -0
  27. package/dist/migrations/Migration20240626133555.js +34 -0
  28. package/dist/migrations/Migration20240626133555.js.map +1 -0
  29. package/dist/migrations/Migration20240704094505.d.ts +6 -0
  30. package/dist/migrations/Migration20240704094505.d.ts.map +1 -0
  31. package/dist/migrations/Migration20240704094505.js +16 -0
  32. package/dist/migrations/Migration20240704094505.js.map +1 -0
  33. package/dist/models/index.d.ts +2 -3
  34. package/dist/models/index.d.ts.map +1 -0
  35. package/dist/models/index.js +4 -7
  36. package/dist/models/index.js.map +1 -0
  37. package/dist/models/price-list-rule.d.ts +7 -9
  38. package/dist/models/price-list-rule.d.ts.map +1 -0
  39. package/dist/models/price-list-rule.js +10 -30
  40. package/dist/models/price-list-rule.js.map +1 -0
  41. package/dist/models/price-list.d.ts +4 -5
  42. package/dist/models/price-list.d.ts.map +1 -0
  43. package/dist/models/price-list.js +2 -10
  44. package/dist/models/price-list.js.map +1 -0
  45. package/dist/models/price-preference.d.ts +13 -0
  46. package/dist/models/price-preference.d.ts.map +1 -0
  47. package/dist/models/{rule-type.js → price-preference.js} +37 -41
  48. package/dist/models/price-preference.js.map +1 -0
  49. package/dist/models/price-rule.d.ts +6 -10
  50. package/dist/models/price-rule.d.ts.map +1 -0
  51. package/dist/models/price-rule.js +8 -46
  52. package/dist/models/price-rule.js.map +1 -0
  53. package/dist/models/price-set.d.ts +1 -4
  54. package/dist/models/price-set.d.ts.map +1 -0
  55. package/dist/models/price-set.js +2 -20
  56. package/dist/models/price-set.js.map +1 -0
  57. package/dist/models/price.d.ts +7 -6
  58. package/dist/models/price.d.ts.map +1 -0
  59. package/dist/models/price.js +7 -6
  60. package/dist/models/price.js.map +1 -0
  61. package/dist/repositories/index.d.ts +2 -1
  62. package/dist/repositories/index.d.ts.map +1 -0
  63. package/dist/repositories/index.js +2 -1
  64. package/dist/repositories/index.js.map +1 -0
  65. package/dist/repositories/pricing.d.ts +3 -2
  66. package/dist/repositories/pricing.d.ts.map +1 -0
  67. package/dist/repositories/pricing.js +41 -45
  68. package/dist/repositories/pricing.js.map +1 -0
  69. package/dist/schema/index.d.ts +2 -1
  70. package/dist/schema/index.d.ts.map +1 -0
  71. package/dist/schema/index.js +48 -4
  72. package/dist/schema/index.js.map +1 -0
  73. package/dist/services/index.d.ts +1 -2
  74. package/dist/services/index.d.ts.map +1 -0
  75. package/dist/services/index.js +2 -5
  76. package/dist/services/index.js.map +1 -0
  77. package/dist/services/pricing-module.d.ts +66 -53
  78. package/dist/services/pricing-module.d.ts.map +1 -0
  79. package/dist/services/pricing-module.js +625 -631
  80. package/dist/services/pricing-module.js.map +1 -0
  81. package/dist/tsconfig.tsbuildinfo +1 -0
  82. package/dist/types/index.d.ts +2 -1
  83. package/dist/types/index.d.ts.map +1 -0
  84. package/dist/types/index.js +1 -0
  85. package/dist/types/index.js.map +1 -0
  86. package/dist/types/services/index.d.ts +30 -2
  87. package/dist/types/services/index.d.ts.map +1 -0
  88. package/dist/types/services/index.js +1 -16
  89. package/dist/types/services/index.js.map +1 -0
  90. package/dist/utils/events.d.ts +83 -0
  91. package/dist/utils/events.d.ts.map +1 -0
  92. package/dist/utils/events.js +67 -0
  93. package/dist/utils/events.js.map +1 -0
  94. package/dist/utils/index.d.ts +2 -0
  95. package/dist/utils/index.d.ts.map +1 -0
  96. package/dist/utils/index.js +2 -0
  97. package/dist/utils/index.js.map +1 -0
  98. package/dist/utils/validate-price-list-dates.d.ts +1 -0
  99. package/dist/utils/validate-price-list-dates.d.ts.map +1 -0
  100. package/dist/utils/validate-price-list-dates.js +2 -1
  101. package/dist/utils/validate-price-list-dates.js.map +1 -0
  102. package/package.json +20 -21
  103. package/dist/initialize/index.d.ts +0 -4
  104. package/dist/initialize/index.js +0 -17
  105. package/dist/loaders/connection.d.ts +0 -4
  106. package/dist/loaders/connection.js +0 -40
  107. package/dist/loaders/container.d.ts +0 -2
  108. package/dist/loaders/container.js +0 -34
  109. package/dist/loaders/index.d.ts +0 -2
  110. package/dist/loaders/index.js +0 -18
  111. package/dist/models/price-list-rule-value.d.ts +0 -17
  112. package/dist/models/price-list-rule-value.js +0 -102
  113. package/dist/models/price-set-rule-type.d.ts +0 -10
  114. package/dist/models/price-set-rule-type.js +0 -108
  115. package/dist/models/rule-type.d.ts +0 -17
  116. package/dist/module-definition.d.ts +0 -4
  117. package/dist/module-definition.js +0 -50
  118. package/dist/scripts/bin/run-seed.d.ts +0 -3
  119. package/dist/scripts/bin/run-seed.js +0 -38
  120. package/dist/scripts/seed.d.ts +0 -4
  121. package/dist/scripts/seed.js +0 -67
  122. package/dist/services/price-list.d.ts +0 -16
  123. package/dist/services/price-list.js +0 -34
  124. package/dist/services/rule-type.d.ts +0 -15
  125. package/dist/services/rule-type.js +0 -53
  126. package/dist/types/services/price-list.d.ts +0 -18
  127. package/dist/types/services/price-list.js +0 -2
  128. package/dist/types/services/price-set.d.ts +0 -4
  129. package/dist/types/services/price-set.js +0 -2
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PricingRepository = void 0;
4
- const utils_1 = require("@medusajs/utils");
4
+ const utils_1 = require("@medusajs/framework/utils");
5
5
  class PricingRepository extends utils_1.MikroOrmBase {
6
6
  constructor() {
7
7
  // @ts-ignore
@@ -30,64 +30,61 @@ class PricingRepository extends utils_1.MikroOrmBase {
30
30
  if (!isContextPresent) {
31
31
  return [];
32
32
  }
33
- const date = new Date().toISOString();
34
33
  // Gets all the price set money amounts where rules match for each of the contexts
35
34
  // that the price set is configured for
36
35
  const priceSubQueryKnex = knex({
37
36
  price: "price",
38
37
  })
39
38
  .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",
39
+ id: "price.id",
40
+ amount: "price.amount",
41
+ raw_amount: "price.raw_amount",
42
+ min_quantity: "price.min_quantity",
43
+ max_quantity: "price.max_quantity",
44
+ currency_code: "price.currency_code",
45
+ price_set_id: "price.price_set_id",
46
+ rules_count: "price.rules_count",
47
+ price_list_id: "price.price_list_id",
48
48
  pl_rules_count: "pl.rules_count",
49
49
  pl_type: "pl.type",
50
- has_price_list: knex.raw("case when price1.price_list_id IS NULL then False else True end"),
50
+ has_price_list: knex.raw("case when price.price_list_id IS NULL then False else True end"),
51
+ })
52
+ .leftJoin("price_rule as pr", "pr.price_id", "price.id")
53
+ .leftJoin("price_list as pl", function () {
54
+ this.on("pl.id", "price.price_list_id").andOn("pl.status", knex.raw("?", [utils_1.PriceListStatus.ACTIVE]));
51
55
  })
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
56
  .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"));
57
+ .groupBy("price.id", "pl.id")
58
+ .having(knex.raw("count(DISTINCT pr.attribute) = price.rules_count AND price.price_list_id IS NULL"))
59
+ .orHaving(knex.raw("count(DISTINCT plr.attribute) = pl.rules_count AND price.price_list_id IS NOT NULL"));
66
60
  priceSubQueryKnex.orWhere((q) => {
67
- for (const [key, value] of Object.entries(context)) {
68
- q.orWhere({
69
- "rt.rule_attribute": key,
70
- "pr.value": value,
71
- });
72
- }
73
- q.orWhere("price1.rules_count", "=", 0);
74
- q.whereNull("price1.price_list_id");
61
+ const nullPLq = q.whereNull("price.price_list_id");
62
+ nullPLq.andWhere((q) => {
63
+ for (const [key, value] of Object.entries(context)) {
64
+ q.orWhere({
65
+ "pr.attribute": key,
66
+ "pr.value": value,
67
+ });
68
+ }
69
+ q.orWhere("price.rules_count", "=", 0);
70
+ });
75
71
  });
76
72
  priceSubQueryKnex.orWhere((q) => {
77
- q.whereNotNull("price1.price_list_id")
73
+ q.whereNotNull("price.price_list_id")
74
+ .whereNull("pl.deleted_at")
78
75
  .andWhere(function () {
79
- this.whereNull("pl.starts_at").orWhere("pl.starts_at", "<=", date);
76
+ this.whereNull("pl.starts_at").orWhere("pl.starts_at", "<=", knex.fn.now());
80
77
  })
81
78
  .andWhere(function () {
82
- this.whereNull("pl.ends_at").orWhere("pl.ends_at", ">=", date);
79
+ this.whereNull("pl.ends_at").orWhere("pl.ends_at", ">=", knex.fn.now());
83
80
  })
84
81
  .andWhere(function () {
85
82
  this.andWhere(function () {
86
83
  for (const [key, value] of Object.entries(context)) {
87
84
  this.orWhere({
88
- "plrt.rule_attribute": key,
85
+ "plr.attribute": key,
89
86
  });
90
- this.whereIn("plrv.value", [value]);
87
+ this.where("plr.value", "@>", JSON.stringify(Array.isArray(value) ? value : [value]));
91
88
  }
92
89
  this.orWhere("pl.rules_count", "=", 0);
93
90
  });
@@ -95,13 +92,13 @@ class PricingRepository extends utils_1.MikroOrmBase {
95
92
  this.andWhere(function () {
96
93
  for (const [key, value] of Object.entries(context)) {
97
94
  this.orWhere({
98
- "rt.rule_attribute": key,
95
+ "pr.attribute": key,
99
96
  "pr.value": value,
100
97
  });
101
98
  }
102
- this.andWhere("price1.rules_count", ">", 0);
99
+ this.andWhere("price.rules_count", ">", 0);
103
100
  });
104
- this.orWhere("price1.rules_count", "=", 0);
101
+ this.orWhere("price.rules_count", "=", 0);
105
102
  });
106
103
  });
107
104
  });
@@ -112,25 +109,23 @@ class PricingRepository extends utils_1.MikroOrmBase {
112
109
  id: "price.id",
113
110
  price_set_id: "ps.id",
114
111
  amount: "price.amount",
112
+ raw_amount: "price.raw_amount",
115
113
  min_quantity: "price.min_quantity",
116
114
  max_quantity: "price.max_quantity",
117
115
  currency_code: "price.currency_code",
118
- default_priority: "rt.default_priority",
119
116
  rules_count: "price.rules_count",
120
117
  pl_rules_count: "price.pl_rules_count",
121
118
  price_list_type: "price.pl_type",
122
119
  price_list_id: "price.price_list_id",
120
+ all_rules_count: knex.raw("COALESCE(price.rules_count, 0) + COALESCE(price.pl_rules_count, 0)"),
123
121
  })
124
122
  .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
123
  .whereIn("ps.id", pricingFilters.id)
128
124
  .andWhere("price.currency_code", "=", currencyCode)
129
125
  .orderBy([
130
126
  { column: "price.has_price_list", order: "asc" },
127
+ { column: "all_rules_count", order: "desc" },
131
128
  { column: "amount", order: "asc" },
132
- { column: "rules_count", order: "desc" },
133
- { column: "default_priority", order: "desc" },
134
129
  ]);
135
130
  if (quantity) {
136
131
  priceSetQueryKnex.where("price.min_quantity", "<=", quantity);
@@ -145,3 +140,4 @@ class PricingRepository extends utils_1.MikroOrmBase {
145
140
  }
146
141
  }
147
142
  exports.PricingRepository = PricingRepository;
143
+ //# sourceMappingURL=pricing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/repositories/pricing.ts"],"names":[],"mappings":";;;AAAA,qDAIkC;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,kFAAkF;QAClF,8FAA8F;QAC9F,+FAA+F;QAC/F,0BAA0B;QAC1B,MAAM,QAAQ,GA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neyAmount]\n}\n\ntype MoneyAmount {\n id: String!\n currency_code: String\n amount: Float\n min_quantity: Float\n max_quantity: Float\n}\n";
1
+ export declare const schema = "\ntype PriceSet {\n id: ID!\n prices: [Price]\n calculated_price: CalculatedPriceSet\n}\n\ntype Price {\n id: ID!\n currency_code: String\n amount: Float\n min_quantity: Float\n max_quantity: Float\n rules_count: Int\n price_rules: [PriceRule]\n created_at: DateTime\n updated_at: DateTime\n deleted_at: DateTime\n}\n\ntype PriceRule {\n id: ID!\n price_set_id: String!\n price_set: PriceSet\n attribute: String!\n value: String!\n priority: Int!\n price_id: String!\n price_list_id: String!\n created_at: DateTime\n updated_at: DateTime\n deleted_at: DateTime\n}\n\ntype CalculatedPriceSet {\n id: ID!\n is_calculated_price_price_list: Boolean\n is_calculated_price_tax_inclusive: Boolean\n calculated_amount: Float\n raw_calculated_amount: JSON\n is_original_price_price_list: Boolean\n is_original_price_tax_inclusive: Boolean\n original_amount: Float\n raw_original_amount: JSON\n currency_code: String\n calculated_price: PriceDetails\n original_price: PriceDetails\n}\n\ntype PriceDetails {\n id: ID\n price_list_id: String\n price_list_type: String\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,8nCAwDlB,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -3,16 +3,60 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schema = void 0;
4
4
  exports.schema = `
5
5
  type PriceSet {
6
- id: String!
7
- money_amounts: [MoneyAmount]
6
+ id: ID!
7
+ prices: [Price]
8
+ calculated_price: CalculatedPriceSet
8
9
  }
9
10
 
10
- type MoneyAmount {
11
- id: String!
11
+ type Price {
12
+ id: ID!
12
13
  currency_code: String
13
14
  amount: Float
14
15
  min_quantity: Float
15
16
  max_quantity: Float
17
+ rules_count: Int
18
+ price_rules: [PriceRule]
19
+ created_at: DateTime
20
+ updated_at: DateTime
21
+ deleted_at: DateTime
22
+ }
23
+
24
+ type PriceRule {
25
+ id: ID!
26
+ price_set_id: String!
27
+ price_set: PriceSet
28
+ attribute: String!
29
+ value: String!
30
+ priority: Int!
31
+ price_id: String!
32
+ price_list_id: String!
33
+ created_at: DateTime
34
+ updated_at: DateTime
35
+ deleted_at: DateTime
36
+ }
37
+
38
+ type CalculatedPriceSet {
39
+ id: ID!
40
+ is_calculated_price_price_list: Boolean
41
+ is_calculated_price_tax_inclusive: Boolean
42
+ calculated_amount: Float
43
+ raw_calculated_amount: JSON
44
+ is_original_price_price_list: Boolean
45
+ is_original_price_tax_inclusive: Boolean
46
+ original_amount: Float
47
+ raw_original_amount: JSON
48
+ currency_code: String
49
+ calculated_price: PriceDetails
50
+ original_price: PriceDetails
51
+ }
52
+
53
+ type PriceDetails {
54
+ id: ID
55
+ price_list_id: String
56
+ price_list_type: String
57
+ min_quantity: Float
58
+ max_quantity: Float
16
59
  }
17
60
  `;
18
61
  exports.default = exports.schema;
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDrB,CAAA;AAED,kBAAe,cAAM,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,7 @@ 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; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAAkE;AAAzD,uIAAA,OAAO,OAAwB"}
@@ -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, DAL, FindConfig, InternalModuleDeclaration, ModuleJoinerConfig, ModulesSdkTypes, PricePreferenceDTO, PriceSetDTO, PricingContext, PricingFilters, PricingRepositoryService, PricingTypes, UpsertPricePreferenceDTO, UpsertPriceSetDTO } from "@medusajs/framework/types";
2
+ import { ModulesSdkUtils } from "@medusajs/framework/utils";
3
+ import { Price, PriceList, PriceListRule, PricePreference, PriceRule, PriceSet } from "../models";
4
+ import { ServiceTypes } from "../types";
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: ModulesSdkUtils.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 | ServiceTypes.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[];
95
+ order?: {
96
+ [K: string]: "ASC" | "DESC";
97
+ };
98
+ withDeleted?: boolean;
99
+ filters?: Record<string, any>;
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,EAKP,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,2BAA2B,CAAA;AAClC,OAAO,EAYL,eAAe,EAKhB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,KAAK,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,SAAS,EACT,QAAQ,EACT,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAGrC,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,EA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