ia-common 1.0.1-beta.42 → 1.0.1-beta.43
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.
|
@@ -9,7 +9,7 @@ export declare class PricingPlanModel implements IPricingPlanModel {
|
|
|
9
9
|
};
|
|
10
10
|
constructor(data: IGetPricingPlanByDateResponse);
|
|
11
11
|
getBillingCycleKeys(): string[];
|
|
12
|
+
validateBillingCycleKey(key: string): void;
|
|
12
13
|
getNoOfSubscriptionDays(type: string): number;
|
|
13
14
|
getBillCycleByKey(type: string): ISelectedBillingCycle;
|
|
14
|
-
validateBillingCycleKey(key: string): void;
|
|
15
15
|
}
|
|
@@ -9,13 +9,6 @@ var PricingPlanModel = /** @class */ (function () {
|
|
|
9
9
|
PricingPlanModel.prototype.getBillingCycleKeys = function () {
|
|
10
10
|
return Object.values(this.billingCycle).map(function (billingCycleObj) { return billingCycleObj.key; });
|
|
11
11
|
};
|
|
12
|
-
PricingPlanModel.prototype.getNoOfSubscriptionDays = function (type) {
|
|
13
|
-
var billingCycleModel = this.getBillCycleByKey(type);
|
|
14
|
-
return billingCycleModel.noOfMonths * 30 - 1;
|
|
15
|
-
};
|
|
16
|
-
PricingPlanModel.prototype.getBillCycleByKey = function (type) {
|
|
17
|
-
return Object.values(this.billingCycle).filter(function (billingCycleObj) { return billingCycleObj.key === type; })[0];
|
|
18
|
-
};
|
|
19
12
|
PricingPlanModel.prototype.validateBillingCycleKey = function (key) {
|
|
20
13
|
if (!this.getBillingCycleKeys().includes(key)) {
|
|
21
14
|
throw new _model_1.AppBadRequestException({
|
|
@@ -26,6 +19,15 @@ var PricingPlanModel = /** @class */ (function () {
|
|
|
26
19
|
});
|
|
27
20
|
}
|
|
28
21
|
};
|
|
22
|
+
PricingPlanModel.prototype.getNoOfSubscriptionDays = function (type) {
|
|
23
|
+
this.validateBillingCycleKey(type);
|
|
24
|
+
var billingCycleModel = this.getBillCycleByKey(type);
|
|
25
|
+
return billingCycleModel.noOfMonths * 30 - 1;
|
|
26
|
+
};
|
|
27
|
+
PricingPlanModel.prototype.getBillCycleByKey = function (type) {
|
|
28
|
+
this.validateBillingCycleKey(type);
|
|
29
|
+
return Object.values(this.billingCycle).filter(function (billingCycleObj) { return billingCycleObj.key === type; })[0];
|
|
30
|
+
};
|
|
29
31
|
return PricingPlanModel;
|
|
30
32
|
}());
|
|
31
33
|
exports.PricingPlanModel = PricingPlanModel;
|