ia-common 1.0.1-beta.63 → 1.0.1-beta.64
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SubscribedPricingPlanModel = void 0;
|
|
4
|
+
var _model_1 = require("../@model");
|
|
4
5
|
var _utils_1 = require("../@utils");
|
|
5
6
|
var SubscribedPricingPlanModel = /** @class */ (function () {
|
|
6
7
|
function SubscribedPricingPlanModel(data, billingCycleKey) {
|
|
@@ -40,6 +41,25 @@ var SubscribedPricingPlanModel = /** @class */ (function () {
|
|
|
40
41
|
}
|
|
41
42
|
return 0;
|
|
42
43
|
};
|
|
44
|
+
SubscribedPricingPlanModel.prototype.getToDateCode = function (fromDateCode) {
|
|
45
|
+
var copyFromDateCode = fromDateCode;
|
|
46
|
+
var newSubscriptionToDate = new Date(_utils_1.dateUtil.convertStringToDate(String(copyFromDateCode)));
|
|
47
|
+
newSubscriptionToDate.setDate(newSubscriptionToDate.getDate() +
|
|
48
|
+
this.pricingPlanModel.getNoOfSubscriptionDays(this.billingCycleKey));
|
|
49
|
+
return Number(_utils_1.dateUtil.getDateCode(newSubscriptionToDate));
|
|
50
|
+
};
|
|
51
|
+
SubscribedPricingPlanModel.prototype.validateGetToDateCode = function (fromDateCode, toDateCode) {
|
|
52
|
+
var calculatedToDateCode = this.getToDateCode(fromDateCode);
|
|
53
|
+
if (calculatedToDateCode != Number(toDateCode)) {
|
|
54
|
+
throw new _model_1.AppBadRequestException({
|
|
55
|
+
key: "to",
|
|
56
|
+
message: [
|
|
57
|
+
"calculated to Date:'".concat(calculatedToDateCode, "' is not matches with to date you entered"),
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return calculatedToDateCode;
|
|
62
|
+
};
|
|
43
63
|
return SubscribedPricingPlanModel;
|
|
44
64
|
}());
|
|
45
65
|
exports.SubscribedPricingPlanModel = SubscribedPricingPlanModel;
|