taxtank-core 0.33.60 → 0.33.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) 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 +6 -1
  16. package/esm2022/src/lib/forms/holding/holding-reinvest.form.mjs +14 -14
  17. package/esm2022/src/lib/forms/holding/holding-sale.form.mjs +3 -2
  18. package/esm2022/src/lib/forms/holding/holding-trade/holding-trade-filter.form.mjs +25 -0
  19. package/esm2022/src/lib/forms/holding/holding-trade/holding-trade.form.mjs +30 -0
  20. package/esm2022/src/lib/forms/holding/holding-trade/index.mjs +3 -0
  21. package/esm2022/src/lib/forms/holding/holding-trade-import.form.mjs +25 -0
  22. package/esm2022/src/lib/forms/holding/index.mjs +3 -3
  23. package/esm2022/src/lib/models/endpoint/endpoints.const.mjs +9 -9
  24. package/esm2022/src/lib/models/holding/holding-reinvest.mjs +4 -4
  25. package/esm2022/src/lib/models/holding/holding-sale.mjs +10 -1
  26. package/esm2022/src/lib/models/holding/holding-trade-import.mjs +16 -0
  27. package/esm2022/src/lib/models/holding/holding-trade.mjs +77 -0
  28. package/esm2022/src/lib/models/holding/holding-type-exchange.mjs +4 -1
  29. package/esm2022/src/lib/models/holding/holding-type.mjs +4 -1
  30. package/esm2022/src/lib/models/holding/holding.mjs +44 -71
  31. package/esm2022/src/lib/models/holding/index.mjs +4 -3
  32. package/esm2022/src/lib/services/account-setup/account-setup.service.mjs +3 -3
  33. package/esm2022/src/lib/services/http/holding/holding-trade-import/holding-trade-import-messages.enum.mjs +9 -0
  34. package/esm2022/src/lib/services/http/holding/holding-trade-import/holding-trade-import.service.mjs +37 -0
  35. package/esm2022/src/lib/services/http/holding/holding-trade-messages.enum.mjs +10 -0
  36. package/esm2022/src/lib/services/http/holding/holding-trade.service.mjs +44 -0
  37. package/esm2022/src/lib/services/http/holding/index.mjs +5 -6
  38. package/fesm2022/taxtank-core.mjs +330 -185
  39. package/fesm2022/taxtank-core.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/src/lib/collections/asset-sale.collection.d.ts +3 -0
  42. package/src/lib/collections/collection-dictionary.d.ts +1 -0
  43. package/src/lib/collections/holding/holding-sale.collection.d.ts +4 -4
  44. package/src/lib/collections/holding/holding-trade.collection.d.ts +21 -0
  45. package/src/lib/collections/holding/holding.collection.d.ts +7 -10
  46. package/src/lib/collections/holding/index.d.ts +2 -1
  47. package/src/lib/db/Enums/holding/holding-trade-type.enum.d.ts +4 -0
  48. package/src/lib/db/Enums/holding/index.d.ts +1 -0
  49. package/src/lib/db/Models/holding/holding-sale.d.ts +2 -2
  50. package/src/lib/db/Models/holding/holding-trade-import.d.ts +8 -0
  51. package/src/lib/db/Models/holding/{holding.d.ts → holding-trade.d.ts} +1 -1
  52. package/src/lib/db/Models/holding/index.d.ts +1 -1
  53. package/src/lib/forms/abstract.form.d.ts +2 -0
  54. package/src/lib/forms/holding/holding-reinvest.form.d.ts +5 -5
  55. package/src/lib/forms/holding/holding-sale.form.d.ts +2 -2
  56. package/src/lib/forms/holding/holding-trade/holding-trade-filter.form.d.ts +9 -0
  57. package/src/lib/forms/holding/holding-trade/holding-trade.form.d.ts +9 -0
  58. package/src/lib/forms/holding/holding-trade/index.d.ts +2 -0
  59. package/src/lib/forms/holding/holding-trade-import.form.d.ts +8 -0
  60. package/src/lib/forms/holding/index.d.ts +2 -2
  61. package/src/lib/models/holding/holding-reinvest.d.ts +2 -2
  62. package/src/lib/models/holding/holding-sale.d.ts +16 -4
  63. package/src/lib/models/holding/holding-trade-import.d.ts +8 -0
  64. package/src/lib/models/holding/holding-trade.d.ts +41 -0
  65. package/src/lib/models/holding/holding-type-exchange.d.ts +3 -0
  66. package/src/lib/models/holding/holding-type.d.ts +3 -0
  67. package/src/lib/models/holding/holding.d.ts +18 -34
  68. package/src/lib/models/holding/index.d.ts +3 -2
  69. package/src/lib/services/account-setup/account-setup.service.d.ts +2 -2
  70. 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
  71. package/src/lib/services/http/holding/holding-trade-import/holding-trade-import.service.d.ts +17 -0
  72. package/src/lib/services/http/holding/{holding-messages.enum.d.ts → holding-trade-messages.enum.d.ts} +1 -1
  73. package/src/lib/services/http/holding/holding-trade.service.d.ts +20 -0
  74. package/src/lib/services/http/holding/index.d.ts +4 -5
  75. package/esm2022/src/lib/db/Models/holding/holding-import.mjs +0 -3
  76. package/esm2022/src/lib/db/Models/holding/holding.mjs +0 -3
  77. package/esm2022/src/lib/forms/holding/holding-import.form.mjs +0 -25
  78. package/esm2022/src/lib/forms/holding/holding.form.mjs +0 -28
  79. package/esm2022/src/lib/models/holding/holding-import.mjs +0 -16
  80. package/esm2022/src/lib/services/http/holding/holding-import/holding-import-messages.enum.mjs +0 -9
  81. package/esm2022/src/lib/services/http/holding/holding-import/holding-import.service.mjs +0 -37
  82. package/esm2022/src/lib/services/http/holding/holding-messages.enum.mjs +0 -10
  83. package/esm2022/src/lib/services/http/holding/holding-sale-messages.enum.mjs +0 -8
  84. package/esm2022/src/lib/services/http/holding/holding.service.mjs +0 -44
  85. package/src/lib/db/Models/holding/holding-import.d.ts +0 -8
  86. package/src/lib/forms/holding/holding-import.form.d.ts +0 -8
  87. package/src/lib/forms/holding/holding.form.d.ts +0 -8
  88. package/src/lib/models/holding/holding-import.d.ts +0 -8
  89. package/src/lib/services/http/holding/holding-import/holding-import.service.d.ts +0 -17
  90. package/src/lib/services/http/holding/holding-sale-messages.enum.d.ts +0 -6
  91. 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
  }
