taxtank-core 0.33.59 → 0.33.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. package/esm2022/src/lib/collections/asset-sale.collection.mjs +4 -1
  2. package/esm2022/src/lib/collections/collection-dictionary.mjs +10 -1
  3. package/esm2022/src/lib/collections/collection.mjs +1 -1
  4. package/esm2022/src/lib/collections/holding/holding-sale.collection.mjs +3 -3
  5. package/esm2022/src/lib/collections/holding/holding-trade.collection.mjs +78 -0
  6. package/esm2022/src/lib/collections/holding/holding.collection.mjs +19 -54
  7. package/esm2022/src/lib/collections/holding/index.mjs +3 -2
  8. package/esm2022/src/lib/db/Enums/holding/holding-trade-type.enum.mjs +6 -0
  9. package/esm2022/src/lib/db/Enums/holding/holding-type-category.enum.mjs +1 -1
  10. package/esm2022/src/lib/db/Enums/holding/index.mjs +2 -1
  11. package/esm2022/src/lib/db/Models/holding/holding-sale.mjs +1 -1
  12. package/esm2022/src/lib/db/Models/holding/holding-trade-import.mjs +3 -0
  13. package/esm2022/src/lib/db/Models/holding/holding-trade.mjs +3 -0
  14. package/esm2022/src/lib/db/Models/holding/index.mjs +2 -2
  15. package/esm2022/src/lib/forms/abstract.form.mjs +12 -2
  16. package/esm2022/src/lib/forms/bank/bank-account/bank-account-properties.form.mjs +3 -4
  17. package/esm2022/src/lib/forms/holding/holding-reinvest.form.mjs +14 -14
  18. package/esm2022/src/lib/forms/holding/holding-sale.form.mjs +3 -2
  19. package/esm2022/src/lib/forms/holding/holding-trade/holding-trade-filter.form.mjs +25 -0
  20. package/esm2022/src/lib/forms/holding/holding-trade/holding-trade.form.mjs +30 -0
  21. package/esm2022/src/lib/forms/holding/holding-trade/index.mjs +3 -0
  22. package/esm2022/src/lib/forms/holding/holding-trade-import.form.mjs +25 -0
  23. package/esm2022/src/lib/forms/holding/index.mjs +3 -3
  24. package/esm2022/src/lib/models/endpoint/endpoints.const.mjs +9 -9
  25. package/esm2022/src/lib/models/holding/holding-reinvest.mjs +4 -4
  26. package/esm2022/src/lib/models/holding/holding-sale.mjs +10 -1
  27. package/esm2022/src/lib/models/holding/holding-trade-import.mjs +16 -0
  28. package/esm2022/src/lib/models/holding/holding-trade.mjs +77 -0
  29. package/esm2022/src/lib/models/holding/holding-type-exchange.mjs +4 -1
  30. package/esm2022/src/lib/models/holding/holding-type.mjs +4 -1
  31. package/esm2022/src/lib/models/holding/holding.mjs +44 -71
  32. package/esm2022/src/lib/models/holding/index.mjs +4 -3
  33. package/esm2022/src/lib/services/account-setup/account-setup.service.mjs +3 -3
  34. package/esm2022/src/lib/services/http/holding/holding-trade-import/holding-trade-import-messages.enum.mjs +9 -0
  35. package/esm2022/src/lib/services/http/holding/holding-trade-import/holding-trade-import.service.mjs +37 -0
  36. package/esm2022/src/lib/services/http/holding/holding-trade-messages.enum.mjs +10 -0
  37. package/esm2022/src/lib/services/http/holding/holding-trade.service.mjs +44 -0
  38. package/esm2022/src/lib/services/http/holding/index.mjs +5 -6
  39. package/esm2022/src/lib/services/http/rest/rest.service.mjs +8 -6
  40. package/esm2022/src/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.mjs +5 -3
  41. package/fesm2022/taxtank-core.mjs +347 -193
  42. package/fesm2022/taxtank-core.mjs.map +1 -1
  43. package/package.json +1 -1
  44. package/src/lib/collections/asset-sale.collection.d.ts +3 -0
  45. package/src/lib/collections/collection-dictionary.d.ts +1 -0
  46. package/src/lib/collections/holding/holding-sale.collection.d.ts +4 -4
  47. package/src/lib/collections/holding/holding-trade.collection.d.ts +21 -0
  48. package/src/lib/collections/holding/holding.collection.d.ts +7 -10
  49. package/src/lib/collections/holding/index.d.ts +2 -1
  50. package/src/lib/db/Enums/holding/holding-trade-type.enum.d.ts +4 -0
  51. package/src/lib/db/Enums/holding/index.d.ts +1 -0
  52. package/src/lib/db/Models/holding/holding-sale.d.ts +2 -2
  53. package/src/lib/db/Models/holding/holding-trade-import.d.ts +8 -0
  54. package/src/lib/db/Models/holding/{holding.d.ts → holding-trade.d.ts} +1 -1
  55. package/src/lib/db/Models/holding/index.d.ts +1 -1
  56. package/src/lib/forms/abstract.form.d.ts +3 -1
  57. package/src/lib/forms/bank/bank-account/bank-account-properties.form.d.ts +1 -1
  58. package/src/lib/forms/holding/holding-reinvest.form.d.ts +5 -5
  59. package/src/lib/forms/holding/holding-sale.form.d.ts +2 -2
  60. package/src/lib/forms/holding/holding-trade/holding-trade-filter.form.d.ts +9 -0
  61. package/src/lib/forms/holding/holding-trade/holding-trade.form.d.ts +9 -0
  62. package/src/lib/forms/holding/holding-trade/index.d.ts +2 -0
  63. package/src/lib/forms/holding/holding-trade-import.form.d.ts +8 -0
  64. package/src/lib/forms/holding/index.d.ts +2 -2
  65. package/src/lib/models/holding/holding-reinvest.d.ts +2 -2
  66. package/src/lib/models/holding/holding-sale.d.ts +16 -4
  67. package/src/lib/models/holding/holding-trade-import.d.ts +8 -0
  68. package/src/lib/models/holding/holding-trade.d.ts +41 -0
  69. package/src/lib/models/holding/holding-type-exchange.d.ts +3 -0
  70. package/src/lib/models/holding/holding-type.d.ts +3 -0
  71. package/src/lib/models/holding/holding.d.ts +18 -34
  72. package/src/lib/models/holding/index.d.ts +3 -2
  73. package/src/lib/services/account-setup/account-setup.service.d.ts +2 -2
  74. package/src/lib/services/http/holding/{holding-import/holding-import-messages.enum.d.ts → holding-trade-import/holding-trade-import-messages.enum.d.ts} +1 -1
  75. package/src/lib/services/http/holding/holding-trade-import/holding-trade-import.service.d.ts +17 -0
  76. package/src/lib/services/http/holding/{holding-messages.enum.d.ts → holding-trade-messages.enum.d.ts} +1 -1
  77. package/src/lib/services/http/holding/holding-trade.service.d.ts +20 -0
  78. package/src/lib/services/http/holding/index.d.ts +4 -5
  79. package/src/lib/services/http/rest/rest.service.d.ts +4 -4
  80. package/src/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.d.ts +1 -3
  81. package/esm2022/src/lib/db/Models/holding/holding-import.mjs +0 -3
  82. package/esm2022/src/lib/db/Models/holding/holding.mjs +0 -3
  83. package/esm2022/src/lib/forms/holding/holding-import.form.mjs +0 -25
  84. package/esm2022/src/lib/forms/holding/holding.form.mjs +0 -28
  85. package/esm2022/src/lib/models/holding/holding-import.mjs +0 -16
  86. package/esm2022/src/lib/services/http/holding/holding-import/holding-import-messages.enum.mjs +0 -9
  87. package/esm2022/src/lib/services/http/holding/holding-import/holding-import.service.mjs +0 -37
  88. package/esm2022/src/lib/services/http/holding/holding-messages.enum.mjs +0 -10
  89. package/esm2022/src/lib/services/http/holding/holding-sale-messages.enum.mjs +0 -8
  90. package/esm2022/src/lib/services/http/holding/holding.service.mjs +0 -44
  91. package/src/lib/db/Models/holding/holding-import.d.ts +0 -8
  92. package/src/lib/forms/holding/holding-import.form.d.ts +0 -8
  93. package/src/lib/forms/holding/holding.form.d.ts +0 -8
  94. package/src/lib/models/holding/holding-import.d.ts +0 -8
  95. package/src/lib/services/http/holding/holding-import/holding-import.service.d.ts +0 -17
  96. package/src/lib/services/http/holding/holding-sale-messages.enum.d.ts +0 -6
  97. package/src/lib/services/http/holding/holding.service.d.ts +0 -20
@@ -636,7 +636,7 @@ class ServiceNotification extends AbstractModel {
636
636
  class TaxCalculation extends AbstractModel {
637
637
  }
638
638
 
639
- let Holding$1 = class Holding {
639
+ let HoldingTrade$1 = class HoldingTrade {
640
640
  };
641
641
 
642
642
  let HoldingType$1 = class HoldingType {
@@ -1259,6 +1259,12 @@ var HoldingTypeExchangeListEnum;
1259
1259
  HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["CC"] = 7] = "CC";
1260
1260
  })(HoldingTypeExchangeListEnum || (HoldingTypeExchangeListEnum = {}));
1261
1261
 
1262
+ var HoldingTradeTypeEnum;
1263
+ (function (HoldingTradeTypeEnum) {
1264
+ HoldingTradeTypeEnum[HoldingTradeTypeEnum["BUY"] = 1] = "BUY";
1265
+ HoldingTradeTypeEnum[HoldingTradeTypeEnum["SELL"] = 2] = "SELL";
1266
+ })(HoldingTradeTypeEnum || (HoldingTradeTypeEnum = {}));
1267
+
1262
1268
  var TaxReturnCategoryListEnum;
