taxtank-core 0.29.22 → 0.29.23

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.
@@ -5524,17 +5524,22 @@
5524
5524
  };
5525
5525
  ServiceSubscriptionCollection.prototype.groupByProduct = function (products) {
5526
5526
  var _this = this;
5527
- var dictionary = new Dictionary([]);
5527
+ var collectionDictionary = new CollectionDictionary(new ServiceSubscriptionCollection([]));
5528
5528
  products.toArray().forEach(function (product) {
5529
- dictionary.add(product.id, _this.findByProduct(product));
5529
+ collectionDictionary.add(product.id, _this.filterByProduct(product));
5530
5530
  });
5531
- return dictionary;
5531
+ return collectionDictionary;
5532
5532
  };
5533
5533
  ServiceSubscriptionCollection.prototype.findByProduct = function (product) {
5534
5534
  return this.find(function (subscription) {
5535
5535
  return !!subscription.items.find(function (item) { return item.price.product.id === product.id; });
5536
5536
  });
5537
5537
  };
5538
+ ServiceSubscriptionCollection.prototype.filterByProduct = function (product) {
5539
+ return this.filter(function (subscription) {
5540
+ return !!subscription.items.find(function (item) { return item.price.product.id === product.id; });
5541
+ });
5542
+ };
5538
5543
  ServiceSubscriptionCollection.prototype.hasPropertyTank = function () {
5539
5544
  return !!this.getItems().propertiesItem;
5540
5545
  };