@@ -16219,13 +16343,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
16219
16343
  args: ['environment']
16220
16344
  }] }] });
16221
16345
 
16222
- class HoldingService extends RestService$1 {
16346
+ class HoldingTradeService extends RestService$1 {
16223
16347
  constructor(environment) {
16224
16348
  super(environment);
16225
16349
  this.environment = environment;
16226
- this.modelClass = Holding;
16227
- this.collectionClass = HoldingCollection;
16228
- this.endpointUri = 'holdings';
16350
+ this.modelClass = HoldingTrade;
16351
+ this.collectionClass = HoldingTradeCollection;
16352
+ this.endpointUri = 'holding-trades';
16229
16353
  this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
16230
16354
  this.roles = [UserRolesEnum.HOLDING_TANK];
16231
16355
  this.listenEvents();
@@ -16233,7 +16357,7 @@ class HoldingService extends RestService$1 {
16233
16357
  }
16234
16358
  listenEvents() {
16235
16359
  this.listenCSE(HoldingSale, this.refreshCache, ['post', 'put', 'delete']);
16236
- this.listenCSE(HoldingImport, this.refreshCache, ['post', 'put', 'delete']);
16360
+ this.listenCSE(HoldingTradeImport, this.refreshCache, ['post', 'put', 'delete']);
16237
16361
  }
16238
16362
  listenNotifications() {
16239
16363
  this.eventDispatcherService.on(AppEventTypeEnum.NOTIFICATION_ADDED).subscribe((notification) => {
@@ -16242,10 +16366,10 @@ class HoldingService extends RestService$1 {
16242
16366
  }
16243
16367
  });
16244
16368
  }
16245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
16246
- 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' }); }
16247
16371
  }
16248
- 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: [{
16249
16373
  type: Injectable,
16250
16374
  args: [{
16251
16375
  providedIn: 'root'
@@ -16292,12 +16416,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
16292
16416
  }]
16293
16417
  }] });
16294
16418
 
