taxtank-core 0.8.1 → 0.8.5

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.
Files changed (27) hide show
  1. package/bundles/taxtank-core.umd.js +100 -61
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/collection.js +4 -1
  4. package/esm2015/lib/collections/depreciation.collection.js +3 -3
  5. package/esm2015/lib/collections/tax-summary/report-item.collection.js +141 -0
  6. package/esm2015/lib/models/bank/basiq-config.js +12 -0
  7. package/esm2015/lib/models/property/property.js +7 -4
  8. package/esm2015/lib/models/tax-summary/report-item-details.js +9 -0
  9. package/esm2015/lib/models/tax-summary/report-item.js +15 -0
  10. package/esm2015/lib/models/tax-summary/tax-summary-section.js +5 -5
  11. package/esm2015/lib/services/subscription/subscription.service.js +35 -16
  12. package/esm2015/public-api.js +5 -4
  13. package/fesm2015/taxtank-core.js +63 -27
  14. package/fesm2015/taxtank-core.js.map +1 -1
  15. package/lib/collections/collection.d.ts +3 -0
  16. package/lib/collections/{tax-return-category-item.collection.d.ts → tax-summary/report-item.collection.d.ts} +5 -5
  17. package/lib/models/bank/basiq-config.d.ts +17 -0
  18. package/lib/models/property/property.d.ts +1 -0
  19. package/lib/models/tax-summary/{tax-return-category-item-details.d.ts → report-item-details.d.ts} +2 -2
  20. package/lib/models/tax-summary/{tax-return-category-item.d.ts → report-item.d.ts} +4 -4
  21. package/lib/models/tax-summary/tax-summary-section.d.ts +2 -2
  22. package/lib/services/subscription/subscription.service.d.ts +9 -4
  23. package/package.json +1 -1
  24. package/public-api.d.ts +4 -3
  25. package/esm2015/lib/collections/tax-return-category-item.collection.js +0 -141
  26. package/esm2015/lib/models/tax-summary/tax-return-category-item-details.js +0 -9
  27. package/esm2015/lib/models/tax-summary/tax-return-category-item.js +0 -15
@@ -1261,6 +1261,9 @@
1261
1261
  Collection.prototype.getIds = function () {
1262
1262
  return this.items.map(function (item) { return item['id']; });
1263
1263
  };
1264
+ /**
1265
+ * @TODO vik rename
1266
+ */
1264
1267
  Collection.prototype.getOneBy = function (path, value) {
1265
1268
  return this.items.find(function (item) { return get__default["default"](item, path) === value; });
1266
1269
  };
@@ -1952,8 +1955,8 @@
1952
1955
  });