1263
1269
  (function (TaxReturnCategoryListEnum) {
1264
1270
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["SALARY"] = 1] = "SALARY";
@@ -1790,6 +1796,15 @@ class CollectionDictionary {
1790
1796
  this.items[key] = this.createCollection(obj[key]);
1791
1797
  });
1792
1798
  }
1799
+ filter(callback) {
1800
+ const collectionDictionary = new CollectionDictionary(this.createCollection());
1801
+ for (const key in this.items) {
1802
+ if (callback(this.get(key))) {
1803
+ collectionDictionary.add(key, this.get(key));
1804
+ }
1805
+ }
1806
+ return collectionDictionary;
1807
+ }
1793
1808
  }
1794
1809
 
1795
1810
  /**
@@ -9383,7 +9398,7 @@ class UserEventTypeCollection extends Collection {
9383
9398
  }
9384
9399
  }
9385
9400
 
9386
- class HoldingCollection extends ExportableCollection {
9401
+ class HoldingTradeCollection extends ExportableCollection {
9387
9402
  getExportHeader() {
9388
9403
  return ['Date', 'Ticker', 'Name', 'Asset type', 'Qty bought', 'Qty current', 'Buy price/Unit', 'Current price/Unit', 'Total MV', 'Profit/Loss'];
9389
9404
  }
@@ -9395,17 +9410,17 @@ class HoldingCollection extends ExportableCollection {
9395
9410
  getExportBody() {
9396
9411
  return this.items.map((holding) => [
9397
9412
  plainToClass(ExportCell, { value: holding.date, type: ExportCellTypeEnum.DATE }),
9398
- plainToClass(ExportCell, { value: holding.type.ticker, type: ExportCellTypeEnum.STRING }),
9413
+ plainToClass(ExportCell, { value: holding.holdingType.ticker, type: ExportCellTypeEnum.STRING }),
9399
9414
  plainToClass(ExportCell, {
9400
- value: holding.type.name,
9415
+ value: holding.holdingType.name,
9401
9416
  type: ExportCellTypeEnum.STRING
9402
9417
  }),
9403
- plainToClass(ExportCell, { value: holding.type.categoryLabel, type: ExportCellTypeEnum.STRING }),
9418
+ plainToClass(ExportCell, { value: holding.holdingType.categoryLabel, type: ExportCellTypeEnum.STRING }),
9404
9419
  plainToClass(ExportCell, { value: holding.quantity, type: ExportCellTypeEnum.STRING }),
9405
- plainToClass(ExportCell, { value: holding.currentQuantity, type: ExportCellTypeEnum.STRING }),
9420
+ // plainToClass(ExportCell, { value: holding.currentQuantity, type: ExportCellTypeEnum.STRING }),
9406
9421
  plainToClass(ExportCell, { value: holding.price, type: ExportCellTypeEnum.CURRENCY }),
9407
9422
  plainToClass(ExportCell, {
9408
- value: holding.type.price,
9423
+ value: holding.holdingType.price,
9409
9424
  type: ExportCellTypeEnum.CURRENCY
9410
9425
  }),
9411
9426
  plainToClass(ExportCell, {
@@ -9418,42 +9433,42 @@ class HoldingCollection extends ExportableCollection {
9418
9433
  }),
9419
9434
  ]);
9420
9435
  }
9436
+ getPurchases() {
9437
+ return this.filterBy('type', HoldingTradeTypeEnum.BUY);
9438
+ }
9439
+ getSales() {
9440
+ return this.filterBy('type', HoldingTradeTypeEnum.SELL);
9441
+ }
9421
9442
  getShares() {
9422
- return this.filterBy('type.category', HoldingTypeCategoryEnum.STOCK);
9443
+ return this.filterBy('holdingType.category', HoldingTypeCategoryEnum.STOCK);
9423
9444
  }
9424
9445
  getCryptos() {
9425
- return this.filterBy('type.category', HoldingTypeCategoryEnum.CRYPTO);
9446
+ return this.filterBy('holdingType.category', HoldingTypeCategoryEnum.CRYPTO);
9426
9447
  }
9427
9448
  getOthers() {
9428
- return this.filterBy('type.category', [
9449
+ return this.filterBy('holdingType.category', [
9429
9450
  HoldingTypeCategoryEnum.COLLECTIBLE,
9430
9451
  HoldingTypeCategoryEnum.UNLISTED_STOCK,
9431
9452
  HoldingTypeCategoryEnum.UNLISTED_UNIT,
9432
9453
  HoldingTypeCategoryEnum.OTHER
9433
9454
  ]);
9434
9455
  }
9435
- getPurchaseValue() {
9436
- return this.sumBy('purchaseValue');
9437
- }
9456
+ /**
9457
+ * @TODO vik remove, use holding.marketValue instead
9458
+ */
9438
9459
  get marketValue() {
9439
9460
  return this.sumBy('marketValue');
9440
9461
  }
