turf-common 1.4.1-beta.7 → 1.4.1-beta.8

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.
@@ -167,8 +167,19 @@ var SubscribedPricingPlanModelV2 = /** @class */ (function (_super) {
167
167
  // return codes ? codes[0] : "";
168
168
  };
169
169
  SubscribedPricingPlanModelV2.prototype.getDiscount = function () {
170
- var codes = this.getCodeByPitchCountCycle();
171
- return codes === null || codes === void 0 ? void 0 : codes.split("#")[3];
170
+ var _this = this;
171
+ var codes = this.billing_cost_code.split(",");
172
+ // Filter by pitch count
173
+ codes = codes.filter(function (code) {
174
+ var _a = code.split("_"), from = _a[0], to = _a[1];
175
+ return _this.pitchCount >= parseInt(from) && _this.pitchCount <= parseInt(to);
176
+ });
177
+ codes.sort();
178
+ // Filter by billing cycle
179
+ codes = codes.filter(function (code) {
180
+ return _this.selectedBillingCycle.to === Number(code.split("#")[1]);
181
+ });
182
+ return codes ? codes[0].split("#")[3] : "";
172
183
  };
173
184
  SubscribedPricingPlanModelV2.prototype.getBasePriceByPitchSlab = function () {
174
185
  var _this = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.4.1-beta.7",
3
+ "version": "1.4.1-beta.8",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",