16295
- class HoldingImportService extends RestService$1 {
16419
+ class HoldingTradeImportService extends RestService$1 {
16296
16420
  constructor() {
16297
16421
  super(...arguments);
16298
- this.modelClass = HoldingImport;
16422
+ this.modelClass = HoldingTradeImport;
16299
16423
  this.collectionClass = (Collection);
16300
- this.endpointUri = 'holding-imports';
16424
+ this.endpointUri = 'holding-trade-imports';
16301
16425
  this.disabledMethods = ['post', 'postBatch', 'putBatch', 'deleteBatch'];
16302
16426
  this.roles = [UserRolesEnum.HOLDING_TANK];
16303
16427
  }
@@ -16307,29 +16431,29 @@ class HoldingImportService extends RestService$1 {
16307
16431
  formData.append('exchangeId', exchangeId.toString());
16308
16432
  formData.append('isTaxFree', (isTaxFree ? 1 : 0).toString());
16309
16433
  return this.http.post(this.apiUrl, formData).pipe(map((response) => {
16310
- const holdingImport = this.createModelInstance(response);
16311
- this.handleResponse([holdingImport], 'post');
16312
- return holdingImport;
16434
+ const holdingTradeImport = this.createModelInstance(response);
16435
+ this.handleResponse([holdingTradeImport], 'post');
16436
+ return holdingTradeImport;
16313
16437
  }));
16314
16438
  }
16315
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HoldingImportService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
16316
- 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' }); }
16317
16441
  }
16318
- 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: [{
16319
16443
  type: Injectable,
16320
16444
  args: [{
16321
16445
  providedIn: 'root'
16322
16446
  }]
16323
16447
  }] });
16324
16448
 
16325
- var HoldingImportMessagesEnum;
16326
- (function (HoldingImportMessagesEnum) {
16327
- HoldingImportMessagesEnum["CREATED"] = "Import created successfully";
16328
- HoldingImportMessagesEnum["UPDATED"] = "Import updated successfully";
16329
- HoldingImportMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this import?";
16330
- HoldingImportMessagesEnum["DELETED"] = "Import deleted successfully";
16331
- HoldingImportMessagesEnum["DELETE_ERROR"] = "Import including sold assets can not be deleted";
16332
- })(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 = {}));
16333
16457
 
16334
16458
  var HoldingTypeExchanges = [
16335
16459
  {
@@ -16428,23 +16552,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
16428
16552
  }]
16429
16553
  }], ctorParameters: () => [] });
16430
16554
 
16431
- var HoldingMessagesEnum;
16432
- (function (HoldingMessagesEnum) {
16433
- HoldingMessagesEnum["CREATED"] = "Holding created successfully";
16434
- HoldingMessagesEnum["UPDATED"] = "Holding updated successfully";
16435
- HoldingMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this holding?";
16436
- HoldingMessagesEnum["DELETED"] = "Holding deleted successfully";
16437
- HoldingMessagesEnum["DELETE_ASSET_ERROR"] = "In the \"SOLD\" section click on the \"REDO\" button for the current asset";
16438
- HoldingMessagesEnum["REINVESTED"] = "Reinvested successfully";
16439
- })(HoldingMessagesEnum || (HoldingMessagesEnum = {}));
16440
-
16441
- var HoldingSaleMessagesEnum;
16442
- (function (HoldingSaleMessagesEnum) {
16443
- HoldingSaleMessagesEnum["CREATED"] = "Holding sold successfully";
16444
- HoldingSaleMessagesEnum["UPDATED"] = "Sale updated successfully";
16445
- HoldingSaleMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this holding sale?";
16446
- HoldingSaleMessagesEnum["DELETED"] = "Sale deleted successfully";
16447
- })(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 = {}));
16448
16564
 
16449
16565
  var HoldingTypeMessagesEnum;
16450
16566
  (function (HoldingTypeMessagesEnum) {
@@ -18882,7 +18998,7 @@ class AccountSetupService {
18882
18998
  }
18883
18999
  return this.setItemStatus(this.items.findBy('isBankFeeds', true), this.bankAccountsService.getArray());
18884
19000
  }
18885
- 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 }); }
18886
19002
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSetupService, providedIn: 'root' }); }
18887
19003
  }
18888
19004
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSetupService, decorators: [{
@@ -18890,7 +19006,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
18890
19006
  args: [{
18891
19007
  providedIn: 'root'
18892
19008
  }]
18893
- }], 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 }] });
18894
19010
 