9462
+ /**
9463
+ * @TODO vik remove, use holding.sharedMarketValue instead
9464
+ */
9441
9465
  get sharedMarketValue() {
9442
9466
  let sharedMarketValue = 0;
9443
- this.items.forEach(holding => {
9444
- sharedMarketValue += holding.ownershipPercent / 100 * holding.marketValue;
9467
+ this.items.forEach(trade => {
9468
+ sharedMarketValue += trade.ownershipPercent / 100 * trade.marketValue;
9445
9469
  });
9446
9470
  return sharedMarketValue;
9447
9471
  }
9448
- getGrowthCoefficient() {
9449
- return this.marketValue / this.getPurchaseValue() - 1;
9450
- }
9451
- getUnsold() {
9452
- return this.removeBy('currentQuantity', 0);
9453
- }
9454
- getUnrealisedProfit() {
9455
- return this.marketValue - this.getPurchaseValue();
9456
- }
9457
9472
  }
9458
9473
 
9459
9474
  class HoldingSaleCollection extends ExportableCollection {
@@ -9471,11 +9486,11 @@ class HoldingSaleCollection extends ExportableCollection {
9471
9486
  getExportBody(holdingsById) {
9472
9487
  return this.items.map((sale) => [
9473
9488
  plainToClass(ExportCell, {
9474
- value: holdingsById.get(sale.holding.id).type.ticker || '',
9489
+ value: holdingsById.get(sale.holding.id).holdingType.ticker || '',
9475
9490
  type: ExportCellTypeEnum.STRING
9476
9491
  }),
9477
9492
  plainToClass(ExportCell, {
9478
- value: holdingsById.get(sale.holding.id).type.categoryLabel,
9493
+ value: holdingsById.get(sale.holding.id).holdingType.categoryLabel,
9479
9494
  type: ExportCellTypeEnum.STRING
9480
9495
  }),
9481
9496
  plainToClass(ExportCell, { value: holdingsById.get(sale.holding.id)?.date, type: ExportCellTypeEnum.DATE }),
@@ -9504,6 +9519,46 @@ class HoldingTypeCollection extends Collection {
9504
9519
  }
9505
9520
  }
9506
9521
 
9522
+ class HoldingCollection extends Collection {
9523
+ static fromTrades(trades, holdingTypes) {
9524
+ const holdingTypesById = holdingTypes.indexBy('id');
9525
+ const tradesByHoldingType = trades.groupBy('holdingType.id');
9526
+ const items = [];
9527
+ for (const key in tradesByHoldingType.items) {
9528
+ if (tradesByHoldingType.get(key).sumBy('quantity') > 0) {
9529
+ items.push(new Holding(tradesByHoldingType.get(key), holdingTypesById.get(key)));
9530
+ }
9531
+ }
9532
+ return new HoldingCollection(items);
9533
+ }
9534
+ getShares() {
9535
+ return this.filterBy('type.category', HoldingTypeCategoryEnum.STOCK);
9536
+ }
9537
+ getCryptos() {
9538
+ return this.filterBy('type.category', HoldingTypeCategoryEnum.CRYPTO);
9539
+ }
9540
+ getOthers() {
9541
+ return this.filterBy('type.category', [
9542
+ HoldingTypeCategoryEnum.COLLECTIBLE,
9543
+ HoldingTypeCategoryEnum.UNLISTED_STOCK,
9544
+ HoldingTypeCategoryEnum.UNLISTED_UNIT,
9545
+ HoldingTypeCategoryEnum.OTHER
9546
+ ]);
9547
+ }
9548
+ get marketValue() {
9549
+ return this.sumBy('marketValue');
9550
+ }
9551
+ get purchaseValue() {
9552
+ return this.sumBy('purchaseValue');
9553
+ }
9554
+ getGrowthCoefficient() {
9555
+ return this.marketValue / this.purchaseValue - 1;
9556
+ }
9557
+ getPnl() {
9558
+ return this.marketValue - this.purchaseValue;
9559
+ }
9560
+ }
9561
+
9507
9562
  class AssetSaleCollection extends Collection {
9508
9563
  get grossCapitalProfit() {
9509
9564
  return this.filter((sale) => sale.grossCapitalGain > 0)
@@ -9512,6 +9567,9 @@ class AssetSaleCollection extends Collection {
9512
9567
  get fullExemptionSales() {
9513
9568
  return this.filter((sale) => sale.grossCapitalGain != 0 && sale.netCapitalGain == 0);
9514
9569
  }
9570
+ /**
9571
+ * true only for isTaxFree=true
9572
+ */
9515
9573
  get fullExemptionGrossCapitalProfit() {
9516
9574
  return this.filter((sale) => sale.grossCapitalGain > 0 && sale.netCapitalGain == 0).grossCapitalProfit;
9517
9575
  }
@@ -10431,6 +10489,9 @@ const DOCUMENT_FILE_TYPES = {
10431
10489
  ]
10432
10490
  };
10433
10491
 
10492
+ /**
10493
+ * @TODO rename 4521 to HoldingExchange when backend ready
10494
+ */
10434
10495
  class HoldingTypeExchange extends AbstractModel {
10435
10496
  }
10436
10497
  __decorate([
@@ -10440,6 +10501,9 @@ __decorate([
10440
10501
  Type(() => HoldingType)
10441
10502
  ], HoldingTypeExchange.prototype, "holdingTypes", void 0);
10442
10503
 
10504
+ /**
10505
+ * @TODO vik 4521 rename to Holding when backend ready
10506
+ */
10443
10507
  class HoldingType extends AbstractModel {
10444
10508
  /**
10445
10509
  * @TODO Alex move to translation file
@@ -10497,97 +10561,61 @@ __decorate([
10497
10561
  Type(() => HoldingTypeExchange)
10498
10562
  ], HoldingType.prototype, "exchange", void 0);
10499
10563
 
10500
- class HoldingSale extends AssetSale {
10501
- /**
10502
- * netCapitalGain is different from grossCapitalGain only when 1 year rule applied
10503
- */
10504
- isOneYearExemptionApplicable() {
10505
- return this.grossCapitalGain !== this.netCapitalGain;
10506
- }
10507
- get concession() {
10508
- return this.isOneYearExemptionApplicable() ? '50% (1 year rule)' : 'None';
10509
- }
10510
- getCostBase(holding) {
10511
- return this.getPurchasePrice(holding) + holding.fee;
10512
- }
10513
- /**
10514
- * Purchase price of sold items
10515
- */
10516
- getPurchasePrice(holding) {
10517
- return holding.price * this.quantity;
10518
- }
10519
- get netCost() {
10520
- return this.cost - this.fee;
10521
- }
10522
- get cost() {
10523
- return this.price * this.quantity;
10524
- }
10525
- }
10526
- __decorate([
10527
- Transform(({ value }) => ({ id: value.id }), { toPlainOnly: true })
10528
- ], HoldingSale.prototype, "holding", void 0);
10529
- __decorate([
10530
- Type(() => AppFile)
10531
- ], HoldingSale.prototype, "file", void 0);
10532
-
10533
- class Holding extends AbstractModel {
10564
+ class HoldingTrade extends AbstractModel {
10534
10565
  constructor() {
10535
10566
  super(...arguments);
10536
10567
  this.isTaxFree = false;
10568
+ this.quantity = 0;
10569
+ this.price = 0;
10570
+ this.type = HoldingTradeTypeEnum.BUY;
10571
+ }
10572
+ isPurchase() {
10573
+ return this.type === HoldingTradeTypeEnum.BUY;
10574
+ }
10575
+ get typeLabel() {
10576
+ return this.isPurchase() ? 'Buy' : 'Sell';
10537
10577
  }
10538
10578
  /**
10539
10579
  * Get total purchasing price
10540
10580
  */
10541
- get purchaseValue() {
10542
- const quantity = this.currentQuantity ?? this.quantity;
10543
- // Price and entity may be empty when we use HoldingForm.currentValue
10544
- if (!this.price || !this.quantity) {
10545
- return 0;
10546
- }
10547
- return this.price * quantity;
10581
+ get total() {
10582
+ return this.price * this.quantity;
10548
10583
  }
10549
10584
  /**
10550
- * Get current market price
10585
+ * @TODO vik remove
10551
10586
  */
10552
10587
  get marketValue() {
10553
- return this.currentQuantity * this.type.price;
10588
+ return this.quantity * this.holdingType.price;
10554
10589
  }
10555
10590
  /**
10556
10591
  * Get percent difference between current and buy price
10557
10592
  * @TODO vik/alex no need to pass holdingType, should come from backend
10558
10593
  */
10559
10594
  get growthCoefficient() {
10560
- return this.type.price / this.price - 1;
10595
+ return this.holdingType.price / this.price - 1;
10561
10596
  }
10562
10597
  heldMoreYear() {
10563
10598
  const yearTime = 1000 * 60 * 60 * 24 * 365;
10564
10599
  return (new FinancialYear().startDate.getTime() - this.date.getTime()) > yearTime;
10565
10600
  }
10566
- isSold() {
10567
- return this.currentQuantity === 0;
10568
- }
10569
10601
  }
10570
10602
  __decorate([
10571
10603
  Type(() => Date)
10572
- ], Holding.prototype, "date", void 0);
10604
+ ], HoldingTrade.prototype, "date", void 0);
10573
10605
  __decorate([
10574
10606
  Type(() => User)
10575
- ], Holding.prototype, "user", void 0);
10607
+ ], HoldingTrade.prototype, "user", void 0);
10576
10608
  __decorate([
10577
10609
  Type(() => HoldingType)
10578
- ], Holding.prototype, "type", void 0);
10610
+ ], HoldingTrade.prototype, "holdingType", void 0);
10579
10611
  __decorate([
10580
10612
  Type(() => AppFile)
10581
- ], Holding.prototype, "file", void 0);
10582
- __decorate([
10583
- Type(() => HoldingSale),
10584
- Transform(({ value }) => new Collection(value))
10585
- ], Holding.prototype, "sales", void 0);
10613
+ ], HoldingTrade.prototype, "file", void 0);
10586
10614
  __decorate([
10587
10615
  Transform(({ obj }) => {
10588
- const type = plainToClass(HoldingType, obj.type);
10589
- if (type) {
10590
- return type.isOther() ? null : type.category;
10616
+ const holdingType = plainToClass(HoldingType, obj.holdingType);
10617
+ if (holdingType) {
10618
+ return holdingType.isOther() ? null : holdingType.category;
10591
10619
  }
10592
10620
  if (obj.category) {
10593
10621
  return [
@@ -10600,7 +10628,49 @@ __decorate([
10600
10628
  return HoldingTypeCategoryEnum.STOCK;
10601
10629
  }, { toClassOnly: true }),
10602
10630
  Expose({ toClassOnly: true })
10603
- ], Holding.prototype, "category", void 0);
10631
+ ], HoldingTrade.prototype, "category", void 0);
10632
+
10633
+ /**
10634
+ * @TODO vik rename to HoldingTradeParcel when backend ready
10635
+ */
10636
+ class HoldingSale extends AssetSale {
10637
+ /**
10638
+ * netCapitalGain is different from grossCapitalGain only when 1 year rule applied
10639
+ */
10640
+ isOneYearExemptionApplicable() {
10641
+ return this.grossCapitalGain !== this.netCapitalGain;
10642
+ }
10643
+ get concession() {
10644
+ return this.isOneYearExemptionApplicable() ? '50% (1 year rule)' : 'None';
10645
+ }
10646
+ getCostBase(holding) {
10647
+ return this.getPurchasePrice(holding) + holding.fee;
10648
+ }
10649
+ /**
10650
+ * Purchase price of sold items
10651
+ */
10652
+ getPurchasePrice(holding) {
10653
+ return holding.price * this.quantity;
10654
+ }
10655
+ /**
10656
+ * total price of sale
10657
+ */
10658
+ get netCost() {
10659
+ return this.cost - this.fee;
10660
+ }
10661
+ /**
10662
+ * total price of sale without fee
10663
+ */
10664
+ get cost() {
10665
+ return this.price * this.quantity;
10666
+ }
10667
+ }
10668
+ __decorate([
10669
+ Transform(({ value }) => ({ id: value.id }), { toPlainOnly: true })
10670
+ ], HoldingSale.prototype, "holding", void 0);
10671
+ __decorate([
10672
+ Type(() => AppFile)
10673
+ ], HoldingSale.prototype, "file", void 0);
10604
10674
 
10605
10675
  /**
10606
10676
  * Helper class for holding reinvest functionality.
@@ -10612,24 +10682,78 @@ __decorate([
10612
10682
  Type(() => Transaction)
10613
10683
  ], HoldingReinvest.prototype, "transaction", void 0);
10614
10684
  __decorate([
10615
- Type(() => Holding)
10616
- ], HoldingReinvest.prototype, "holding", void 0);
10685
+ Type(() => HoldingTrade)
10686
+ ], HoldingReinvest.prototype, "trade", void 0);
10617
10687
  __decorate([
10618
10688
  Type(() => HoldingType)
10619
10689
  ], HoldingReinvest.prototype, "holdingType", void 0);
10620
10690
 
10621
- class HoldingImport extends ObservableModel {
10622
- static { this.className = 'HoldingImport'; }
10691
+ class HoldingTradeImport extends ObservableModel {
10692
+ static { this.className = 'HoldingTradeImport'; }
10623
10693
  }
10624
10694
  __decorate([
10625
10695
  Type(() => Date)
10626
- ], HoldingImport.prototype, "createdAt", void 0);
10696
+ ], HoldingTradeImport.prototype, "createdAt", void 0);
10627
10697
  __decorate([
10628
10698
  Type(() => Date)
10629
- ], HoldingImport.prototype, "updatedAt", void 0);
10699
+ ], HoldingTradeImport.prototype, "updatedAt", void 0);
10630
10700
  __decorate([
10631
- Type(() => Holding$1)
10632
- ], HoldingImport.prototype, "holdings", void 0);
10701
+ Type(() => HoldingTrade$1)
10702
+ ], HoldingTradeImport.prototype, "holdings", void 0);
10703
+
10704
+ class Holding extends AbstractModel {
10705
+ constructor(trades, type) {
10706
+ super();
10707
+ this.trades = trades;
10708
+ this.type = type;
10709
+ this.quantity = this.getQuantity();
10710
+ this.purchaseValue = this.getPurchaseValue();
10711
+ this.marketValue = this.getMarketValue();
10712
+ this.avgPrice = this.getAvgPrice();
10713
+ this.pnl = this.getPnl();
10714
+ }
10715
+ getQuantity() {
10716
+ return this.trades.getPurchases().sumBy('quantity') - this.trades.getSales().sumBy('quantity');
10717
+ }
10718
+ getPurchaseValue() {
10719
+ let remainingQuantity = this.quantity;
10720
+ let totalCost = 0;
10721
+ this.trades.getPurchases().items.forEach(trade => {
10722
+ if (remainingQuantity <= 0) {
10723
+ return;
10724
+ }
10725
+ const applicableQuantity = Math.min(trade.quantity, remainingQuantity);
10726
+ totalCost += applicableQuantity * trade.price + trade.fee;
10727
+ remainingQuantity -= applicableQuantity;
10728
+ });
10729
+ return totalCost;
10730
+ }
10731
+ getMarketValue() {
10732
+ return this.quantity * this.type.price;
10733
+ }
10734
+ getAvgPrice() {
10735
+ return this.purchaseValue / this.quantity;
10736
+ }
10737
+ /**
10738
+ * profit and loss
10739
+ */
10740
+ getPnl() {
10741
+ return this.marketValue - this.purchaseValue;
10742
+ }
10743
+ getSharedMarketValue() {
10744
+ let sharedMarketValue = 0;
10745
+ this.trades.items.forEach(holding => {
10746
+ sharedMarketValue += holding.ownershipPercent / 100 * holding.marketValue;
10747
+ });
10748
+ return sharedMarketValue;
10749
+ }
10750
+ getGrowthCoefficient() {
10751
+ return this.marketValue / this.purchaseValue - 1;
10752
+ }
10753
+ getUnrealisedProfit() {
10754
+ return this.marketValue - this.purchaseValue;
10755
+ }
10756
+ }
10633
10757
 
10634
10758
  class BudgetRule extends BudgetRule$1 {
10635
10759
  }
@@ -11225,11 +11349,7 @@ let RestService$1 = class RestService extends DataService {
11225
11349
  * @TODO: TT-4642 check customHttpErrorMessages fix change to backend errors
11226
11350
  */
11227
11351
  this.useBackendError = false;
11228
- /**
11229
- * messages that can be redefined in other classes to customize httpErrorMessages
11230
- */
11231
- this.customHttpErrorMessages = {};
11232
- this.httpErrorMessages = { ...HTTP_ERROR_MESSAGES, ...this.customHttpErrorMessages };
11352
+ this.httpErrorMessages = { ...HTTP_ERROR_MESSAGES, ...this.getCustomHttpErrorMessages() };
11233
11353
  }
11234
11354
  get apiUrl() {
11235
11355
  return `${this.environment.apiV2}/${this.endpointUri}`;
@@ -11372,6 +11492,12 @@ let RestService$1 = class RestService extends DataService {
11372
11492
  }
11373
11493
  }), catchError((error) => this.handleError(error)));
11374
11494
  }
11495
+ /**
11496
+ * method with messages that can be redefined in other classes to customize httpErrorMessages
11497
+ */
11498
+ getCustomHttpErrorMessages() {
11499
+ return {};
11500
+ }
11375
11501
  /**
11376
11502
  * Handle response errors - shows error in toast
11377
11503
  * and throws error further
@@ -15268,8 +15394,10 @@ class AllocationRuleService extends RestService$1 {
15268
15394
  this.endpointUri = 'allocation-rules';
15269
15395
  this.collectionClass = AllocationRuleCollection;
15270
15396
  this.modelClass = AllocationRule;
15271
- // @TODO: TT-4642 check customHttpErrorMessages fix change to backend errors
15272
- this.customHttpErrorMessages = { 422: 'You can only have 10 conditions in a rule' };
15397
+ }
15398
+ // @TODO: TT-4642 check customHttpErrorMessages fix change to backend errors
15399
+ getCustomHttpErrorMessages() {
15400
+ return { 422: 'You can only have 10 conditions in a rule' };
15273
15401
  }
15274
15402
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AllocationRuleService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
15275
15403
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AllocationRuleService, providedIn: 'root' }); }
@@ -16215,13 +16343,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
16215
16343
  args: ['environment']
16216
16344
  }] }] });
16217
16345
 
16218
- class HoldingService extends RestService$1 {
16346
+ class HoldingTradeService extends RestService$1 {
16219
16347
  constructor(environment) {
16220
16348
  super(environment);
16221
16349
  this.environment = environment;
16222
- this.modelClass = Holding;
16223
- this.collectionClass = HoldingCollection;
16224
- this.endpointUri = 'holdings';
16350
+ this.modelClass = HoldingTrade;
16351
+ this.collectionClass = HoldingTradeCollection;
16352
+ this.endpointUri = 'holding-trades';
16225
16353
  this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
16226
16354
  this.roles = [UserRolesEnum.HOLDING_TANK];
16227
16355
  this.listenEvents();
@@ -16229,7 +16357,7 @@ class HoldingService extends RestService$1 {
16229
16357
  }
16230
16358
  listenEvents() {
16231
16359
  this.listenCSE(HoldingSale, this.refreshCache, ['post', 'put', 'delete']);
16232
- this.listenCSE(HoldingImport, this.refreshCache, ['post', 'put', 'delete']);
16360
+ this.listenCSE(HoldingTradeImport, this.refreshCache, ['post', 'put', 'delete']);
16233
16361
  }
16234
16362
  listenNotifications() {
16235
16363
  this.eventDispatcherService.on(AppEventTypeEnum.NOTIFICATION_ADDED).subscribe((notification) => {
@@ -16238,10 +16366,10 @@ class HoldingService extends RestService$1 {
16238
16366
  }
16239
16367
  });
16240
16368
  }
16241
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
16242
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingService, providedIn: 'root' }); }
16369
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingTradeService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
16370
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingTradeService, providedIn: 'root' }); }
16243
16371
  }
16244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingService, decorators: [{
16372
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingTradeService, decorators: [{
16245
16373
  type: Injectable,
16246
16374
  args: [{
16247
16375
  providedIn: 'root'
@@ -16288,12 +16416,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
16288
16416
  }]
16289
16417
  }] });
16290
16418
 
16291
- class HoldingImportService extends RestService$1 {
16419
+ class HoldingTradeImportService extends RestService$1 {
16292
16420
  constructor() {
16293
16421
  super(...arguments);
16294
- this.modelClass = HoldingImport;
16422
+ this.modelClass = HoldingTradeImport;
16295
16423
  this.collectionClass = (Collection);
16296
- this.endpointUri = 'holding-imports';
16424
+ this.endpointUri = 'holding-trade-imports';
16297
16425
  this.disabledMethods = ['post', 'postBatch', 'putBatch', 'deleteBatch'];
16298
16426
  this.roles = [UserRolesEnum.HOLDING_TANK];
16299
16427
  }
@@ -16303,29 +16431,29 @@ class HoldingImportService extends RestService$1 {
16303
16431
  formData.append('exchangeId', exchangeId.toString());
16304
16432
  formData.append('isTaxFree', (isTaxFree ? 1 : 0).toString());
16305
16433
  return this.http.post(this.apiUrl, formData).pipe(map((response) => {
16306
- const holdingImport = this.createModelInstance(response);
16307
- this.handleResponse([holdingImport], 'post');
16308
- return holdingImport;
16434
+ const holdingTradeImport = this.createModelInstance(response);
16435
+ this.handleResponse([holdingTradeImport], 'post');
16436
+ return holdingTradeImport;
16309
16437
  }));
16310
16438
  }
16311
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingImportService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
16312
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingImportService, providedIn: 'root' }); }
16439
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingTradeImportService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
16440
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingTradeImportService, providedIn: 'root' }); }
16313
16441
  }
16314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingImportService, decorators: [{
16442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingTradeImportService, decorators: [{
16315
16443
  type: Injectable,
16316
16444
  args: [{
16317
16445
  providedIn: 'root'
16318
16446
  }]
16319
16447
  }] });
16320
16448
 
16321
- var HoldingImportMessagesEnum;
16322
- (function (HoldingImportMessagesEnum) {
16323
- HoldingImportMessagesEnum["CREATED"] = "Import created successfully";
16324
- HoldingImportMessagesEnum["UPDATED"] = "Import updated successfully";
16325
- HoldingImportMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this import?";
16326
- HoldingImportMessagesEnum["DELETED"] = "Import deleted successfully";
16327
- HoldingImportMessagesEnum["DELETE_ERROR"] = "Import including sold assets can not be deleted";
16328
- })(HoldingImportMessagesEnum || (HoldingImportMessagesEnum = {}));
16449
+ var HoldingTradeImportMessagesEnum;
16450
+ (function (HoldingTradeImportMessagesEnum) {
16451
+ HoldingTradeImportMessagesEnum["CREATED"] = "Import created successfully";
16452
+ HoldingTradeImportMessagesEnum["UPDATED"] = "Import updated successfully";
16453
+ HoldingTradeImportMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this import?";
16454
+ HoldingTradeImportMessagesEnum["DELETED"] = "Import deleted successfully";
16455
+ HoldingTradeImportMessagesEnum["DELETE_ERROR"] = "Import including sold assets can not be deleted";
16456
+ })(HoldingTradeImportMessagesEnum || (HoldingTradeImportMessagesEnum = {}));
16329
16457
 
16330
16458
  var HoldingTypeExchanges = [
16331
16459
  {
@@ -16424,23 +16552,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
16424
16552
  }]
16425
16553
  }], ctorParameters: () => [] });
16426
16554
 
16427
- var HoldingMessagesEnum;
16428
- (function (HoldingMessagesEnum) {
16429
- HoldingMessagesEnum["CREATED"] = "Holding created successfully";
16430
- HoldingMessagesEnum["UPDATED"] = "Holding updated successfully";
16431
- HoldingMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this holding?";
16432
- HoldingMessagesEnum["DELETED"] = "Holding deleted successfully";
16433
- HoldingMessagesEnum["DELETE_ASSET_ERROR"] = "In the \"SOLD\" section click on the \"REDO\" button for the current asset";
16434
- HoldingMessagesEnum["REINVESTED"] = "Reinvested successfully";
16435
- })(HoldingMessagesEnum || (HoldingMessagesEnum = {}));
16436
-
16437
- var HoldingSaleMessagesEnum;
16438
- (function (HoldingSaleMessagesEnum) {
16439
- HoldingSaleMessagesEnum["CREATED"] = "Holding sold successfully";
16440
- HoldingSaleMessagesEnum["UPDATED"] = "Sale updated successfully";
16441
- HoldingSaleMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this holding sale?";
16442
- HoldingSaleMessagesEnum["DELETED"] = "Sale deleted successfully";
16443
- })(HoldingSaleMessagesEnum || (HoldingSaleMessagesEnum = {}));
16555
+ var HoldingTradeMessagesEnum;
16556
+ (function (HoldingTradeMessagesEnum) {
16557
+ HoldingTradeMessagesEnum["CREATED"] = "Holding created successfully";
16558
+ HoldingTradeMessagesEnum["UPDATED"] = "Holding updated successfully";
16559
+ HoldingTradeMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this holding?";
16560
+ HoldingTradeMessagesEnum["DELETED"] = "Holding deleted successfully";
16561
+ HoldingTradeMessagesEnum["DELETE_ASSET_ERROR"] = "In the \"SOLD\" section click on the \"REDO\" button for the current asset";
16562
+ HoldingTradeMessagesEnum["REINVESTED"] = "Reinvested successfully";
16563
+ })(HoldingTradeMessagesEnum || (HoldingTradeMessagesEnum = {}));
16444
16564
 
16445
16565
  var HoldingTypeMessagesEnum;
16446
16566
  (function (HoldingTypeMessagesEnum) {
@@ -18878,7 +18998,7 @@ class AccountSetupService {
18878
18998
  }
18879
18999
  return this.setItemStatus(this.items.findBy('isBankFeeds', true), this.bankAccountsService.getArray());
18880
19000
  }
18881
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSetupService, deps: [{ token: SetupItemService }, { token: PropertyService }, { token: IncomeSourceService }, { token: BankAccountService }, { token: TransactionAllocationService }, { token: VehicleClaimService }, { token: TransactionService }, { token: SoleBusinessService }, { token: HoldingService }, { token: UserService }, { token: ClientMovementService }, { token: ClientInviteService }, { token: EmployeeService }, { token: EmployeeInviteService }, { token: FirmService }], target: i0.ɵɵFactoryTarget.Injectable }); }
19001
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSetupService, deps: [{ token: SetupItemService }, { token: PropertyService }, { token: IncomeSourceService }, { token: BankAccountService }, { token: TransactionAllocationService }, { token: VehicleClaimService }, { token: TransactionService }, { token: SoleBusinessService }, { token: HoldingTradeService }, { token: UserService }, { token: ClientMovementService }, { token: ClientInviteService }, { token: EmployeeService }, { token: EmployeeInviteService }, { token: FirmService }], target: i0.ɵɵFactoryTarget.Injectable }); }
18882
19002
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSetupService, providedIn: 'root' }); }
18883
19003
  }
18884
19004
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSetupService, decorators: [{
@@ -18886,7 +19006,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
18886
19006
  args: [{
18887
19007
  providedIn: 'root'
18888
19008
  }]
18889
- }], ctorParameters: () => [{ type: SetupItemService }, { type: PropertyService }, { type: IncomeSourceService }, { type: BankAccountService }, { type: TransactionAllocationService }, { type: VehicleClaimService }, { type: TransactionService }, { type: SoleBusinessService }, { type: HoldingService }, { type: UserService }, { type: ClientMovementService }, { type: ClientInviteService }, { type: EmployeeService }, { type: EmployeeInviteService }, { type: FirmService }] });
19009
+ }], ctorParameters: () => [{ type: SetupItemService }, { type: PropertyService }, { type: IncomeSourceService }, { type: BankAccountService }, { type: TransactionAllocationService }, { type: VehicleClaimService }, { type: TransactionService }, { type: SoleBusinessService }, { type: HoldingTradeService }, { type: UserService }, { type: ClientMovementService }, { type: ClientInviteService }, { type: EmployeeService }, { type: EmployeeInviteService }, { type: FirmService }] });
18890
19010
 
18891
19011
  const KEY = '_switch_user';
18892
19012
  /**
@@ -19907,10 +20027,10 @@ const ENDPOINTS = {
19907
20027
  LOANS_PAYOUT_DELETE: new Endpoint('DELETE', '\\/loans\\/\\d+\\/payout\\/\\d+'),
19908
20028
  LOANS_CALCULATION_POST: new Endpoint('POST', '\\/bank-accounts\\/loans\\/calculation'),
19909
20029
  LOGIN_POST: new Endpoint('POST', '\\/login'),
19910
- HOLDINGS_GET: new Endpoint('GET', '\\/holdings'),
19911
- HOLDINGS_POST: new Endpoint('POST', '\\/holdings'),
19912
- HOLDINGS_PUT: new Endpoint('PUT', '\\/holdings\\/\\d+'),
19913
- HOLDINGS_DELETE: new Endpoint('DELETE', '\\/holdings\\/\\d+'),
20030
+ HOLDING_TRADE_GET: new Endpoint('GET', '\\/holding-trades'),
20031
+ HOLDING_TRADE_POST: new Endpoint('POST', '\\/holding-trades'),
20032
+ HOLDING_TRADE_PUT: new Endpoint('PUT', '\\/holding-trades\\/\\d+'),
20033
+ HOLDING_TRADE_DELETE: new Endpoint('DELETE', '\\/holding-trades\\/\\d+'),
19914
20034
  HOLDING_TYPES_GET: new Endpoint('GET', '\\/holding-types'),
19915
20035
  HOLDING_TYPES_POST: new Endpoint('POST', '\\/holding-types'),
19916
20036
  HOLDING_TYPES_PUT: new Endpoint('PUT', '\\/holding-types\\/\\d+'),
@@ -19919,10 +20039,10 @@ const ENDPOINTS = {
19919
20039
  HOLDING_SALES_POST: new Endpoint('POST', '\\/holding-sales'),
19920
20040
  HOLDING_SALES_PUT: new Endpoint('PUT', '\\/holding-sales\\/\\d+'),
19921
20041
  HOLDING_SALES_DELETE: new Endpoint('DELETE', '\\/holding-sales\\/\\d+'),
19922
- HOLDING_IMPORTS_GET: new Endpoint('GET', '\\/holding-imports'),
19923
- HOLDING_IMPORTS_POST: new Endpoint('POST', '\\/holding-imports'),
19924
- HOLDING_IMPORTS_PUT: new Endpoint('PUT', '\\/holding-imports\\/\\d+'),
19925
- HOLDING_IMPORTS_DELETE: new Endpoint('DELETE', '\\/holding-imports\\/\\d+'),
20042
+ HOLDING_TRADE_IMPORTS_GET: new Endpoint('GET', '\\/holding-trade-imports'),
20043
+ HOLDING_TRADE_IMPORTS_POST: new Endpoint('POST', '\\/holding-trade-imports'),
20044
+ HOLDING_TRADE_IMPORTS_PUT: new Endpoint('PUT', '\\/holding-trade-imports\\/\\d+'),
20045
+ HOLDING_TRADE_IMPORTS_DELETE: new Endpoint('DELETE', '\\/holding-trade-imports\\/\\d+'),
19926
20046
  NOTIFICATIONS_GET: new Endpoint('GET', '\\/service-notifications'),
19927
20047
  OCCUPATIONS_GET: new Endpoint('GET', '\\/occupations'),
19928
20048
  PROPERTIES_GET: new Endpoint('GET', '\\/properties'),
@@ -20757,7 +20877,12 @@ class AbstractForm extends FormGroup {
20757
20877
  return this.createModelInstance(Object.assign({}, this.model, this.getRawValue()));
20758
20878
  }
20759
20879
  toggleEnabledState(control) {
20760
- control.enabled ? control.disable() : control.enable();
20880
+ if (control) {
20881
+ control.enabled ? control.disable() : control.enable();
20882
+ }
20883
+ else {
20884
+ this.enabled ? this.disable() : this.enable();
20885
+ }
20761
20886
  }
20762
20887
  /**
20763
20888
  * Check validation and return a new instance of generic model.
@@ -20864,6 +20989,10 @@ class AbstractForm extends FormGroup {
20864
20989
  control.enable(opts);
20865
20990
  });
20866
20991
  }
20992
+ controlsChanges(controlNames) {
20993
+ const controls = controlNames.map(controlName => this.get(controlName));
20994
+ return combineLatest(controls.map(control => control.valueChanges));
20995
+ }
20867
20996
  }
20868
20997
 
20869
20998
  class CollectionForm extends FormArray {
@@ -24344,10 +24473,60 @@ class DepreciationForm extends TransactionBaseForm {
24344
24473
  }
24345
24474
  }
24346
24475
 
24476
+ class HoldingTradeForm extends AbstractForm {
24477
+ constructor(holdingTrade) {
24478
+ super({
24479
+ category: new UntypedFormControl(holdingTrade.category),
24480
+ isTaxFree: new UntypedFormControl(holdingTrade.isTaxFree, Validators.required),
24481
+ type: new UntypedFormControl(holdingTrade.type, Validators.required),
24482
+ quantity: new UntypedFormControl(holdingTrade.quantity, [Validators.required, greaterThanValidator(0)]),
24483
+ price: new UntypedFormControl(holdingTrade.price, [Validators.required, Validators.min(0)]),
24484
+ fee: new UntypedFormControl(holdingTrade.fee, [Validators.required, Validators.min(0)]),
24485
+ date: new UntypedFormControl(holdingTrade.date, Validators.required),
24486
+ holdingType: new UntypedFormControl(holdingTrade.holdingType, Validators.required),
24487
+ ownershipPercent: new UntypedFormControl(holdingTrade.ownershipPercent || 100, Validators.required),
24488
+ file: new UntypedFormControl(holdingTrade.file)
24489
+ }, holdingTrade);
24490
+ this.purchaseValue = 0;
24491
+ this.listenEvents();
24492
+ }
24493
+ listenEvents() {
24494
+ this.controlsChanges(['quantity', 'price', 'fee']).subscribe(([quantity, price, fee]) => {
24495
+ this.purchaseValue = quantity * price + fee;
24496
+ });
24497
+ }
24498
+ submit(data = {}, includeDisabledFields = false) {
24499
+ return super.submit(data, includeDisabledFields);
24500
+ }
24501
+ }
24502
+
24503
+ class HoldingTradeFilterForm extends AbstractForm {
24504
+ constructor() {
24505
+ super({
24506
+ category: new UntypedFormControl(),
24507
+ isTaxFree: new UntypedFormControl(false),
24508
+ });
24509
+ this.categories = [];
24510
+ this.get('category').valueChanges.subscribe(category => {
24511
+ this.categories = category === HoldingTypeCategoryEnum.OTHER
24512
+ ? [HoldingTypeCategoryEnum.OTHER, HoldingTypeCategoryEnum.COLLECTIBLE, HoldingTypeCategoryEnum.UNLISTED_STOCK, HoldingTypeCategoryEnum.UNLISTED_UNIT]
24513
+ : [category];
24514
+ });
24515
+ }
24516
+ filter(trades) {
24517
+ let filteredTrades = trades.filterBy('isTaxFree', this.value.isTaxFree);
24518
+ if (this.categories.length) {
24519
+ filteredTrades = filteredTrades.filterBy('holdingType.category', this.categories);
24520
+ }
24521
+ return filteredTrades;
24522
+ }
24523
+ }
24524
+
24347
24525
  class HoldingSaleForm extends AbstractForm {
24348
24526
  constructor(sale, holding, type, isResident) {
24349
24527
  super({
24350
- quantity: new UntypedFormControl(sale.quantity, [Validators.required, Validators.max(holding.currentQuantity + sale.quantity), greaterThanValidator(0)]),
24528
+ // @TODO Validators.max(holding.currentQuantity + sale.quantity)
24529
+ quantity: new UntypedFormControl(sale.quantity, [Validators.required, greaterThanValidator(0)]),
24351
24530
  price: new UntypedFormControl(sale.price || type.price, Validators.required),
24352
24531
  fee: new UntypedFormControl(sale.fee, Validators.required),
24353
24532
  date: new UntypedFormControl(sale.date, Validators.required),
@@ -24403,31 +24582,6 @@ class HoldingTypeForm extends AbstractForm {
24403
24582
  }
24404
24583
  }
24405
24584
 
24406
- class HoldingForm extends AbstractForm {
24407
- constructor(holding) {
24408
- super({
24409
- category: new UntypedFormControl(holding.category),
24410
- isTaxFree: new UntypedFormControl(holding.isTaxFree, Validators.required),
24411
- quantity: new UntypedFormControl(holding.quantity, [Validators.required, greaterThanValidator(0)]),
24412
- price: new UntypedFormControl(holding.price, [Validators.required, Validators.min(0)]),
24413
- fee: new UntypedFormControl(holding.fee, [Validators.required, Validators.min(0)]),
24414
- date: new UntypedFormControl(holding.date, Validators.required),
24415
- type: new UntypedFormControl(holding.type, Validators.required),
24416
- ownershipPercent: new UntypedFormControl(holding.ownershipPercent || 100, Validators.required),
24417
- file: new UntypedFormControl(holding.file)
24418
- }, holding);
24419
- this.listenEvents();
24420
- }
24421
- listenEvents() {
24422
- this.get('category').valueChanges.subscribe((category) => {
24423
- this.get('type').setValue(null);
24424
- });
24425
- }
24426
- submit(data = {}, includeDisabledFields = false) {
24427
- return super.submit(data, includeDisabledFields);
24428
- }
24429
- }
24430
-
24431
24585
  /**
24432
24586
  * @TODO vik TT-4048
24433
24587
  */
@@ -24437,7 +24591,7 @@ class HoldingReinvestForm extends AbstractForm {
24437
24591
  // the difference between dividends amount and given shares (shares=dividendsAmount/sharePrice)
24438
24592
  cashVariance: new FormControl({ value: 0, disabled: true }, Validators.required),
24439
24593
  transaction: new HoldingIncomeForm(reinvest.transaction, null, []),
24440
- holding: new HoldingForm(reinvest.holding)
24594
+ trade: new HoldingTradeForm(reinvest.trade)
24441
24595
  }, reinvest);
24442
24596
  this.reinvest = reinvest;
24443
24597
  this.listenEvents();
@@ -24452,15 +24606,15 @@ class HoldingReinvestForm extends AbstractForm {
24452
24606
  });
