taxtank-core 0.28.30 → 0.28.31
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.
- package/bundles/taxtank-core.umd.js +13 -0
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/models/service-subscription/service-subscription.js +14 -1
- package/fesm2015/taxtank-core.js +13 -0
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/models/service-subscription/service-subscription.d.ts +5 -0
- package/package.json +1 -1
|
@@ -2692,6 +2692,19 @@
|
|
|
2692
2692
|
ServiceSubscription.prototype.hasItem = function (itemToCheck) {
|
|
2693
2693
|
return !!this.items.find(function (item) { return item.price.id === itemToCheck.price.id; });
|
|
2694
2694
|
};
|
|
2695
|
+
/**
|
|
2696
|
+
* Recommended number of properties to buy,
|
|
2697
|
+
* based on the property service product and the number of properties the user has
|
|
2698
|
+
*/
|
|
2699
|
+
ServiceSubscription.prototype.getRecommendedPropertiesQty = function (propertyItem, propertiesQty) {
|
|
2700
|
+
var max = propertyItem.price.product.maxQty;
|
|
2701
|
+
var min = propertyItem.price.product.minQty;
|
|
2702
|
+
// if user has property subscription and number of properties doesn't exceed the maximum in the service product - return one more
|
|
2703
|
+
if (this.hasItem(propertyItem)) {
|
|
2704
|
+
propertiesQty = propertiesQty < max ? propertiesQty + 1 : max;
|
|
2705
|
+
}
|
|
2706
|
+
return Math.max(min, propertiesQty);
|
|
2707
|
+
};
|
|
2695
2708
|
return ServiceSubscription;
|
|
2696
2709
|
}(ServiceSubscription$1));
|
|
2697
2710
|
__decorate([
|