18895
19011
  const KEY = '_switch_user';
18896
19012
  /**
@@ -19911,10 +20027,10 @@ const ENDPOINTS = {
19911
20027
  LOANS_PAYOUT_DELETE: new Endpoint('DELETE', '\\/loans\\/\\d+\\/payout\\/\\d+'),
19912
20028
  LOANS_CALCULATION_POST: new Endpoint('POST', '\\/bank-accounts\\/loans\\/calculation'),
19913
20029
  LOGIN_POST: new Endpoint('POST', '\\/login'),
19914
- HOLDINGS_GET: new Endpoint('GET', '\\/holdings'),
19915
- HOLDINGS_POST: new Endpoint('POST', '\\/holdings'),
19916
- HOLDINGS_PUT: new Endpoint('PUT', '\\/holdings\\/\\d+'),
19917
- 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+'),
19918
20034
  HOLDING_TYPES_GET: new Endpoint('GET', '\\/holding-types'),
19919
20035
  HOLDING_TYPES_POST: new Endpoint('POST', '\\/holding-types'),
19920
20036
  HOLDING_TYPES_PUT: new Endpoint('PUT', '\\/holding-types\\/\\d+'),
@@ -19923,10 +20039,10 @@ const ENDPOINTS = {
19923
20039
  HOLDING_SALES_POST: new Endpoint('POST', '\\/holding-sales'),
19924
20040
  HOLDING_SALES_PUT: new Endpoint('PUT', '\\/holding-sales\\/\\d+'),
19925
20041
  HOLDING_SALES_DELETE: new Endpoint('DELETE', '\\/holding-sales\\/\\d+'),
19926
- HOLDING_IMPORTS_GET: new Endpoint('GET', '\\/holding-imports'),
19927
- HOLDING_IMPORTS_POST: new Endpoint('POST', '\\/holding-imports'),
19928
- HOLDING_IMPORTS_PUT: new Endpoint('PUT', '\\/holding-imports\\/\\d+'),
19929
- 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+'),
19930
20046
  NOTIFICATIONS_GET: new Endpoint('GET', '\\/service-notifications'),
19931
20047
  OCCUPATIONS_GET: new Endpoint('GET', '\\/occupations'),
19932
20048
  PROPERTIES_GET: new Endpoint('GET', '\\/properties'),
@@ -20873,6 +20989,10 @@ class AbstractForm extends FormGroup {
20873
20989
  control.enable(opts);
20874
20990
  });
20875
20991
  }
20992
+ controlsChanges(controlNames) {
20993
+ const controls = controlNames.map(controlName => this.get(controlName));
20994
+ return combineLatest(controls.map(control => control.valueChanges));
20995
+ }
20876
20996
  }
20877
20997
 
20878
20998
  class CollectionForm extends FormArray {
@@ -24353,10 +24473,60 @@ class DepreciationForm extends TransactionBaseForm {
24353
24473
  }
24354
24474
  }
24355
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
+
24356
24525
  class HoldingSaleForm extends AbstractForm {
24357
24526
  constructor(sale, holding, type, isResident) {
24358
24527
  super({
24359
- 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)]),
24360
24530
  price: new UntypedFormControl(sale.price || type.price, Validators.required),
24361
24531
  fee: new UntypedFormControl(sale.fee, Validators.required),
24362
24532
  date: new UntypedFormControl(sale.date, Validators.required),
@@ -24412,31 +24582,6 @@ class HoldingTypeForm extends AbstractForm {
24412
24582
  }
24413
24583
  }
24414
24584
 
24415
- class HoldingForm extends AbstractForm {
24416
- constructor(holding) {
24417
- super({
24418
- category: new UntypedFormControl(holding.category),
24419
- isTaxFree: new UntypedFormControl(holding.isTaxFree, Validators.required),
24420
- quantity: new UntypedFormControl(holding.quantity, [Validators.required, greaterThanValidator(0)]),
24421
- price: new UntypedFormControl(holding.price, [Validators.required, Validators.min(0)]),
24422
- fee: new UntypedFormControl(holding.fee, [Validators.required, Validators.min(0)]),
24423
- date: new UntypedFormControl(holding.date, Validators.required),
24424
- type: new UntypedFormControl(holding.type, Validators.required),
24425
- ownershipPercent: new UntypedFormControl(holding.ownershipPercent || 100, Validators.required),
24426
- file: new UntypedFormControl(holding.file)
24427
- }, holding);
24428
- this.listenEvents();
24429
- }
24430
- listenEvents() {
24431
- this.get('category').valueChanges.subscribe((category) => {
24432
- this.get('type').setValue(null);
24433
- });
24434
- }
24435
- submit(data = {}, includeDisabledFields = false) {
24436
- return super.submit(data, includeDisabledFields);
24437
- }
24438
- }
24439
-
24440
24585
  /**
24441
24586
  * @TODO vik TT-4048
24442
24587
  */