24453
24607
  }
24454
24608
  listenEvents() {
24455
- this.listenHoldingChanges();
24609
+ this.listenTradeChanges();
24456
24610
  this.listenDateChanges();
24457
24611
  this.listenAmountChanges();
24458
24612
  }
24459
24613
  get transactionForm() {
24460
24614
  return this.get('transaction');
24461
24615
  }
24462
- get holdingForm() {
24463
- return this.get('holding');
24616
+ get tradeForm() {
24617
+ return this.get('trade');
24464
24618
  }
24465
24619
  /**
24466
24620
  * calculated automatically as cashVariance=transactionAmount-frankedAmount-unfrankedAmount
@@ -24472,11 +24626,11 @@ class HoldingReinvestForm extends AbstractForm {
24472
24626
  });
24473
24627
  }
24474
24628
  /**
24475
- * Set transaction amount based on holding quantity and price
24629
+ * Set transaction amount based on trade quantity and price
24476
24630
  */
24477
- listenHoldingChanges() {
24478
- // we can watch the whole holding form because we have only 2 fields in the form template
24479
- this.get('holding').valueChanges.subscribe((value) => {
24631
+ listenTradeChanges() {
24632
+ // we can watch the whole trade form because we have only 2 fields in the form template
24633
+ this.get('trade').valueChanges.subscribe((value) => {
24480
24634
  if (!value.quantity || !value.price) {
24481
24635
  this.get(['transaction', 'amount']).setValue(0);
24482
24636
  return;
@@ -24485,15 +24639,15 @@ class HoldingReinvestForm extends AbstractForm {
24485
24639
  });
24486
24640
  }
24487
24641
  /**
24488
- * Set holding date the same as transaction date
24642
+ * Set trade date the same as transaction date
24489
24643
  */
24490
24644
  listenDateChanges() {
24491
24645
  this.get(['transaction', 'date']).valueChanges.subscribe((date) => {
24492
- this.get(['holding', 'date']).setValue(date);
24646
+ this.get(['trade', 'date']).setValue(date);
24493
24647
  });
24494
24648
  }
24495
24649
  /**
24496
- * @TODO Alex (TT-2847): attach file to both (transaction and holding) when files system refactored
24650
+ * @TODO Alex (TT-2847): attach file to both (transaction and trade) when files system refactored
24497
24651
  */
24498
24652
  submit() {
24499
24653
  const value = this.transactionForm.getRawValue();
@@ -24503,12 +24657,12 @@ class HoldingReinvestForm extends AbstractForm {
24503
24657
  description: `Reinvestment - ${value.incomeSource?.name}`,
24504
24658
  amount: value.amount - this.get('cashVariance').value
24505
24659
  }),
24506
- holding: this.holdingForm.submit()
24660
+ trade: this.tradeForm.submit()
24507
24661
  });
24508
24662
  }
24509
24663
  }
24510
24664
 
24511
- class HoldingImportForm extends AbstractForm {
24665
+ class HoldingTradeImportForm extends AbstractForm {
24512
24666
  constructor() {
24513
24667
  super({
24514
24668
  category: new UntypedFormControl(HoldingTypeCategoryEnum.STOCK, Validators.required),
@@ -24723,5 +24877,5 @@ var MessagesEnum;
24723
24877
  * Generated bundle index. Do not edit.
24724
24878
  */
24725
24879
 
24726
- export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressForm, AddressService, AddressTypeEnum, AllocationGroup, AllocationGroupCollection, AllocationRule, AllocationRuleCollection, AllocationRuleConditionComparisonOperatorEnum, AllocationRuleConditionFieldEnum, AllocationRuleConditionOperatorEnum, AllocationRuleForm, AllocationRuleService, AllocationRuleTransaction, AllocationRuleTransactionMetaField, AllocationRuleTypeEnum, AlphabetColorsEnum, AnnualClientDetails, AnnualClientDetailsForm, AnnualClientDetailsService, AnnualFrequencyEnum, AppCurrencyPipe, AppEvent, AppEvent2, AppEventTypeEnum, AppFile, AssetEntityTypeEnum, AssetSale, AssetSaleCollection, AssetTypeEnum, AssetsService, Badge, BadgeColorEnum, Bank, BankAccount, BankAccountAddManualForm, BankAccountAllocationForm, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountImportForm, BankAccountPropertiesForm, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankAccountsImportForm, BankConnection, BankConnectionMessagesEnum, BankConnectionService, BankConnectionStatusEnum, BankExternalStats, BankPopularEnum, BankProviderEnum, BankService, BankTransaction, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasReport, BasReportForm, BasReportMessagesEnum, BasReportService, BasiqConfig, BasiqJob, BasiqJobResponse, BasiqJobStep, BasiqMessagesEnum, BasiqService, BasiqToken, BasiqTokenService, BestVehicleLogbookCollection, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, BorrowingReport, BorrowingReportForm, BorrowingReportMessagesEnum, BorrowingReportService, Budget, BudgetForm, BudgetMessagesEnum, BudgetRule, BudgetService, BusinessChartAccountsEnum, BusinessTypeEnum, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CapitalLoss, CapitalLossForm, CapitalLossMessagesEnum, CapitalLossService, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsAdjustmentIncludedListEnum, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsForm, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsHoldingUntaxedIncomeListEnum, ChartAccountsKeepSign, ChartAccountsListEnum, ChartAccountsMessagesEnum, ChartAccountsMetaField, ChartAccountsMetaFieldListEnum, ChartAccountsMetaFieldTypeEnum, ChartAccountsPropertyAdjustmentsListEnum, ChartAccountsSalaryAdjustmentsListEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartAccountsValue, ChartAccountsValueCollection, ChartAccountsValueService, ChartData, ChartSerie, Chat, ChatCollection, ChatFilterForm, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientCouponService, ClientDetails, ClientDetailsForm, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientInvite, ClientInviteCollection, ClientInviteForm, ClientInviteMessages, ClientInvitePutForm, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementForm, ClientMovementMessagesEnum, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, Collection, CollectionDictionary, CollectionForm, CoreModule, CorelogicMessagesEnum, CorelogicService, CorelogicSuggestion, Country, CurrentFirmBranchService, DEDUCTION_CATEGORIES, DEPRECIATION_GROUPS, DOCUMENT_FILE_TYPES, DeductionClothingTypeEnum, DeductionSelfEducationTypeEnum, Depreciation, DepreciationCalculationEnum, DepreciationCalculationPercentEnum, DepreciationCapitalProject, DepreciationCapitalProjectService, DepreciationCollection, DepreciationForecast, DepreciationForecastCollection, DepreciationForm, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationLvpAssetTypeEnum, DepreciationLvpRateEnum, DepreciationLvpReportItem, DepreciationLvpReportItemCollection, DepreciationReportItem, DepreciationReportItemCollection, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Dictionary, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderForm, DocumentFolderMessagesEnum, DocumentFolderService, DocumentForm, DocumentMessagesEnum, DocumentService, DocumentTypeEnum, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeDetailsForm, EmployeeInvite, EmployeeInviteCollection, EmployeeInviteForm, EmployeeInviteRoleEnum, EmployeeInviteService, EmployeeMessagesEnum, EmployeeService, Endpoint, EquityPositionChartService, EventDispatcherService, ExportDataTable, ExportFormatEnum, ExportFormatterService, ExportableCollection, FacebookService, FileService, FileValidator, FinancialYear, FinancialYearService, Firm, FirmBranch, FirmBranchForm, FirmBranchMessagesEnum, FirmBranchService, FirmForm, FirmInviteForm, FirmMessagesEnum, FirmService, FirmTypeEnum, FormValidationsEnum, GenderEnum, GoogleService, HTTP_ERROR_MESSAGES, HeaderTitleService, Holding, HoldingCollection, HoldingForm, HoldingImport, HoldingImportForm, HoldingImportMessagesEnum, HoldingImportService, HoldingIncomeForm, HoldingMessagesEnum, HoldingReinvest, HoldingReinvestForm, HoldingSale, HoldingSaleCollection, HoldingSaleForm, HoldingSaleMessagesEnum, HoldingSaleService, HoldingService, HoldingType, HoldingTypeCategoryEnum, HoldingTypeCollection, HoldingTypeExchange, HoldingTypeExchangeListEnum, HoldingTypeExchangeService, HoldingTypeForm, HoldingTypeMessagesEnum, HoldingTypeService, HomeOfficeCalculatorForm, HomeOfficeClaim, HomeOfficeClaimCollection, HomeOfficeClaimForm, HomeOfficeClaimMessagesEnum, HomeOfficeClaimMethodEnum, HomeOfficeClaimService, HomeOfficeLog, HomeOfficeLogForm, HomeOfficeLogMessagesEnum, HomeOfficeLogService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastCollection, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceMessagesEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListHoldingEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, IncomeSourceTypeService, InterceptorsModule, IntercomService, InviteStatusEnum, InvoicePaymentForm, JsPdf, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanInterestTypeLabelEnum, LoanMaxNumberOfPaymentsEnum, LoanMessagesEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanRepaymentTypeLabelEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LoginForm, LossTypeEnum, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MessagesEnum, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, MyTaxBusinessDetails, MyTaxBusinessDetailsForm, MyTaxBusinessIncome, MyTaxBusinessIncomeForm, MyTaxBusinessIncomeOrLossesForm, MyTaxBusinessLosses, MyTaxBusinessLossesForm, MyTaxCgt, MyTaxCgtForm, MyTaxDeductions, MyTaxDeductionsForm, MyTaxDividends, MyTaxDividendsForm, MyTaxEstimate, MyTaxIncomeStatements, MyTaxIncomeStatementsForm, MyTaxIncomeTests, MyTaxIncomeTestsForm, MyTaxInterest, MyTaxInterestForm, MyTaxLosses, MyTaxLossesForm, MyTaxMedicareForm, MyTaxOffsets, MyTaxOffsetsForm, MyTaxOtherIncome, MyTaxOtherIncomeForm, MyTaxPartnershipsAndTrusts, MyTaxPartnershipsAndTrustsForm, MyTaxRent, MyTaxRentForm, Notification, Occupation, OccupationService, PASSWORD_REGEXPS, PasswordForm, PdfFromDataTableService, PdfFromDomElementService, PdfFromHtmlTableService, PdfFromTableService, PdfOrientationEnum, PdfService, PdfSettings, Phone, PhoneForm, PhoneTypeEnum, PreloaderService, PriorTransactionService, Property, PropertyAddForm, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementCollection, PropertyCategoryMovementForm, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentForm, PropertyDocumentMessagesEnum, PropertyDocumentService, PropertyEditForm, PropertyEquityChartData, PropertyEquityChartItem, PropertyEquityChartTypeEnum, PropertyForecast, PropertyForecastForm, PropertyMessagesEnum, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciation, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleCostBase, PropertySaleCostBaseForm, PropertySaleCostSaleForm, PropertySaleExemptionsForm, PropertySaleService, PropertySaleTaxExemptionMetaField, PropertySaleTaxExemptionMetaFieldCollection, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareCollection, PropertyShareForm, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, PropertyValuationCollection, PropertyValuationForm, PropertyValuationMessages, PropertyValuationService, REPORTS, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, RestMessagesEnum, RestService$1 as RestService, SERVICE_PRODUCT_ROLES, SafeUrlPipe, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentMethod, ServicePaymentMethodService, ServicePaymentService, ServicePaymentStatusEnum, ServicePrice, ServicePriceCollection, ServicePriceListEnum, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductCollection, ServiceProductIconsEnum, ServiceProductIdEnum, ServiceProductService, ServiceProductStatusEnum, ServicePromoCode, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, SetupItemTypeEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessLossCollection, SoleBusinessLossForm, SoleBusinessLossOffsetRule, SoleBusinessLossOffsetRuleService, SoleBusinessLossReport, SoleBusinessLossService, SoleBusinessMessagesEnum, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleIncomeForm, SoleInvoice, SoleInvoiceCollection, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemCollection, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStateEnum, SoleInvoiceStatusesEnum, SoleInvoiceTaxTypeEnum, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SoleInvoiceTemplateTaxTypeEnum, SpareDocumentSpareTypeEnum, SseService, StatesEnum, SubscriptionItemCollection, SubscriptionMessagesEnum, SubscriptionService, TAX_RETURN_CATEGORIES, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxExemption, TaxExemptionCollection, TaxExemptionEnum, TaxExemptionMetaField, TaxExemptionMetaFieldEnum, TaxExemptionService, TaxReturn, TaxReturnCategory, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReturnItem, TaxReturnItemEnum, TaxReturnItemService, TaxReview, TaxReviewCollection, TaxReviewFilterForm, TaxReviewFilterStatusEnum, TaxReviewHistoryService, TaxReviewMessagesEnum, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, TimezoneEnum, Toast, ToastService, ToastTypeEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionBaseCollection, TransactionBaseFilterForm, TransactionBaseForm, TransactionCategoryEnum, TransactionCollection, TransactionForm, TransactionMetaField, TransactionOperationEnum, TransactionReportItem, TransactionReportItemCollection, TransactionService, TransactionSourceEnum, TransactionTypeEnum, USER_ROLES, USER_WORK_POSITION, UniqueEmailValidator, User, UserCollection, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeCollection, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserForm, UserInviteForm, UserMedicareExemptionEnum, UserMessagesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, UsersInviteService, Vehicle, VehicleClaim, VehicleClaimCollection, VehicleClaimDetails, VehicleClaimDetailsForm, VehicleClaimDetailsMethodEnum, VehicleClaimDetailsService, VehicleClaimForm, VehicleClaimService, VehicleExpense, VehicleExpenseCollection, VehicleForm, VehicleLogbook, VehicleLogbookCollection, VehicleLogbookForm, VehicleLogbookMessages, VehicleLogbookPurposeEnum, VehicleLogbookService, VehicleMessagesEnum, VehicleService, WorkExpenseForm, WorkIncomeForm, XlsxService, YoutubeService, alphaSpaceValidator, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, currentFinYearValidator, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, greaterThanValidator, matchSumValidator, maxDateValidator, minDateValidator, passwordMatchValidator, passwordValidator, replace, sort, sortDeep, toArray };
24880
+ export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressForm, AddressService, AddressTypeEnum, AllocationGroup, AllocationGroupCollection, AllocationRule, AllocationRuleCollection, AllocationRuleConditionComparisonOperatorEnum, AllocationRuleConditionFieldEnum, AllocationRuleConditionOperatorEnum, AllocationRuleForm, AllocationRuleService, AllocationRuleTransaction, AllocationRuleTransactionMetaField, AllocationRuleTypeEnum, AlphabetColorsEnum, AnnualClientDetails, AnnualClientDetailsForm, AnnualClientDetailsService, AnnualFrequencyEnum, AppCurrencyPipe, AppEvent, AppEvent2, AppEventTypeEnum, AppFile, AssetEntityTypeEnum, AssetSale, AssetSaleCollection, AssetTypeEnum, AssetsService, Badge, BadgeColorEnum, Bank, BankAccount, BankAccountAddManualForm, BankAccountAllocationForm, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountImportForm, BankAccountPropertiesForm, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankAccountsImportForm, BankConnection, BankConnectionMessagesEnum, BankConnectionService, BankConnectionStatusEnum, BankExternalStats, BankPopularEnum, BankProviderEnum, BankService, BankTransaction, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasReport, BasReportForm, BasReportMessagesEnum, BasReportService, BasiqConfig, BasiqJob, BasiqJobResponse, BasiqJobStep, BasiqMessagesEnum, BasiqService, BasiqToken, BasiqTokenService, BestVehicleLogbookCollection, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, BorrowingReport, BorrowingReportForm, BorrowingReportMessagesEnum, BorrowingReportService, Budget, BudgetForm, BudgetMessagesEnum, BudgetRule, BudgetService, BusinessChartAccountsEnum, BusinessTypeEnum, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CapitalLoss, CapitalLossForm, CapitalLossMessagesEnum, CapitalLossService, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsAdjustmentIncludedListEnum, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsForm, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsHoldingUntaxedIncomeListEnum, ChartAccountsKeepSign, ChartAccountsListEnum, ChartAccountsMessagesEnum, ChartAccountsMetaField, ChartAccountsMetaFieldListEnum, ChartAccountsMetaFieldTypeEnum, ChartAccountsPropertyAdjustmentsListEnum, ChartAccountsSalaryAdjustmentsListEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartAccountsValue, ChartAccountsValueCollection, ChartAccountsValueService, ChartData, ChartSerie, Chat, ChatCollection, ChatFilterForm, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientCouponService, ClientDetails, ClientDetailsForm, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientInvite, ClientInviteCollection, ClientInviteForm, ClientInviteMessages, ClientInvitePutForm, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementForm, ClientMovementMessagesEnum, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, Collection, CollectionDictionary, CollectionForm, CoreModule, CorelogicMessagesEnum, CorelogicService, CorelogicSuggestion, Country, CurrentFirmBranchService, DEDUCTION_CATEGORIES, DEPRECIATION_GROUPS, DOCUMENT_FILE_TYPES, DeductionClothingTypeEnum, DeductionSelfEducationTypeEnum, Depreciation, DepreciationCalculationEnum, DepreciationCalculationPercentEnum, DepreciationCapitalProject, DepreciationCapitalProjectService, DepreciationCollection, DepreciationForecast, DepreciationForecastCollection, DepreciationForm, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationLvpAssetTypeEnum, DepreciationLvpRateEnum, DepreciationLvpReportItem, DepreciationLvpReportItemCollection, DepreciationReportItem, DepreciationReportItemCollection, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Dictionary, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderForm, DocumentFolderMessagesEnum, DocumentFolderService, DocumentForm, DocumentMessagesEnum, DocumentService, DocumentTypeEnum, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeDetailsForm, EmployeeInvite, EmployeeInviteCollection, EmployeeInviteForm, EmployeeInviteRoleEnum, EmployeeInviteService, EmployeeMessagesEnum, EmployeeService, Endpoint, EquityPositionChartService, EventDispatcherService, ExportDataTable, ExportFormatEnum, ExportFormatterService, ExportableCollection, FacebookService, FileService, FileValidator, FinancialYear, FinancialYearService, Firm, FirmBranch, FirmBranchForm, FirmBranchMessagesEnum, FirmBranchService, FirmForm, FirmInviteForm, FirmMessagesEnum, FirmService, FirmTypeEnum, FormValidationsEnum, GenderEnum, GoogleService, HTTP_ERROR_MESSAGES, HeaderTitleService, Holding, HoldingCollection, HoldingIncomeForm, HoldingReinvest, HoldingReinvestForm, HoldingSale, HoldingSaleCollection, HoldingSaleForm, HoldingSaleService, HoldingTrade, HoldingTradeCollection, HoldingTradeFilterForm, HoldingTradeForm, HoldingTradeImport, HoldingTradeImportForm, HoldingTradeImportMessagesEnum, HoldingTradeImportService, HoldingTradeMessagesEnum, HoldingTradeService, HoldingTradeTypeEnum, HoldingType, HoldingTypeCategoryEnum, HoldingTypeCollection, HoldingTypeExchange, HoldingTypeExchangeListEnum, HoldingTypeExchangeService, HoldingTypeForm, HoldingTypeMessagesEnum, HoldingTypeService, HomeOfficeCalculatorForm, HomeOfficeClaim, HomeOfficeClaimCollection, HomeOfficeClaimForm, HomeOfficeClaimMessagesEnum, HomeOfficeClaimMethodEnum, HomeOfficeClaimService, HomeOfficeLog, HomeOfficeLogForm, HomeOfficeLogMessagesEnum, HomeOfficeLogService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastCollection, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceMessagesEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListHoldingEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, IncomeSourceTypeService, InterceptorsModule, IntercomService, InviteStatusEnum, InvoicePaymentForm, JsPdf, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanInterestTypeLabelEnum, LoanMaxNumberOfPaymentsEnum, LoanMessagesEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanRepaymentTypeLabelEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LoginForm, LossTypeEnum, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MessagesEnum, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, MyTaxBusinessDetails, MyTaxBusinessDetailsForm, MyTaxBusinessIncome, MyTaxBusinessIncomeForm, MyTaxBusinessIncomeOrLossesForm, MyTaxBusinessLosses, MyTaxBusinessLossesForm, MyTaxCgt, MyTaxCgtForm, MyTaxDeductions, MyTaxDeductionsForm, MyTaxDividends, MyTaxDividendsForm, MyTaxEstimate, MyTaxIncomeStatements, MyTaxIncomeStatementsForm, MyTaxIncomeTests, MyTaxIncomeTestsForm, MyTaxInterest, MyTaxInterestForm, MyTaxLosses, MyTaxLossesForm, MyTaxMedicareForm, MyTaxOffsets, MyTaxOffsetsForm, MyTaxOtherIncome, MyTaxOtherIncomeForm, MyTaxPartnershipsAndTrusts, MyTaxPartnershipsAndTrustsForm, MyTaxRent, MyTaxRentForm, Notification, Occupation, OccupationService, PASSWORD_REGEXPS, PasswordForm, PdfFromDataTableService, PdfFromDomElementService, PdfFromHtmlTableService, PdfFromTableService, PdfOrientationEnum, PdfService, PdfSettings, Phone, PhoneForm, PhoneTypeEnum, PreloaderService, PriorTransactionService, Property, PropertyAddForm, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementCollection, PropertyCategoryMovementForm, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentForm, PropertyDocumentMessagesEnum, PropertyDocumentService, PropertyEditForm, PropertyEquityChartData, PropertyEquityChartItem, PropertyEquityChartTypeEnum, PropertyForecast, PropertyForecastForm, PropertyMessagesEnum, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciation, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleCostBase, PropertySaleCostBaseForm, PropertySaleCostSaleForm, PropertySaleExemptionsForm, PropertySaleService, PropertySaleTaxExemptionMetaField, PropertySaleTaxExemptionMetaFieldCollection, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareCollection, PropertyShareForm, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, PropertyValuationCollection, PropertyValuationForm, PropertyValuationMessages, PropertyValuationService, REPORTS, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, RestMessagesEnum, RestService$1 as RestService, SERVICE_PRODUCT_ROLES, SafeUrlPipe, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentMethod, ServicePaymentMethodService, ServicePaymentService, ServicePaymentStatusEnum, ServicePrice, ServicePriceCollection, ServicePriceListEnum, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductCollection, ServiceProductIconsEnum, ServiceProductIdEnum, ServiceProductService, ServiceProductStatusEnum, ServicePromoCode, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, SetupItemTypeEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessLossCollection, SoleBusinessLossForm, SoleBusinessLossOffsetRule, SoleBusinessLossOffsetRuleService, SoleBusinessLossReport, SoleBusinessLossService, SoleBusinessMessagesEnum, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleIncomeForm, SoleInvoice, SoleInvoiceCollection, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemCollection, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStateEnum, SoleInvoiceStatusesEnum, SoleInvoiceTaxTypeEnum, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SoleInvoiceTemplateTaxTypeEnum, SpareDocumentSpareTypeEnum, SseService, StatesEnum, SubscriptionItemCollection, SubscriptionMessagesEnum, SubscriptionService, TAX_RETURN_CATEGORIES, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxExemption, TaxExemptionCollection, TaxExemptionEnum, TaxExemptionMetaField, TaxExemptionMetaFieldEnum, TaxExemptionService, TaxReturn, TaxReturnCategory, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReturnItem, TaxReturnItemEnum, TaxReturnItemService, TaxReview, TaxReviewCollection, TaxReviewFilterForm, TaxReviewFilterStatusEnum, TaxReviewHistoryService, TaxReviewMessagesEnum, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, TimezoneEnum, Toast, ToastService, ToastTypeEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionBaseCollection, TransactionBaseFilterForm, TransactionBaseForm, TransactionCategoryEnum, TransactionCollection, TransactionForm, TransactionMetaField, TransactionOperationEnum, TransactionReportItem, TransactionReportItemCollection, TransactionService, TransactionSourceEnum, TransactionTypeEnum, USER_ROLES, USER_WORK_POSITION, UniqueEmailValidator, User, UserCollection, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeCollection, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserForm, UserInviteForm, UserMedicareExemptionEnum, UserMessagesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, UsersInviteService, Vehicle, VehicleClaim, VehicleClaimCollection, VehicleClaimDetails, VehicleClaimDetailsForm, VehicleClaimDetailsMethodEnum, VehicleClaimDetailsService, VehicleClaimForm, VehicleClaimService, VehicleExpense, VehicleExpenseCollection, VehicleForm, VehicleLogbook, VehicleLogbookCollection, VehicleLogbookForm, VehicleLogbookMessages, VehicleLogbookPurposeEnum, VehicleLogbookService, VehicleMessagesEnum, VehicleService, WorkExpenseForm, WorkIncomeForm, XlsxService, YoutubeService, alphaSpaceValidator, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, currentFinYearValidator, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, greaterThanValidator, matchSumValidator, maxDateValidator, minDateValidator, passwordMatchValidator, passwordValidator, replace, sort, sortDeep, toArray };
24727
24881
  //# sourceMappingURL=taxtank-core.mjs.map