1953
1956
  DepreciationCollection.prototype.getClaimAmountByYear = function (year) {
1954
1957
  if (year === void 0) { year = +localStorage.getItem('financialYear'); }
1955
- return this.items.reduce(function (sum, depreciation) {
1956
- return sum + depreciation.getClaimAmountByYear(year);
1958
+ return this.amount - this.items.reduce(function (sum, depreciation) {
1959
+ return sum + depreciation.getCloseBalanceByYear(year);
1957
1960
  }, 0);
1958
1961
  };
1959
1962
  DepreciationCollection.prototype.getCloseBalanceByYear = function (year) {
@@ -2536,12 +2539,12 @@
2536
2539
  /**
2537
2540
  * collection for tax return category items
2538
2541
  */
2539
- var TaxReturnCategoryItemCollection = /** @class */ (function (_super) {
2540
- __extends(TaxReturnCategoryItemCollection, _super);
2541
- function TaxReturnCategoryItemCollection() {
2542
+ var ReportItemCollection = /** @class */ (function (_super) {
2543
+ __extends(ReportItemCollection, _super);
2544
+ function ReportItemCollection() {
2542
2545
  return _super !== null && _super.apply(this, arguments) || this;
2543
2546
  }
2544
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "salary", {
2547
+ Object.defineProperty(ReportItemCollection.prototype, "salary", {
2545
2548
  /**
2546
2549
  * Work income
2547
2550
  */
@@ -2552,7 +2555,7 @@
2552
2555
  enumerable: false,
2553
2556
  configurable: true
2554
2557
  });
2555
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "workExpenses", {
2558
+ Object.defineProperty(ReportItemCollection.prototype, "workExpenses", {
2556
2559
  /**
2557
2560
  * Work expenses
2558
2561
  */
@@ -2563,7 +2566,7 @@
2563
2566
  enumerable: false,
2564
2567
  configurable: true
2565
2568
  });
2566
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "rentalIncome", {
2569
+ Object.defineProperty(ReportItemCollection.prototype, "rentalIncome", {
2567
2570
  /**
2568
2571
  * Property income
2569
2572
  */
@@ -2574,7 +2577,7 @@
2574
2577
  enumerable: false,
2575
2578
  configurable: true
2576
2579
  });
2577
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "rentalDeductions", {
2580
+ Object.defineProperty(ReportItemCollection.prototype, "rentalDeductions", {
2578
2581
  /**
2579
2582
  * Property rental deductions
2580
2583
  */
@@ -2585,7 +2588,7 @@
2585
2588
  enumerable: false,
2586
2589
  configurable: true
2587
2590
  });
2588
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "propertyExpenses", {
2591
+ Object.defineProperty(ReportItemCollection.prototype, "propertyExpenses", {
2589
2592
  /**
2590
2593
  * Property expenses
2591
2594
  */
@@ -2595,7 +2598,7 @@
2595
2598
  enumerable: false,
2596
2599
  configurable: true
2597
2600
  });
2598
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "interestDeductions", {
2601
+ Object.defineProperty(ReportItemCollection.prototype, "interestDeductions", {
2599
2602
  /**
2600
2603
  * Property interest
2601
2604
  */
@@ -2606,7 +2609,7 @@
2606
2609
  enumerable: false,
2607
2610
  configurable: true
2608
2611
  });
2609
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "capitalWorks", {
2612
+ Object.defineProperty(ReportItemCollection.prototype, "capitalWorks", {
2610
2613
  /**
2611
2614
  * Property capital works depreciations
2612
2615
  */
@@ -2617,7 +2620,7 @@
2617
2620
  enumerable: false,
2618
2621
  configurable: true
2619
2622
  });
2620
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "plantEquipment", {
2623
+ Object.defineProperty(ReportItemCollection.prototype, "plantEquipment", {
2621
2624
  /**
2622
2625
  * Property plant & equipment depreciations
2623
2626
  */
@@ -2628,7 +2631,7 @@
2628
2631
  enumerable: false,
2629
2632
  configurable: true
2630
2633
  });
2631
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "propertyDepreciations", {
2634
+ Object.defineProperty(ReportItemCollection.prototype, "propertyDepreciations", {
2632
2635
  /**
2633
2636
  * Total property depreciaions
2634
2637
  */
@@ -2638,7 +2641,7 @@
2638
2641
  enumerable: false,
2639
2642
  configurable: true
2640
2643
  });
2641
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "partnershipsAndTrusts", {
2644
+ Object.defineProperty(ReportItemCollection.prototype, "partnershipsAndTrusts", {
2642
2645
  get: function () {
2643
2646
  var _a;
2644
2647
  return ((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.PARTNERSHIPS_TRUSTS)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2646,7 +2649,7 @@
2646
2649
  enumerable: false,
2647
2650
  configurable: true
2648
2651
  });
2649
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "pciAndSbeIncome", {
2652
+ Object.defineProperty(ReportItemCollection.prototype, "pciAndSbeIncome", {
2650
2653
  get: function () {
2651
2654
  var _a;
2652
2655
  return ((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.PCI_SBE_INCOME)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2654,7 +2657,7 @@
2654
2657
  enumerable: false,
2655
2658
  configurable: true
2656
2659
  });
2657
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "capitalGains", {
2660
+ Object.defineProperty(ReportItemCollection.prototype, "capitalGains", {
2658
2661
  get: function () {
2659
2662
  var _a;
2660
2663
  return ((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.CAPITAL_GAINS)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2662,7 +2665,7 @@
2662
2665
  enumerable: false,
2663
2666
  configurable: true
2664
2667
  });
2665
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "foreignSourceIncome", {
2668
+ Object.defineProperty(ReportItemCollection.prototype, "foreignSourceIncome", {
2666
2669
  get: function () {
2667
2670
  var _a;
2668
2671
  return ((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.FOREIGN_SOURCE_INCOME)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2670,7 +2673,7 @@
2670
2673
  enumerable: false,
2671
2674
  configurable: true
2672
2675
  });
2673
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "otherIncome", {
2676
+ Object.defineProperty(ReportItemCollection.prototype, "otherIncome", {
2674
2677
  /**
2675
2678
  * Other income
2676
2679
  */
@@ -2685,7 +2688,7 @@
2685
2688
  enumerable: false,
2686
2689
  configurable: true
2687
2690
  });
2688
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "otherDeductions", {
2691
+ Object.defineProperty(ReportItemCollection.prototype, "otherDeductions", {
2689
2692
  /**
2690
2693
  * Other expenses
2691
2694
  */
@@ -2696,7 +2699,7 @@
2696
2699
  enumerable: false,
2697
2700
  configurable: true
2698
2701
  });
2699
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "taxInstalments", {
2702
+ Object.defineProperty(ReportItemCollection.prototype, "taxInstalments", {
2700
2703
  get: function () {
2701
2704
  var _a;
2702
2705
  return ((_a = this.getTaxCreditsCollection().getByCategory(exports.TaxReturnCategoryListEnum.TAX_INSTALMENTS)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2704,7 +2707,7 @@
2704
2707
  enumerable: false,
2705
2708
  configurable: true
2706
2709
  });
2707
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "frankingCredits", {
2710
+ Object.defineProperty(ReportItemCollection.prototype, "frankingCredits", {
2708
2711
  get: function () {
2709
2712
  var _a;
2710
2713
  return ((_a = this.getTaxCreditsCollection().getByCategory(exports.TaxReturnCategoryListEnum.FRANKING_CREDITS)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2712,7 +2715,7 @@
2712
2715
  enumerable: false,
2713
2716
  configurable: true
2714
2717
  });
2715
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "taxOffsets", {
2718
+ Object.defineProperty(ReportItemCollection.prototype, "taxOffsets", {
2716
2719
  get: function () {
2717
2720
  var _a;
2718
2721
  return ((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.TAX_OFFSETS)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2720,7 +2723,7 @@
2720
2723
  enumerable: false,
2721
2724
  configurable: true
2722
2725
  });
2723
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "borrowingExpenses", {
2726
+ Object.defineProperty(ReportItemCollection.prototype, "borrowingExpenses", {
2724
2727
  get: function () {
2725
2728
  var _a;
2726
2729
  return ((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.BORROWING_EXPENSES)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2728,7 +2731,7 @@
2728
2731
  enumerable: false,
2729
2732
  configurable: true
2730
2733
  });
2731
- Object.defineProperty(TaxReturnCategoryItemCollection.prototype, "grossTaxPayable", {
2734
+ Object.defineProperty(ReportItemCollection.prototype, "grossTaxPayable", {
2732
2735
  get: function () {
2733
2736
  var _a;
2734
2737
  return ((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.GROSS_TAX_PAYABLE)) === null || _a === void 0 ? void 0 : _a.amount) || 0;
@@ -2739,22 +2742,22 @@
2739
2742
  /**
2740
2743
  * taxWithheld by section (work or other)
2741
2744
  */
2742
- TaxReturnCategoryItemCollection.prototype.getTaxWithheld = function (section) {
2745
+ ReportItemCollection.prototype.getTaxWithheld = function (section) {
2743
2746
  if (section === void 0) { section = exports.TaxReturnCategorySectionEnum.WORK_TANK; }
2744
2747
  var _a;
2745
2748
  return ((_a = this.getTaxCreditsCollection().getByCategory(exports.TaxReturnCategoryListEnum.TAX_WITHHELD)) === null || _a === void 0 ? void 0 : _a.details.filter(function (details) { return details.section === section; }).reduce(function (sum, details) { return sum + details.amount; }, 0)) || 0;
2746
2749
  };
2747
- TaxReturnCategoryItemCollection.prototype.getTaxCreditsCollection = function () {
2750
+ ReportItemCollection.prototype.getTaxCreditsCollection = function () {
2748
2751
  var _a;
2749
- return new TaxReturnCategoryItemCollection(((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.TAX_CREDITS)) === null || _a === void 0 ? void 0 : _a.items) || []);
2752
+ return new ReportItemCollection(((_a = this.getByCategory(exports.TaxReturnCategoryListEnum.TAX_CREDITS)) === null || _a === void 0 ? void 0 : _a.items) || []);
2750
2753
  };
2751
- TaxReturnCategoryItemCollection.prototype.getTotalAmountByIncomeSourceName = function (name) {
2754
+ ReportItemCollection.prototype.getTotalAmountByIncomeSourceName = function (name) {
2752
2755
  return this.items.reduce((function (sum, item) { return sum + item.getAmountByIncomeSourceName(name); }), 0);
2753
2756
  };
2754
- TaxReturnCategoryItemCollection.prototype.getByCategory = function (category) {
2757
+ ReportItemCollection.prototype.getByCategory = function (category) {
2755
2758
  return this.items.find(function (item) { return item.taxReturnCategory.id === category; });
2756
2759
  };
2757
- return TaxReturnCategoryItemCollection;
2760
+ return ReportItemCollection;
2758
2761
  }(Collection));
2759
2762
 
2760
2763
  /**
@@ -4756,7 +4759,7 @@
4756
4759
  * net capital gain tax (includes tax exemptions)
4757
4760
  */
4758
4761
  Property.prototype.calculateNetCGT = function (sale) {
4759
- return this.getCGTExemptionRatio(sale) * this.calculateCGT(sale);
4762
+ return this.getCGTExemptionRatio(sale) * sale.cgt;
4760
4763
  };
4761
4764
  /**
4762
4765
  * guess tax exemption based on property details
@@ -4770,7 +4773,7 @@
4770
4773
  case this.category.id === PropertyCategoryListEnum.OWNER_OCCUPIED:
4771
4774
  return exports.TaxExemptionEnum.PPR;
4772
4775
  // exemption for investment properties owned for at least one year
4773
- case this.getOwnershipDuration(sale, 'years') >= 1:
4776
+ case this.isOneYearExemptionApplicable(sale):
4774
4777
  return exports.TaxExemptionEnum.ONE_YEAR_RULE;
4775
4778
  default:
4776
4779
  return null;
@@ -4793,7 +4796,7 @@
4793
4796
  // main residence become investment (exemption for home office percent usage)
4794
4797
  case exports.TaxExemptionEnum.PPR_TO_INVESTMENT:
4795
4798
  // 1 year CGT discount can still apply (on the income producing % if used for 12 months or more)
4796
- var ratio = this.getOwnershipDuration(sale, 'years') >= 1 ? 0.5 : 1;
4799
+ var ratio = this.isOneYearExemptionApplicable(sale) ? 0.5 : 1;
4797
4800
  return metadata.getClaimPercent() / 100 * ratio;
4798
4801
  // full exemption
4799
4802
  case exports.TaxExemptionEnum.PPR:
@@ -4806,6 +4809,9 @@
4806
4809
  return 1;
4807
4810
  }
4808
4811
  };
4812
+ Property.prototype.isOneYearExemptionApplicable = function (sale) {
4813
+ return sale.cgt > 0 && this.getOwnershipDuration(sale, 'years') > 0;
4814
+ };
4809
4815
  /**
4810
4816
  * ownership duration from purchase till sale
4811
4817
  */
@@ -6220,6 +6226,19 @@
6220
6226
  BankTransactionSummaryFieldsEnum["ALLOCATED_AMOUNT"] = "allocatedAmount";
6221
6227
  })(exports.BankTransactionSummaryFieldsEnum || (exports.BankTransactionSummaryFieldsEnum = {}));
6222
6228
 
6229
+ /**
6230
+ * Class describe configuration options for basiq connect control
6231
+ * https://www.npmjs.com/package/@basiq/basiq-connect-control
6232
+ */
6233
+ var BasiqConfig = /** @class */ (function () {
6234
+ function BasiqConfig(options) {
6235
+ // ID of the DOM element to which Basiq Connect Control will be rendered;
6236
+ this.containerId = 'basiq-control';
6237
+ Object.assign(this, options);
6238
+ }
6239
+ return BasiqConfig;
6240
+ }());
6241
+
6223
6242
  /**
6224
6243
  * access token, needed to access basiq connect ui (https://github.com/basiqio/basiq-connect-ui)
6225
6244
  */
@@ -7777,30 +7796,30 @@
7777
7796
  * Used in tax summary reports to show amounts relating to a tax return category entity and details of what this
7778
7797
  * amount is comprised of. Example here shows an amount of $951.96 and also details of what this amount is comprised of:
7779
7798
  */
7780
- var TaxReturnCategoryItem = /** @class */ (function () {
7781
- function TaxReturnCategoryItem() {
7799
+ var ReportItem = /** @class */ (function () {
7800
+ function ReportItem() {
7782
7801
  }
7783
7802
  /**
7784
7803
  * Get amount for one income source
7785
7804
  * @param name Name of income source for filter
7786
7805
  */
7787
- TaxReturnCategoryItem.prototype.getAmountByIncomeSourceName = function (name) {
7806
+ ReportItem.prototype.getAmountByIncomeSourceName = function (name) {
7788
7807
  var _a;
7789
7808
  return ((_a = this.details.find(function (detail) { return detail.name === name; })) === null || _a === void 0 ? void 0 : _a.amount) || 0;
7790
7809
  };
7791
- return TaxReturnCategoryItem;
7810
+ return ReportItem;
7792
7811
  }());
7793
7812
 
7794
7813
  /**
7795
7814
  * Used in tax summary reports to show specific details relating to an amount in the report.
7796
- * See structure in TaxReturnCategoryItem class.
7815
+ * See structure in ReportItem class.
7797
7816
  * Example an amount of $550 for property income could be comprised of 2 different property amounts of $300 and $250.
7798
7817
  * This is useful in providing drill-down information for the tax summary report.
7799
7818
  */
7800
- var TaxReturnCategoryItemDetails = /** @class */ (function () {
7801
- function TaxReturnCategoryItemDetails() {
7819
+ var ReportItemDetails = /** @class */ (function () {
7820
+ function ReportItemDetails() {
7802
7821
  }
7803
- return TaxReturnCategoryItemDetails;
7822
+ return ReportItemDetails;
7804
7823
  }());
7805
7824
 
7806
7825
  /**
@@ -7813,10 +7832,10 @@
7813
7832
  return TaxSummarySection;
7814
7833
  }());
7815
7834
  __decorate([
7816
- classTransformer.Type(function () { return TaxReturnCategoryItem; }),
7835
+ classTransformer.Type(function () { return ReportItem; }),
7817
7836
  classTransformer.Transform(function (_a) {
7818
7837
  var value = _a.value;
7819
- return new TaxReturnCategoryItemCollection(value);
7838
+ return new ReportItemCollection(value);
7820
7839
  })
7821
7840
  ], TaxSummarySection.prototype, "items", void 0);
7822
7841
  __decorate([
@@ -11393,17 +11412,24 @@
11393
11412
  }] });
11394
11413
 
11395
11414
  var SubscriptionService = /** @class */ (function () {
11396
- function SubscriptionService(http, eventDispatcherService, environment) {
11415
+ function SubscriptionService(http, eventDispatcherService, sseService, environment) {
11397
11416
  this.http = http;
11398
11417
  this.eventDispatcherService = eventDispatcherService;
11418
+ this.sseService = sseService;
11399
11419
  this.environment = environment;
11400
11420
  this.serviceSubscriptionSubject = new rxjs.ReplaySubject(1);
11401
11421
  this.serviceSubscriptionsSubject = new rxjs.ReplaySubject(1);
11402
11422
  this.servicePaymentsSubject = new rxjs.ReplaySubject(1);
11423
+ this.subscriptionChangeSubject = new rxjs.BehaviorSubject(null);
11424
+ this.listenEvents();
11403
11425
  }
11404
- SubscriptionService.prototype.getSubscription = function () {
11426
+ SubscriptionService.prototype.listenEvents = function () {
11427
+ this.listenSubscriptions();
11428
+ };
11429
+ SubscriptionService.prototype.getSubscription = function (force) {
11405
11430
  var _this = this;
11406
- if (!this._serviceSubscription) {
11431
+ if (force === void 0) { force = false; }
11432
+ if (!this._serviceSubscription || force) {
11407
11433
  this.http.get(this.environment.apiV2 + "/subscriptions/last")
11408
11434
  .pipe(operators.map(function (response) {
11409
11435
  return classTransformer.plainToClass(ServiceSubscription, response);
@@ -11430,8 +11456,18 @@
11430
11456
  .subscribe(function (prices) {
11431
11457
  _this._serviceSubscriptions = new ServiceSubscriptionCollection([
11432
11458
  classTransformer.plainToClass(ServiceSubscription, { items: [] }),
11433
- classTransformer.plainToClass(ServiceSubscription, { items: [classTransformer.plainToClass(ServiceSubscriptionItem, { price: prices.property, quantity: 2 })] }),
11434
- classTransformer.plainToClass(ServiceSubscription, { items: [classTransformer.plainToClass(ServiceSubscriptionItem, { price: prices.property, quantity: 3 })] })
11459
+ classTransformer.plainToClass(ServiceSubscription, {
11460
+ items: [classTransformer.plainToClass(ServiceSubscriptionItem, {
11461
+ price: prices.property,
11462
+ quantity: 2
11463
+ })]
11464
+ }),
11465
+ classTransformer.plainToClass(ServiceSubscription, {
11466
+ items: [classTransformer.plainToClass(ServiceSubscriptionItem, {
11467
+ price: prices.property,
11468
+ quantity: 3
11469
+ })]
11470
+ })
11435
11471
  ]);
11436
11472
  _this._serviceSubscriptions.items.forEach(function (subscription) {
11437
11473
  subscription.items.push(classTransformer.plainToClass(ServiceSubscriptionItem, { price: prices.work, quantity: 1 }));
@@ -11501,19 +11537,21 @@
11501
11537
  * Change subscription plan
11502
11538
  */
11503
11539
  SubscriptionService.prototype.changeSubscription = function (items) {
11540
+ return this.http.put(this.environment.apiV2 + "/subscriptions/items", items);
11541
+ };
11542
+ SubscriptionService.prototype.listenSubscriptions = function () {
11504
11543
  var _this = this;
11505
- return this.http.put(this.environment.apiV2 + "/subscriptions/items", items).pipe(operators.map(function () {
11506
- // Set cache value as null and fire request to backend to get updated subscription value
11507
- _this._serviceSubscription = null;
11508
- _this.serviceSubscriptionSubject.next(_this._serviceSubscription);
11509
- // update property list
11544
+ this.sseService.on("serviceSubscriptions")
11545
+ .pipe(operators.map(function (event) { return classTransformer.plainToClass(ServiceSubscription, event); }))
11546
+ .subscribe(function (subscription) {
11547
+ _this.getSubscription(true).subscribe();
11548
+ _this.subscriptionChangeSubject.next(subscription);
11510
11549
  _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED, null));
11511
- _this.getSubscription().subscribe();
11512
- }));
11550
+ });
11513
11551
  };
11514
11552
  return SubscriptionService;
11515
11553
  }());
11516
- SubscriptionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SubscriptionService, deps: [{ token: i1__namespace.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
11554
+ SubscriptionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SubscriptionService, deps: [{ token: i1__namespace.HttpClient }, { token: EventDispatcherService }, { token: SseService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
11517
11555
  SubscriptionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SubscriptionService, providedIn: 'root' });
11518
11556
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SubscriptionService, decorators: [{
11519
11557
  type: i0.Injectable,
@@ -11521,7 +11559,7 @@
11521
11559
  providedIn: 'root'
11522
11560
  }]
11523
11561
  }], ctorParameters: function () {
11524
- return [{ type: i1__namespace.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
11562
+ return [{ type: i1__namespace.HttpClient }, { type: EventDispatcherService }, { type: SseService }, { type: undefined, decorators: [{
11525
11563
  type: i0.Inject,
11526
11564
  args: ['environment']
11527
11565
  }] }];
@@ -12944,6 +12982,7 @@
12944
12982
  exports.BankTransactionChartData = BankTransactionChartData;
12945
12983
  exports.BankTransactionCollection = BankTransactionCollection;
12946
12984
  exports.BankTransactionService = BankTransactionService;
12985
+ exports.BasiqConfig = BasiqConfig;
12947
12986
  exports.BasiqJob = BasiqJob;
12948
12987
  exports.BasiqService = BasiqService;
12949
12988
  exports.BasiqToken = BasiqToken;
@@ -13069,6 +13108,9 @@
13069
13108
  exports.RegisterClientForm = RegisterClientForm;
13070
13109
  exports.RegisterFirmForm = RegisterFirmForm;
13071
13110
  exports.RegistrationInvite = RegistrationInvite;
13111
+ exports.ReportItem = ReportItem;
13112
+ exports.ReportItemCollection = ReportItemCollection;
13113
+ exports.ReportItemDetails = ReportItemDetails;
13072
13114
  exports.ResetPasswordForm = ResetPasswordForm;
13073
13115
  exports.SUBSCRIPTION_DESCRIPTION = SUBSCRIPTION_DESCRIPTION;
13074
13116
  exports.SUBSCRIPTION_TITLE = SUBSCRIPTION_TITLE;
@@ -13089,9 +13131,6 @@
13089
13131
  exports.TaxExemption = TaxExemption;
13090
13132
  exports.TaxExemptionMetadata = TaxExemptionMetadata;
13091
13133
  exports.TaxExemptionService = TaxExemptionService;
13092
- exports.TaxReturnCategoryItem = TaxReturnCategoryItem;
13093
- exports.TaxReturnCategoryItemCollection = TaxReturnCategoryItemCollection;
13094
- exports.TaxReturnCategoryItemDetails = TaxReturnCategoryItemDetails;
13095
13134
  exports.TaxReview = TaxReview;
13096
13135
  exports.TaxReviewCollection = TaxReviewCollection;
13097
13136
  exports.TaxReviewHistoryService = TaxReviewHistoryService;