taxtank-core 0.30.11 → 0.30.13

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.
@@ -5740,11 +5740,12 @@ class ServiceSubscriptionCollection extends Collection {
5740
5740
  return new SubscriptionItemCollection(flatten(this.mapBy('items')));
5741
5741
  }
5742
5742
  groupByProduct(products) {
5743
- const collectionDictionary = new CollectionDictionary(new ServiceSubscriptionCollection([]));
5743
+ const dictionary = new Dictionary([]);
5744
5744
  products.toArray().forEach((product) => {
5745
- collectionDictionary.add(product.id, this.filterByProduct(product));
5745
+ const subscriptions = this.filterByProduct(product);
5746
+ dictionary.add(product.id, (subscriptions.getPaid().first ?? subscriptions.getTrials().first));
5746
5747
  });
5747
- return collectionDictionary;
5748
+ return dictionary;
5748
5749
  }
5749
5750
  findByProduct(product) {
5750
5751
  return this.find((subscription) => {
@@ -8326,7 +8327,7 @@ const ENDPOINTS = {
8326
8327
  PROPERTIES_POST: new Endpoint('POST', '\\/properties'),
8327
8328
  PROPERTY_PUT: new Endpoint('PUT', '\\/properties/\\d+'),
8328
8329
  PROPERTY_SUBSCRIPTIONS_DELETE: new Endpoint('DELETE', '\\/property-subscriptions\\/\\d+'),
8329
- PROPERTY_SUBSCRIPTIONS_PUT: new Endpoint('PUT', '\\/property-subscriptions\\/\\d+'),
8330
+ PROPERTY_SUBSCRIPTIONS_POST: new Endpoint('POST', '\\/property-subscriptions'),
8330
8331
  PROPERTIES_PUT: new Endpoint('PUT', '\\/properties'),
8331
8332
  PROPERTIES_CATEGORIES_EQUITY_GET: new Endpoint('GET', '\\/properties\\/categories\\/equity'),
8332
8333
  PROPERTIES_CATEGORIES_GET: new Endpoint('GET', '\\/properties\\/categories'),