@@ -24446,7 +24591,7 @@ class HoldingReinvestForm extends AbstractForm {
24446
24591
  // the difference between dividends amount and given shares (shares=dividendsAmount/sharePrice)
24447
24592
  cashVariance: new FormControl({ value: 0, disabled: true }, Validators.required),
24448
24593
  transaction: new HoldingIncomeForm(reinvest.transaction, null, []),
24449
- holding: new HoldingForm(reinvest.holding)
24594
+ trade: new HoldingTradeForm(reinvest.trade)
24450
24595
  }, reinvest);
24451
24596
  this.reinvest = reinvest;
24452
24597
  this.listenEvents();
@@ -24461,15 +24606,15 @@ class HoldingReinvestForm extends AbstractForm {
24461
24606
  });
24462
24607
  }
24463
24608
  listenEvents() {
24464
- this.listenHoldingChanges();
24609
+ this.listenTradeChanges();
24465
24610
  this.listenDateChanges();
24466
24611
  this.listenAmountChanges();
24467
24612
  }
24468
24613
  get transactionForm() {
24469
24614
  return this.get('transaction');
24470
24615
  }
24471
- get holdingForm() {
24472
- return this.get('holding');
24616
+ get tradeForm() {
24617
+ return this.get('trade');
24473
24618
  }
24474
24619
  /**
24475
24620
  * calculated automatically as cashVariance=transactionAmount-frankedAmount-unfrankedAmount
@@ -24481,11 +24626,11 @@ class HoldingReinvestForm extends AbstractForm {
24481
24626
  });
24482
24627
  }
24483
24628
  /**
24484
- * Set transaction amount based on holding quantity and price
24629
+ * Set transaction amount based on trade quantity and price
24485
24630
  */
24486
- listenHoldingChanges() {
24487
- // we can watch the whole holding form because we have only 2 fields in the form template
24488
- 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) => {
24489
24634
  if (!value.quantity || !value.price) {
24490
24635
  this.get(['transaction', 'amount']).setValue(0);
24491
24636
  return;
@@ -24494,15 +24639,15 @@ class HoldingReinvestForm extends AbstractForm {
24494
24639
  });
24495
24640
  }
24496
24641
  /**
24497
- * Set holding date the same as transaction date
24642
+ * Set trade date the same as transaction date
24498
24643
  */
24499
24644
  listenDateChanges() {
24500
24645
  this.get(['transaction', 'date']).valueChanges.subscribe((date) => {
24501
- this.get(['holding', 'date']).setValue(date);
24646
+ this.get(['trade', 'date']).setValue(date);
24502
24647
  });
24503
24648
  }
24504
24649
  /**
24505
- * @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
24506
24651
  */
24507
24652
  submit() {
24508
24653
  const value = this.transactionForm.getRawValue();
@@ -24512,12 +24657,12 @@ class HoldingReinvestForm extends AbstractForm {
24512
24657
  description: `Reinvestment - ${value.incomeSource?.name}`,
24513
24658
  amount: value.amount - this.get('cashVariance').value
24514
24659
  }),
24515
- holding: this.holdingForm.submit()
24660
+ trade: this.tradeForm.submit()
24516
24661
  });
24517
24662
  }
24518
24663
  }
24519
24664
 
24520
- class HoldingImportForm extends AbstractForm {
24665
+ class HoldingTradeImportForm extends AbstractForm {
24521
24666
  constructor() {
24522
24667
  super({
24523
24668
  category: new UntypedFormControl(HoldingTypeCategoryEnum.STOCK, Validators.required),
@@ -24732,5 +24877,5 @@ var MessagesEnum;
24732
24877
  * Generated bundle index. Do not edit.
24733
24878
  */
24734
24879
 
24735
- 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 };
24736
24881
  //# sourceMappingURL=taxtank-core.mjs.map