taxtank-core 0.30.29 → 0.30.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/esm2020/lib/collections/holding.collection.mjs +28 -0
  2. package/esm2020/lib/collections/index.mjs +2 -1
  3. package/esm2020/lib/collections/property/property-sale/property-sale.collection.mjs +3 -3
  4. package/esm2020/lib/db/Enums/holding/holding-type-category.enum.mjs +1 -1
  5. package/esm2020/lib/db/Enums/index.mjs +2 -1
  6. package/esm2020/lib/db/Models/client/annual-client-details.mjs +3 -0
  7. package/esm2020/lib/db/Models/client/client-details.mjs +4 -0
  8. package/esm2020/lib/db/Models/client/client-income-types.mjs +4 -0
  9. package/esm2020/lib/db/Models/client/index.mjs +5 -0
  10. package/esm2020/lib/db/Models/client/occupation.mjs +4 -0
  11. package/esm2020/lib/db/Models/index.mjs +2 -4
  12. package/esm2020/lib/db/Models/property/property-sale/property-sale.mjs +1 -1
  13. package/esm2020/lib/db/Models/user/user.mjs +1 -1
  14. package/esm2020/lib/forms/client/annual-client-details.form.mjs +37 -0
  15. package/esm2020/lib/forms/client/index.mjs +3 -0
  16. package/esm2020/lib/forms/holding/holding-sale.form.mjs +39 -0
  17. package/esm2020/lib/forms/holding/holding-type.form.mjs +16 -0
  18. package/esm2020/lib/forms/holding/holding.form.mjs +17 -0
  19. package/esm2020/lib/forms/holding/index.mjs +4 -0
  20. package/esm2020/lib/forms/index.mjs +3 -2
  21. package/esm2020/lib/forms/property/property-sale/property-sale-cost-sale.form.mjs +11 -25
  22. package/esm2020/lib/forms/property/property-sale/property-sale-exemptions.form.mjs +18 -7
  23. package/esm2020/lib/forms/report/my-tax/my-tax-cgt.form.mjs +4 -1
  24. package/esm2020/lib/messages/index.mjs +2 -0
  25. package/esm2020/lib/messages/messages.enum.mjs +16 -0
  26. package/esm2020/lib/models/client/annual-client-details.mjs +15 -0
  27. package/esm2020/lib/models/client/client-details.mjs +2 -2
  28. package/esm2020/lib/models/client/client-income-types.mjs +2 -2
  29. package/esm2020/lib/models/client/index.mjs +8 -0
  30. package/esm2020/lib/models/endpoint/endpoints.const.mjs +17 -1
  31. package/esm2020/lib/models/holding/holding-sale.mjs +18 -1
  32. package/esm2020/lib/models/holding/holding-type-exchange.mjs +13 -0
  33. package/esm2020/lib/models/holding/holding-type.mjs +37 -1
  34. package/esm2020/lib/models/holding/holding.mjs +32 -1
  35. package/esm2020/lib/models/index.mjs +2 -1
  36. package/esm2020/lib/models/property/property-sale/property-sale.mjs +19 -6
  37. package/esm2020/lib/models/property/property-sale/tax-exemption.mjs +5 -1
  38. package/esm2020/lib/models/property/property.mjs +38 -18
  39. package/esm2020/lib/models/report/my-tax/my-tax-cgt/my-tax-cgt.mjs +7 -6
  40. package/esm2020/lib/models/user/occupation.mjs +2 -2
  41. package/esm2020/lib/services/http/client/capital-gain/annual-client-details.service.mjs +24 -0
  42. package/esm2020/lib/services/http/client/index.mjs +3 -0
  43. package/esm2020/lib/services/http/client/occupation/occupation.service.mjs +45 -0
  44. package/esm2020/lib/services/http/firm/client-income/client-income-types.service.mjs +1 -1
  45. package/esm2020/lib/services/http/holding/holding-sale.service.mjs +1 -4
  46. package/esm2020/lib/services/http/holding/holding-type.service.mjs +1 -4
  47. package/esm2020/lib/services/http/holding/holding.service.mjs +3 -6
  48. package/esm2020/lib/services/http/index.mjs +2 -1
  49. package/esm2020/lib/services/http/user/index.mjs +2 -2
  50. package/esm2020/lib/services/http/user/user.service.mjs +2 -11
  51. package/esm2020/public-api.mjs +5 -1
  52. package/fesm2015/taxtank-core.mjs +559 -254
  53. package/fesm2015/taxtank-core.mjs.map +1 -1
  54. package/fesm2020/taxtank-core.mjs +556 -252
  55. package/fesm2020/taxtank-core.mjs.map +1 -1
  56. package/lib/collections/holding.collection.d.ts +10 -0
  57. package/lib/collections/index.d.ts +1 -0
  58. package/lib/collections/property/property-sale/property-sale.collection.d.ts +1 -1
  59. package/lib/db/Enums/index.d.ts +1 -0
  60. package/lib/db/Models/client/annual-client-details.d.ts +12 -0
  61. package/lib/db/Models/{user → client}/client-details.d.ts +1 -2
  62. package/lib/db/Models/client/index.d.ts +4 -0
  63. package/lib/db/Models/index.d.ts +1 -3
  64. package/lib/db/Models/property/property-sale/property-sale.d.ts +2 -3
  65. package/lib/db/Models/user/user.d.ts +1 -1
  66. package/lib/forms/client/annual-client-details.form.d.ts +8 -0
  67. package/lib/forms/client/index.d.ts +2 -0
  68. package/lib/forms/holding/holding-sale.form.d.ts +11 -0
  69. package/lib/forms/holding/holding-type.form.d.ts +5 -0
  70. package/lib/forms/holding/holding.form.d.ts +5 -0
  71. package/lib/forms/holding/index.d.ts +3 -0
  72. package/lib/forms/index.d.ts +2 -1
  73. package/lib/forms/property/property-sale/property-sale-cost-sale.form.d.ts +1 -3
  74. package/lib/forms/property/property-sale/property-sale-exemptions.form.d.ts +6 -6
  75. package/lib/forms/report/my-tax/my-tax-cgt.form.d.ts +4 -1
  76. package/lib/messages/index.d.ts +1 -0
  77. package/lib/messages/messages.enum.d.ts +14 -0
  78. package/lib/models/client/annual-client-details.d.ts +12 -0
  79. package/lib/models/client/client-details.d.ts +1 -1
  80. package/lib/models/client/client-income-types.d.ts +1 -1
  81. package/lib/models/client/index.d.ts +7 -0
  82. package/lib/models/holding/holding-sale.d.ts +6 -1
  83. package/lib/models/holding/holding-type-exchange.d.ts +11 -0
  84. package/lib/models/holding/holding-type.d.ts +31 -8
  85. package/lib/models/holding/holding.d.ts +16 -1
  86. package/lib/models/index.d.ts +1 -0
  87. package/lib/models/property/property-sale/property-sale.d.ts +7 -2
  88. package/lib/models/property/property-sale/tax-exemption.d.ts +1 -0
  89. package/lib/models/property/property.d.ts +12 -6
  90. package/lib/models/report/my-tax/my-tax-cgt/my-tax-cgt.d.ts +2 -2
  91. package/lib/models/user/occupation.d.ts +1 -1
  92. package/lib/services/http/client/capital-gain/annual-client-details.service.d.ts +14 -0
  93. package/lib/services/http/client/index.d.ts +2 -0
  94. package/lib/services/http/firm/client-income/client-income-types.service.d.ts +1 -1
  95. package/lib/services/http/holding/holding-sale.service.d.ts +0 -3
  96. package/lib/services/http/holding/holding-type.service.d.ts +0 -3
  97. package/lib/services/http/holding/holding.service.d.ts +3 -6
  98. package/lib/services/http/index.d.ts +1 -0
  99. package/lib/services/http/user/index.d.ts +1 -1
  100. package/lib/services/http/user/user.service.d.ts +0 -4
  101. package/package.json +1 -1
  102. package/public-api.d.ts +4 -0
  103. package/esm2020/lib/db/Models/user/client-details.mjs +0 -4
  104. package/esm2020/lib/db/Models/user/client-income-types.mjs +0 -4
  105. package/esm2020/lib/db/Models/user/occupation.mjs +0 -4
  106. package/esm2020/lib/services/http/user/occupation/occupation.service.mjs +0 -45
  107. /package/lib/db/Models/{user → client}/client-income-types.d.ts +0 -0
  108. /package/lib/db/Models/{user → client}/occupation.d.ts +0 -0
  109. /package/lib/services/http/{user → client}/occupation/occupation.service.d.ts +0 -0
@@ -648,16 +648,19 @@ let TransactionReceipt$1 = class TransactionReceipt extends AbstractModel {
648
648
  let Transaction$1 = class Transaction extends TransactionBase {
649
649
  };
650
650
 
651
+ let AnnualClientDetails$1 = class AnnualClientDetails {
652
+ };
653
+
651
654
  let ClientDetails$1 = class ClientDetails extends AbstractModel {
652
655
  };
653
656
 
654
657
  let ClientIncomeTypes$1 = class ClientIncomeTypes extends ObservableModel {
655
658
  };
656
659
 
657
- let EmployeeDetails$1 = class EmployeeDetails extends AbstractModel {
660
+ let Occupation$1 = class Occupation extends AbstractModel {
658
661
  };
659
662
 
660
- let Occupation$1 = class Occupation extends AbstractModel {
663
+ let EmployeeDetails$1 = class EmployeeDetails extends AbstractModel {
661
664
  };
662
665
 
663
666
  let RegistrationInvite$1 = class RegistrationInvite extends AbstractModel {
@@ -1621,8 +1624,8 @@ class LoanCollection extends Collection {
1621
1624
  }
1622
1625
 
1623
1626
  class PropertySaleCollection extends Collection {
1624
- get grossCGTAfterLoss() {
1625
- return this.create(this.items.filter((propertySale) => propertySale.grossCGTAfterLoss > 0)).sumBy('grossCGTAfterLoss');
1627
+ get grossCapitalGain() {
1628
+ return this.create(this.items.filter((propertySale) => propertySale.grossCapitalGain > 0)).sumBy('grossCapitalGain');
1626
1629
  }
1627
1630
  /**
1628
1631
  * Property sales are CGT applicable unless it has "Principle place of residence" exemption type
@@ -2149,6 +2152,16 @@ var DocumentTypeEnum;
2149
2152
  DocumentTypeEnum[DocumentTypeEnum["INVOICE"] = 1] = "INVOICE";
2150
2153
  })(DocumentTypeEnum || (DocumentTypeEnum = {}));
2151
2154
 
2155
+ var HoldingTypeCategoryEnum;
2156
+ (function (HoldingTypeCategoryEnum) {
2157
+ HoldingTypeCategoryEnum[HoldingTypeCategoryEnum["CRYPTO"] = 1] = "CRYPTO";
2158
+ HoldingTypeCategoryEnum[HoldingTypeCategoryEnum["STOCK"] = 2] = "STOCK";
2159
+ HoldingTypeCategoryEnum[HoldingTypeCategoryEnum["UNLISTED_STOCK"] = 3] = "UNLISTED_STOCK";
2160
+ HoldingTypeCategoryEnum[HoldingTypeCategoryEnum["UNLISTED_UNIT"] = 4] = "UNLISTED_UNIT";
2161
+ HoldingTypeCategoryEnum[HoldingTypeCategoryEnum["COLLECTIBLE"] = 5] = "COLLECTIBLE";
2162
+ HoldingTypeCategoryEnum[HoldingTypeCategoryEnum["OTHER"] = 6] = "OTHER";
2163
+ })(HoldingTypeCategoryEnum || (HoldingTypeCategoryEnum = {}));
2164
+
2152
2165
  // @TODO Artem TT-2308 move everything
2153
2166
 
2154
2167
  class DepreciationCapitalProject extends DepreciationCapitalProject$1 {
@@ -3563,6 +3576,12 @@ var TaxExemptionEnum;
3563
3576
  TaxExemptionEnum[TaxExemptionEnum["OTHER"] = 7] = "OTHER";
3564
3577
  })(TaxExemptionEnum || (TaxExemptionEnum = {}));
3565
3578
 
3579
+ class TaxExemption extends TaxExemption$1 {
3580
+ isPartial() {
3581
+ return [TaxExemptionEnum.INVESTMENT_TO_PPR, TaxExemptionEnum.PPR_TO_INVESTMENT].includes(this.id);
3582
+ }
3583
+ }
3584
+
3566
3585
  class PropertySale extends PropertySale$1 {
3567
3586
  get saleCostsTotalAmount() {
3568
3587
  return this.commission + this.legalFees + this.otherCost;
@@ -3574,13 +3593,22 @@ class PropertySale extends PropertySale$1 {
3574
3593
  isCGTApplicable() {
3575
3594
  return this.taxExemption?.id !== TaxExemptionEnum.PPR;
3576
3595
  }
3577
- get lossApplied() {
3578
- return this.grossCGT <= 0 ? 0 : Math.min(this.grossCGT, this.capitalLoss);
3579
- }
3580
- get grossCGTAfterLoss() {
3581
- return this.grossCGT - this.lossApplied;
3596
+ get netPrice() {
3597
+ return this.price - this.saleCostsTotalAmount;
3582
3598
  }
3583
3599
  }
3600
+ __decorate([
3601
+ Type(() => Number)
3602
+ ], PropertySale.prototype, "holdingCosts", void 0);
3603
+ __decorate([
3604
+ Type(() => Number)
3605
+ ], PropertySale.prototype, "structuralImprovementsWDV", void 0);
3606
+ __decorate([
3607
+ Type(() => Number)
3608
+ ], PropertySale.prototype, "buildingAtCostClaimed", void 0);
3609
+ __decorate([
3610
+ Type(() => Number)
3611
+ ], PropertySale.prototype, "price", void 0);
3584
3612
  __decorate([
3585
3613
  Type(() => Number)
3586
3614
  ], PropertySale.prototype, "commission", void 0);
@@ -3596,6 +3624,9 @@ __decorate([
3596
3624
  __decorate([
3597
3625
  Type(() => Date)
3598
3626
  ], PropertySale.prototype, "contractDate", void 0);
3627
+ __decorate([
3628
+ Type(() => TaxExemption)
3629
+ ], PropertySale.prototype, "taxExemption", void 0);
3599
3630
  __decorate([
3600
3631
  Type(() => PropertySaleTaxExemptionMetaField$1)
3601
3632
  ], PropertySale.prototype, "taxExemptionMetaFields", void 0);
@@ -3619,9 +3650,6 @@ class PropertySaleCostBase {
3619
3650
  class PropertySaleTaxExemptionMetaField extends PropertySaleTaxExemptionMetaField$1 {
3620
3651
  }
3621
3652
 
3622
- class TaxExemption extends TaxExemption$1 {
3623
- }
3624
-
3625
3653
  class TaxExemptionMetaField extends TaxExemptionMetaField$1 {
3626
3654
  }
3627
3655
 
@@ -7013,6 +7041,32 @@ class UserEventSettingCollection extends Collection {
7013
7041
  class UserEventTypeCollection extends Collection {
7014
7042
  }
7015
7043
 
7044
+ class HoldingCollection extends Collection {
7045
+ getShares() {
7046
+ return this.filterBy('type.category', HoldingTypeCategoryEnum.STOCK);
7047
+ }
7048
+ getCryptos() {
7049
+ return this.filterBy('type.category', HoldingTypeCategoryEnum.CRYPTO);
7050
+ }
7051
+ getOthers() {
7052
+ return this.filterBy('type.category', [
7053
+ HoldingTypeCategoryEnum.COLLECTIBLE,
7054
+ HoldingTypeCategoryEnum.UNLISTED_STOCK,
7055
+ HoldingTypeCategoryEnum.UNLISTED_UNIT,
7056
+ HoldingTypeCategoryEnum.OTHER
7057
+ ]);
7058
+ }
7059
+ getPurchaseValue() {
7060
+ return this.sumBy('purchaseValue');
7061
+ }
7062
+ getMarketValue(holdingTypesById) {
7063
+ return this.items.reduce((sum, holding) => sum + holding.getMarketValue(holdingTypesById.get(holding.type.id)), 0);
7064
+ }
7065
+ getGrowthCoefficient(holdingTypesById) {
7066
+ return this.getMarketValue(holdingTypesById) / this.getPurchaseValue() - 1;
7067
+ }
7068
+ }
7069
+
7016
7070
  // @TODO Alex move here all collections
7017
7071
 
7018
7072
  class ServiceSubscription extends ServiceSubscription$1 {
@@ -7398,17 +7452,14 @@ class Property extends Property$1 {
7398
7452
  }
7399
7453
  return this.purchasePrice + this.capitalCostsTotalAmount + sale.holdingCosts + sale.structuralImprovementsWDV - sale.buildingAtCostClaimed;
7400
7454
  }
7401
- /**
7402
- * gross capital gain tax: sale costs - cost base
7403
- */
7404
- calculateGrossCGT(sale) {
7405
- return (sale.price - sale.saleCostsTotalAmount - this.calculateCostBase(sale)) * this.shareRatio;
7455
+ calculateGrossCapitalGain(sale) {
7456
+ return (sale.netPrice - this.calculateCostBase(sale)) * this.getPartialCGTExemptionRatio(sale) * this.shareRatio;
7406
7457
  }
7407
7458
  /**
7408
- * net capital gain tax (includes tax exemptions)
7459
+ * net capital gain includes tax exemption
7409
7460
  */
7410
- calculateNetCGT(sale) {
7411
- return this.getCGTExemptionRatio(sale) * sale.grossCGTAfterLoss;
7461
+ calculateNetCapitalGain(sale) {
7462
+ return this.getCGTExemptionRatio(sale) * sale.grossCapitalGain;
7412
7463
  }
7413
7464
  /**
7414
7465
  * guess tax exemption based on property details
@@ -7428,24 +7479,29 @@ class Property extends Property$1 {
7428
7479
  return null;
7429
7480
  }
7430
7481
  }
7482
+ getPartialCGTExemptionRatio(sale) {
7483
+ const metaFields = new PropertySaleTaxExemptionMetaFieldCollection(sale.taxExemptionMetaFields);
7484
+ switch (sale.taxExemption?.id) {
7485
+ case TaxExemptionEnum.INVESTMENT_TO_PPR:
7486
+ const ownershipDays = this.getOwnershipDuration(sale);
7487
+ return (ownershipDays - metaFields.getPPRDays()) / ownershipDays;
7488
+ case TaxExemptionEnum.PPR_TO_INVESTMENT:
7489
+ return metaFields.getClaimPercent() / 100;
7490
+ default:
7491
+ return 1;
7492
+ }
7493
+ }
7431
7494
  /**
7432
7495
  * tax exemption can reduce cgt from 100% to less (up to zero)
7433
7496
  */
7434
7497
  getCGTExemptionRatio(sale) {
7435
- const metaFields = new PropertySaleTaxExemptionMetaFieldCollection(sale.taxExemptionMetaFields);
7436
7498
  switch (sale.taxExemption?.id) {
7437
7499
  // 50% exemption for investments owned for at least one year
7438
7500
  case TaxExemptionEnum.ONE_YEAR_RULE:
7439
7501
  return 0.5;
7440
- // investment property become main residence (exemption for main residence ownership duration)
7441
7502
  case TaxExemptionEnum.INVESTMENT_TO_PPR:
7442
- const ownershipDays = this.getOwnershipDuration(sale);
7443
- return (ownershipDays - metaFields.getPPRDays()) / ownershipDays;
7444
- // main residence become investment (exemption for home office percent usage)
7445
7503
  case TaxExemptionEnum.PPR_TO_INVESTMENT:
7446
- // 1 year CGT discount can still apply (on the income producing % if used for 12 months or more)
7447
- const ratio = this.isOneYearExemptionApplicable(sale) ? 0.5 : 1;
7448
- return metaFields.getClaimPercent() / 100 * ratio;
7504
+ return this.isOneYearExemptionApplicable(sale) ? 0.5 : 1;
7449
7505
  // full exemption
7450
7506
  case TaxExemptionEnum.PPR:
7451
7507
  case TaxExemptionEnum.SIX_YEARS_RULE:
@@ -7457,8 +7513,11 @@ class Property extends Property$1 {
7457
7513
  return 1;
7458
7514
  }
7459
7515
  }
7516
+ /**
7517
+ * in cgt report we apply losses, which can reset 1 year rule (in case if there is no profit after loss)
7518
+ */
7460
7519
  isOneYearExemptionApplicable(sale) {
7461
- return sale.grossCGTAfterLoss > 0 && this.getOwnershipDuration(sale, 'years') > 0;
7520
+ return sale.grossCapitalGain > 0 && this.getOwnershipDuration(sale, 'years') > 0;
7462
7521
  }
7463
7522
  /**
7464
7523
  * CGT is not applicable for properties acquired before 20.09.1985 (tax didn't exist before this date).
@@ -7487,6 +7546,12 @@ class Property extends Property$1 {
7487
7546
  * Any assets acquired before this day are CGT exempt (because the tax didn't exist before this date).
7488
7547
  */
7489
7548
  Property.preCGTAssetDate = new Date(1985, 9, 20);
7549
+ __decorate([
7550
+ Type(() => Number)
7551
+ ], Property.prototype, "purchasePrice", void 0);
7552
+ __decorate([
7553
+ Type(() => Number)
7554
+ ], Property.prototype, "growthPercent", void 0);
7490
7555
  __decorate([
7491
7556
  Type(() => Date)
7492
7557
  ], Property.prototype, "contractDate", void 0);
@@ -7499,6 +7564,15 @@ __decorate([
7499
7564
  __decorate([
7500
7565
  Type(() => PropertyCategory)
7501
7566
  ], Property.prototype, "category", void 0);
7567
+ __decorate([
7568
+ Type(() => Number)
7569
+ ], Property.prototype, "stampDuty", void 0);
7570
+ __decorate([
7571
+ Type(() => Number)
7572
+ ], Property.prototype, "legalFees", void 0);
7573
+ __decorate([
7574
+ Type(() => Number)
7575
+ ], Property.prototype, "otherCapitalCosts", void 0);
7502
7576
  __decorate([
7503
7577
  Type(() => PropertyValuation)
7504
7578
  ], Property.prototype, "valuations", void 0);
@@ -8256,19 +8330,109 @@ __decorate([
8256
8330
  Type(() => Document)
8257
8331
  ], DocumentFolder.prototype, "documents", void 0);
8258
8332
 
8333
+ class HoldingTypeExchange extends AbstractModel {
8334
+ }
8335
+ __decorate([
8336
+ Type(() => Date)
8337
+ ], HoldingTypeExchange.prototype, "updateDate", void 0);
8338
+ __decorate([
8339
+ Type(() => HoldingType)
8340
+ ], HoldingTypeExchange.prototype, "holdingTypes", void 0);
8341
+
8259
8342
  class HoldingType extends AbstractModel {
8343
+ get categoryLabel() {
8344
+ switch (this.category) {
8345
+ case HoldingTypeCategoryEnum.STOCK:
8346
+ return 'Shares';
8347
+ case HoldingTypeCategoryEnum.CRYPTO:
8348
+ return 'Cryptos';
8349
+ case HoldingTypeCategoryEnum.COLLECTIBLE:
8350
+ return 'Collectibles';
8351
+ case HoldingTypeCategoryEnum.UNLISTED_STOCK:
8352
+ return 'Unlisted stock';
8353
+ case HoldingTypeCategoryEnum.UNLISTED_UNIT:
8354
+ return 'Unlisted unit';
8355
+ case HoldingTypeCategoryEnum.OTHER:
8356
+ return 'Other';
8357
+ }
8358
+ }
8359
+ isOther() {
8360
+ return !this.isShare() && !this.isCrypto();
8361
+ }
8362
+ isShare() {
8363
+ return this.category === HoldingTypeCategoryEnum.STOCK;
8364
+ }
8365
+ isCrypto() {
8366
+ return this.category === HoldingTypeCategoryEnum.CRYPTO;
8367
+ }
8260
8368
  }
8369
+ __decorate([
8370
+ Type(() => Date)
8371
+ ], HoldingType.prototype, "lastUpdateDateOnExchange", void 0);
8372
+ __decorate([
8373
+ Type(() => Date)
8374
+ ], HoldingType.prototype, "updatedAt", void 0);
8261
8375
  __decorate([
8262
8376
  Type(() => User)
8263
8377
  ], HoldingType.prototype, "user", void 0);
8378
+ __decorate([
8379
+ Type(() => HoldingTypeExchange)
8380
+ ], HoldingType.prototype, "exchange", void 0);
8264
8381
 
8265
8382
  class HoldingSale extends AbstractModel {
8383
+ getCapitalGain(holding) {
8384
+ if (!this.price || !this.holding) {
8385
+ return 0;
8386
+ }
8387
+ return (this.price - holding.price) * this.quantity;
8388
+ }
8389
+ getNetCapitalGain(holding) {
8390
+ const capitalGain = this.getCapitalGain(holding);
8391
+ // 50% discount for holdings purchased over a year ago
8392
+ if (holding.heldMoreYear()) {
8393
+ return capitalGain / 2;
8394
+ }
8395
+ return capitalGain;
8396
+ }
8266
8397
  }
8398
+ __decorate([
8399
+ Type(() => Date)
8400
+ ], HoldingSale.prototype, "date", void 0);
8267
8401
  __decorate([
8268
8402
  Type(() => AppFile)
8269
8403
  ], HoldingSale.prototype, "file", void 0);
8270
8404
 
8271
8405
  class Holding extends AbstractModel {
8406
+ constructor() {
8407
+ super(...arguments);
8408
+ this.isTaxFree = false;
8409
+ }
8410
+ /**
8411
+ * Get total purchasing price
8412
+ */
8413
+ get purchaseValue() {
8414
+ // Price and entity may be empty when we use HoldingForm.currentValue
8415
+ if (!this.price || !this.quantity) {
8416
+ return 0;
8417
+ }
8418
+ return this.price * this.quantity;
8419
+ }
8420
+ /**
8421
+ * Get current market price
8422
+ */
8423
+ getMarketValue(holdingType) {
8424
+ return this.quantity * holdingType.price;
8425
+ }
8426
+ /**
8427
+ * Get percent difference between current and buy price
8428
+ */
8429
+ getGrowthCoefficient(holdingType) {
8430
+ return holdingType.price / this.price - 1;
8431
+ }
8432
+ heldMoreYear() {
8433
+ const yearTime = 1000 * 60 * 60 * 24 * 365;
8434
+ return (new FinancialYear().startDate.getTime() - this.date.getTime()) > yearTime;
8435
+ }
8272
8436
  }
8273
8437
  __decorate([
8274
8438
  Type(() => Date)
@@ -8287,6 +8451,176 @@ __decorate([
8287
8451
  Transform(({ value }) => new Collection(value))
8288
8452
  ], Holding.prototype, "sales", void 0);
8289
8453
 
8454
+ class AnnualClientDetails extends AbstractModel {
8455
+ constructor() {
8456
+ super(...arguments);
8457
+ this.financialYear = new FinancialYear().year;
8458
+ }
8459
+ }
8460
+ __decorate([
8461
+ Type(() => ClientDetails)
8462
+ ], AnnualClientDetails.prototype, "clientDetails", void 0);
8463
+
8464
+ class ClientIncomeTypes extends ClientIncomeTypes$1 {
8465
+ /**
8466
+ * Get count of selected income types
8467
+ */
8468
+ get length() {
8469
+ return Object.values(this).filter((value) => typeof value === 'boolean' && value).length;
8470
+ }
8471
+ }
8472
+
8473
+ var ClientInviteStatusEnum;
8474
+ (function (ClientInviteStatusEnum) {
8475
+ ClientInviteStatusEnum[ClientInviteStatusEnum["PENDING"] = 1] = "PENDING";
8476
+ ClientInviteStatusEnum[ClientInviteStatusEnum["REJECTED"] = 2] = "REJECTED";
8477
+ })(ClientInviteStatusEnum || (ClientInviteStatusEnum = {}));
8478
+
8479
+ var ClientInviteTypeEnum;
8480
+ (function (ClientInviteTypeEnum) {
8481
+ ClientInviteTypeEnum[ClientInviteTypeEnum["FROM_CLIENT"] = 1] = "FROM_CLIENT";
8482
+ ClientInviteTypeEnum[ClientInviteTypeEnum["FROM_EMPLOYEE"] = 2] = "FROM_EMPLOYEE";
8483
+ })(ClientInviteTypeEnum || (ClientInviteTypeEnum = {}));
8484
+
8485
+ class ClientInvite extends ClientInvite$1 {
8486
+ /**
8487
+ * Check if client invite status is pending
8488
+ */
8489
+ isPending() {
8490
+ return this.status === ClientInviteStatusEnum.PENDING;
8491
+ }
8492
+ /**
8493
+ * Check if client invite status is accepted
8494
+ */
8495
+ isAccepted() {
8496
+ return !this.isPending() && !this.isRejected();
8497
+ }
8498
+ /**
8499
+ * Check if client invite status is rejected
8500
+ */
8501
+ isRejected() {
8502
+ return this.status === ClientInviteStatusEnum.REJECTED;
8503
+ }
8504
+ /**
8505
+ * Check if client invite initiated by firm
8506
+ */
8507
+ isFromEmployee() {
8508
+ return this.type === ClientInviteTypeEnum.FROM_EMPLOYEE;
8509
+ }
8510
+ /**
8511
+ * Check if client invite initiated by client
8512
+ */
8513
+ isFromClient() {
8514
+ return this.type === ClientInviteTypeEnum.FROM_CLIENT;
8515
+ }
8516
+ get firstName() {
8517
+ return this.client ? this.client.firstName : this.registrationInvite?.firstName;
8518
+ }
8519
+ get email() {
8520
+ return this.client ? this.client.email : this.registrationInvite?.email;
8521
+ }
8522
+ }
8523
+ __decorate([
8524
+ Type(() => Date)
8525
+ ], ClientInvite.prototype, "sentOn", void 0);
8526
+ __decorate([
8527
+ Type(() => Date)
8528
+ ], ClientInvite.prototype, "updatedAt", void 0);
8529
+ __decorate([
8530
+ Type(() => Firm)
8531
+ ], ClientInvite.prototype, "firm", void 0);
8532
+ __decorate([
8533
+ Type(() => User)
8534
+ ], ClientInvite.prototype, "client", void 0);
8535
+ __decorate([
8536
+ Type(() => User)
8537
+ ], ClientInvite.prototype, "employee", void 0);
8538
+ __decorate([
8539
+ Type(() => RegistrationInvite)
8540
+ ], ClientInvite.prototype, "registrationInvite", void 0);
8541
+
8542
+ class ClientMovement extends ClientMovement$1 {
8543
+ }
8544
+ __decorate([
8545
+ Type(() => Firm)
8546
+ ], ClientMovement.prototype, "firm", void 0);
8547
+ __decorate([
8548
+ Type(() => User)
8549
+ ], ClientMovement.prototype, "client", void 0);
8550
+ __decorate([
8551
+ Type(() => User)
8552
+ ], ClientMovement.prototype, "employee", void 0);
8553
+ __decorate([
8554
+ Type(() => ServiceSubscription)
8555
+ ], ClientMovement.prototype, "subscription", void 0);
8556
+ __decorate([
8557
+ Type(() => Date)
8558
+ ], ClientMovement.prototype, "dateFrom", void 0);
8559
+ __decorate([
8560
+ Type(() => Date)
8561
+ ], ClientMovement.prototype, "dateTo", void 0);
8562
+
8563
+ /**
8564
+ * Client portfolio charts data based on ClientPortfolioReportCollection
8565
+ */
8566
+ class ClientPortfolioChartData {
8567
+ constructor(clientsPortfolioReportCollection) {
8568
+ this.clientsPortfolioReportCollection = clientsPortfolioReportCollection;
8569
+ }
8570
+ getPieChartData() {
8571
+ return this.clientsPortfolioReportCollection.items.map((clientPortfolioReport) => {
8572
+ return plainToClass(ChartData, {
8573
+ name: clientPortfolioReport.category,
8574
+ data: clientPortfolioReport.count
8575
+ });
8576
+ });
8577
+ }
8578
+ getBarChartData() {
8579
+ return [
8580
+ plainToClass(ChartData, {
8581
+ name: 'Total',
8582
+ data: [
8583
+ {
8584
+ label: 'Market value',
8585
+ value: this.clientsPortfolioReportCollection.marketValue
8586
+ },
8587
+ {
8588
+ label: 'Loan balance',
8589
+ value: this.clientsPortfolioReportCollection.loanBalance
8590
+ },
8591
+ {
8592
+ label: 'Equity position',
8593
+ value: this.clientsPortfolioReportCollection.equityPosition
8594
+ }
8595
+ ]
8596
+ }),
8597
+ plainToClass(ChartData, {
8598
+ name: 'Average',
8599
+ data: [
8600
+ {
8601
+ label: 'Market value',
8602
+ value: this.clientsPortfolioReportCollection.averageMarketValue
8603
+ },
8604
+ {
8605
+ label: 'Loan balance',
8606
+ value: this.clientsPortfolioReportCollection.averageLoanBalance
8607
+ },
8608
+ {
8609
+ label: 'Equity position',
8610
+ value: this.clientsPortfolioReportCollection.averageEquityPosition
8611
+ }
8612
+ ]
8613
+ })
8614
+ ];
8615
+ }
8616
+ }
8617
+
8618
+ /**
8619
+ * Class describes client's portfolio report information
8620
+ */
8621
+ class ClientPortfolioReport extends AbstractModel {
8622
+ }
8623
+
8290
8624
  const NAME_TOKEN = 'token';
8291
8625
  const NAME_REFRESH_TOKEN = 'refreshToken';
8292
8626
  class JwtService extends JwtHelperService {
@@ -8695,6 +9029,10 @@ const ENDPOINTS = {
8695
9029
  CLIENT_INCOME_TYPES_POST: new Endpoint('POST', '\\/client-income-types'),
8696
9030
  COUNTRIES_GET: new Endpoint('GET', '\\/countries'),
8697
9031
  CORELOGIC_TOKEN_GET: new Endpoint('GET', '/access\\/oauth\\/token.*$'),
9032
+ ANNUAL_CLIENT_DETAILS_GET: new Endpoint('GET', '\\/annual-client-details'),
9033
+ ANNUAL_CLIENT_DETAILS_POST: new Endpoint('POST', '\\/annual-client-details'),
9034
+ ANNUAL_CLIENT_DETAILS_PUT: new Endpoint('PUT', '\\/annual-client-details\\/\\d+'),
9035
+ ANNUAL_CLIENT_DETAILS_DELETE: new Endpoint('DELETE', '\\/annual-client-details\\/\\d+'),
8698
9036
  DEPRECIATIONS_OPENING_GET: new Endpoint('GET', '\\/depreciations\\/\\opening-balance\.\*'),
8699
9037
  DEPRECIATIONS_GET: new Endpoint('GET', '\\/depreciations'),
8700
9038
  DEPRECIATIONS_POST: new Endpoint('POST', '\\/depreciations'),
@@ -8737,6 +9075,18 @@ const ENDPOINTS = {
8737
9075
  LOANS_PAYOUT_DELETE: new Endpoint('DELETE', '\\/loans\\/\\d+\\/payout\\/\\d+'),
8738
9076
  LOANS_CALCULATION_POST: new Endpoint('POST', '\\/bank-accounts\\/loans\\/calculation'),
8739
9077
  LOGIN_POST: new Endpoint('POST', '\\/login'),
9078
+ HOLDINGS_GET: new Endpoint('GET', '\\/holdings'),
9079
+ HOLDINGS_POST: new Endpoint('POST', '\\/holdings'),
9080
+ HOLDINGS_PUT: new Endpoint('PUT', '\\/holdings\\/\\d+'),
9081
+ HOLDINGS_DELETE: new Endpoint('DELETE', '\\/holdings\\/\\d+'),
9082
+ HOLDING_TYPES_GET: new Endpoint('GET', '\\/holding-types'),
9083
+ HOLDING_TYPES_POST: new Endpoint('POST', '\\/holding-types'),
9084
+ HOLDING_TYPES_PUT: new Endpoint('PUT', '\\/holding-types\\/\\d+'),
9085
+ HOLDING_TYPES_DELETE: new Endpoint('DELETE', '\\/holding-types\\/\\d+'),
9086
+ HOLDING_SALES_GET: new Endpoint('GET', '\\/holding-sales'),
9087
+ HOLDING_SALES_POST: new Endpoint('POST', '\\/holding-sales'),
9088
+ HOLDING_SALES_PUT: new Endpoint('PUT', '\\/holding-sales\\/\\d+'),
9089
+ HOLDING_SALES_DELETE: new Endpoint('DELETE', '\\/holding-sales\\/\\d+'),
8740
9090
  NOTIFICATIONS_GET: new Endpoint('GET', '\\/service-notifications'),
8741
9091
  OCCUPATIONS_GET: new Endpoint('GET', '\\/occupations'),
8742
9092
  PROPERTIES_GET: new Endpoint('GET', '\\/properties'),
@@ -9600,7 +9950,6 @@ class UserService {
9600
9950
  }
9601
9951
  listenEvents() {
9602
9952
  this.listenServiceSubscriptionUpdated();
9603
- this.listenPropertySale();
9604
9953
  }
9605
9954
  get() {
9606
9955
  if (!this.cache) {
@@ -9735,14 +10084,6 @@ class UserService {
9735
10084
  listenServiceSubscriptionUpdated() {
9736
10085
  this.eventDispatcherService.on(AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(() => this.resetCache());
9737
10086
  }
9738
- /**
9739
- * capital losses updates on property sale
9740
- */
9741
- listenPropertySale() {
9742
- this.eventDispatcherService.on2(...PropertySale.getEventNames('post', 'delete')).subscribe(() => {
9743
- this.resetCache();
9744
- });
9745
- }
9746
10087
  /**
9747
10088
  * @TODO remove when the class refactored on RestService
9748
10089
  * Subscribe to http events and run callback.
@@ -9934,18 +10275,6 @@ var ClientDetailsWorkingHolidayMakerEnum;
9934
10275
  ClientDetailsWorkingHolidayMakerEnum[ClientDetailsWorkingHolidayMakerEnum["VISA462"] = 2] = "VISA462";
9935
10276
  })(ClientDetailsWorkingHolidayMakerEnum || (ClientDetailsWorkingHolidayMakerEnum = {}));
9936
10277
 
9937
- var ClientInviteStatusEnum;
9938
- (function (ClientInviteStatusEnum) {
9939
- ClientInviteStatusEnum[ClientInviteStatusEnum["PENDING"] = 1] = "PENDING";
9940
- ClientInviteStatusEnum[ClientInviteStatusEnum["REJECTED"] = 2] = "REJECTED";
9941
- })(ClientInviteStatusEnum || (ClientInviteStatusEnum = {}));
9942
-
9943
- var ClientInviteTypeEnum;
9944
- (function (ClientInviteTypeEnum) {
9945
- ClientInviteTypeEnum[ClientInviteTypeEnum["FROM_CLIENT"] = 1] = "FROM_CLIENT";
9946
- ClientInviteTypeEnum[ClientInviteTypeEnum["FROM_EMPLOYEE"] = 2] = "FROM_EMPLOYEE";
9947
- })(ClientInviteTypeEnum || (ClientInviteTypeEnum = {}));
9948
-
9949
10278
  var DepreciationCalculationPercentEnum;
9950
10279
  (function (DepreciationCalculationPercentEnum) {
9951
10280
  DepreciationCalculationPercentEnum[DepreciationCalculationPercentEnum["PRIME_COST"] = 100] = "PRIME_COST";
@@ -10326,154 +10655,6 @@ class Badge extends AbstractModel {
10326
10655
  }
10327
10656
  }
10328
10657
 
10329
- class ClientIncomeTypes extends ClientIncomeTypes$1 {
10330
- /**
10331
- * Get count of selected income types
10332
- */
10333
- get length() {
10334
- return Object.values(this).filter((value) => typeof value === 'boolean' && value).length;
10335
- }
10336
- }
10337
-
10338
- class ClientInvite extends ClientInvite$1 {
10339
- /**
10340
- * Check if client invite status is pending
10341
- */
10342
- isPending() {
10343
- return this.status === ClientInviteStatusEnum.PENDING;
10344
- }
10345
- /**
10346
- * Check if client invite status is accepted
10347
- */
10348
- isAccepted() {
10349
- return !this.isPending() && !this.isRejected();
10350
- }
10351
- /**
10352
- * Check if client invite status is rejected
10353
- */
10354
- isRejected() {
10355
- return this.status === ClientInviteStatusEnum.REJECTED;
10356
- }
10357
- /**
10358
- * Check if client invite initiated by firm
10359
- */
10360
- isFromEmployee() {
10361
- return this.type === ClientInviteTypeEnum.FROM_EMPLOYEE;
10362
- }
10363
- /**
10364
- * Check if client invite initiated by client
10365
- */
10366
- isFromClient() {
10367
- return this.type === ClientInviteTypeEnum.FROM_CLIENT;
10368
- }
10369
- get firstName() {
10370
- return this.client ? this.client.firstName : this.registrationInvite?.firstName;
10371
- }
10372
- get email() {
10373
- return this.client ? this.client.email : this.registrationInvite?.email;
10374
- }
10375
- }
10376
- __decorate([
10377
- Type(() => Date)
10378
- ], ClientInvite.prototype, "sentOn", void 0);
10379
- __decorate([
10380
- Type(() => Date)
10381
- ], ClientInvite.prototype, "updatedAt", void 0);
10382
- __decorate([
10383
- Type(() => Firm)
10384
- ], ClientInvite.prototype, "firm", void 0);
10385
- __decorate([
10386
- Type(() => User)
10387
- ], ClientInvite.prototype, "client", void 0);
10388
- __decorate([
10389
- Type(() => User)
10390
- ], ClientInvite.prototype, "employee", void 0);
10391
- __decorate([
10392
- Type(() => RegistrationInvite)
10393
- ], ClientInvite.prototype, "registrationInvite", void 0);
10394
-
10395
- class ClientMovement extends ClientMovement$1 {
10396
- }
10397
- __decorate([
10398
- Type(() => Firm)
10399
- ], ClientMovement.prototype, "firm", void 0);
10400
- __decorate([
10401
- Type(() => User)
10402
- ], ClientMovement.prototype, "client", void 0);
10403
- __decorate([
10404
- Type(() => User)
10405
- ], ClientMovement.prototype, "employee", void 0);
10406
- __decorate([
10407
- Type(() => ServiceSubscription)
10408
- ], ClientMovement.prototype, "subscription", void 0);
10409
- __decorate([
10410
- Type(() => Date)
10411
- ], ClientMovement.prototype, "dateFrom", void 0);
10412
- __decorate([
10413
- Type(() => Date)
10414
- ], ClientMovement.prototype, "dateTo", void 0);
10415
-
10416
- /**
10417
- * Client portfolio charts data based on ClientPortfolioReportCollection
10418
- */
10419
- class ClientPortfolioChartData {
10420
- constructor(clientsPortfolioReportCollection) {
10421
- this.clientsPortfolioReportCollection = clientsPortfolioReportCollection;
10422
- }
10423
- getPieChartData() {
10424
- return this.clientsPortfolioReportCollection.items.map((clientPortfolioReport) => {
10425
- return plainToClass(ChartData, {
10426
- name: clientPortfolioReport.category,
10427
- data: clientPortfolioReport.count
10428
- });
10429
- });
10430
- }
10431
- getBarChartData() {
10432
- return [
10433
- plainToClass(ChartData, {
10434
- name: 'Total',
10435
- data: [
10436
- {
10437
- label: 'Market value',
10438
- value: this.clientsPortfolioReportCollection.marketValue
10439
- },
10440
- {
10441
- label: 'Loan balance',
10442
- value: this.clientsPortfolioReportCollection.loanBalance
10443
- },
10444
- {
10445
- label: 'Equity position',
10446
- value: this.clientsPortfolioReportCollection.equityPosition
10447
- }
10448
- ]
10449
- }),
10450
- plainToClass(ChartData, {
10451
- name: 'Average',
10452
- data: [
10453
- {
10454
- label: 'Market value',
10455
- value: this.clientsPortfolioReportCollection.averageMarketValue
10456
- },
10457
- {
10458
- label: 'Loan balance',
10459
- value: this.clientsPortfolioReportCollection.averageLoanBalance
10460
- },
10461
- {
10462
- label: 'Equity position',
10463
- value: this.clientsPortfolioReportCollection.averageEquityPosition
10464
- }
10465
- ]
10466
- })
10467
- ];
10468
- }
10469
- }
10470
-
10471
- /**
10472
- * Class describes client's portfolio report information
10473
- */
10474
- class ClientPortfolioReport extends AbstractModel {
10475
- }
10476
-
10477
10658
  var AlphabetColorsEnum;
10478
10659
  (function (AlphabetColorsEnum) {
10479
10660
  AlphabetColorsEnum["A"] = "#9CC3D5";
@@ -10797,8 +10978,8 @@ class MyTaxBusinessLosses {
10797
10978
  }
10798
10979
  }
10799
10980
 
10800
- ;
10801
10981
  /**
10982
+ * @TODO vik/nicole test
10802
10983
  * Report related to Property sales CGT details.
10803
10984
  * All fields are about current year, except netCapitalLoss
10804
10985
  *
@@ -10806,10 +10987,11 @@ class MyTaxBusinessLosses {
10806
10987
  class MyTaxCgt {
10807
10988
  static createFrom(propertySales, properties, clientCapitalLoss) {
10808
10989
  return plainToClass(MyTaxCgt, {
10809
- hasCapitalGain: !!propertySales.grossCGTAfterLoss,
10810
- hasExemption: !!propertySales.grossCGTAfterLoss && this.isCGTApplicable(propertySales, properties),
10811
- netCapitalGain: propertySales.sumBy('netCGT'),
10812
- grossCapitalGain: propertySales.grossCGTAfterLoss,
10990
+ // @TODO vik losses should be applied
10991
+ hasCapitalGain: !!propertySales.grossCapitalGain,
10992
+ hasExemption: !!propertySales.grossCapitalGain && this.isCGTApplicable(propertySales, properties),
10993
+ netCapitalGain: propertySales.sumBy('netCapitalGain'),
10994
+ grossCapitalGain: propertySales.grossCapitalGain,
10813
10995
  netCapitalLoss: clientCapitalLoss
10814
10996
  });
10815
10997
  }
@@ -14036,12 +14218,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
14036
14218
  args: ['environment']
14037
14219
  }] }, { type: ToastService }, { type: SseService }]; } });
14038
14220
 
14039
- var MessagesEnum$2;
14221
+ var MessagesEnum$3;
14040
14222
  (function (MessagesEnum) {
14041
14223
  MessagesEnum["LOGO_UPDATED"] = "Logo updated successfully";
14042
14224
  MessagesEnum["LOGO_ERROR_FORMAT"] = "Wrong file format. Allowed extensions: jpg, img, png";
14043
14225
  MessagesEnum["LOGO_ERROR_SIZE"] = "The file is too big. Maximum size is 2mb";
14044
- })(MessagesEnum$2 || (MessagesEnum$2 = {}));
14226
+ })(MessagesEnum$3 || (MessagesEnum$3 = {}));
14045
14227
 
14046
14228
  class SoleBusinessService extends RestService {
14047
14229
  constructor() {
@@ -14065,7 +14247,7 @@ class SoleBusinessService extends RestService {
14065
14247
  replace(tempCache, plainToClass(SoleBusiness, updatedBusiness));
14066
14248
  this.cache = tempCache;
14067
14249
  this.cacheSubject.next(this.cache);
14068
- this.toastService.success(MessagesEnum$2.LOGO_UPDATED);
14250
+ this.toastService.success(MessagesEnum$3.LOGO_UPDATED);
14069
14251
  }), catchError((error) => {
14070
14252
  // Show error when user provided wrong image (format or size)
14071
14253
  if (error.status === 422) {
@@ -15504,6 +15686,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
15504
15686
  }]
15505
15687
  }] });
15506
15688
 
15689
+ class AnnualClientDetailsService extends RestService$1 {
15690
+ constructor() {
15691
+ super(...arguments);
15692
+ this.modelClass = AnnualClientDetails;
15693
+ this.collectionClass = Collection;
15694
+ this.endpointUri = 'annual-client-details';
15695
+ this.isApiPlatform = true;
15696
+ this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch', 'delete'];
15697
+ }
15698
+ }
15699
+ AnnualClientDetailsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AnnualClientDetailsService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
15700
+ AnnualClientDetailsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AnnualClientDetailsService, providedIn: 'root' });
15701
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AnnualClientDetailsService, decorators: [{
15702
+ type: Injectable,
15703
+ args: [{
15704
+ providedIn: 'root'
15705
+ }]
15706
+ }] });
15707
+
15507
15708
  /**
15508
15709
  * Service that works with Occupations
15509
15710
  */
@@ -15621,14 +15822,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
15621
15822
  }]
15622
15823
  }] });
15623
15824
 
15624
- /**
15625
- * Service that handling banks logic
15626
- */
15627
15825
  class HoldingService extends RestService$1 {
15628
15826
  constructor() {
15629
15827
  super(...arguments);
15630
15828
  this.modelClass = Holding;
15631
- this.collectionClass = Collection;
15829
+ this.collectionClass = HoldingCollection;
15632
15830
  this.endpointUri = 'holdings';
15633
15831
  this.isApiPlatform = true;
15634
15832
  this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
@@ -15643,9 +15841,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
15643
15841
  }]
15644
15842
  }] });
15645
15843
 
15646
- /**
15647
- * Service that handling banks logic
15648
- */
15649
15844
  class HoldingTypeService extends RestService$1 {
15650
15845
  constructor() {
15651
15846
  super(...arguments);
@@ -15665,9 +15860,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
15665
15860
  }]
15666
15861
  }] });
15667
15862
 
15668
- /**
15669
- * Service that handling banks logic
15670
- */
15671
15863
  class HoldingSaleService extends RestService$1 {
15672
15864
  constructor() {
15673
15865
  super(...arguments);
@@ -17344,15 +17536,15 @@ function passwordMatchValidator(newPassControlName, confirmPassControlName) {
17344
17536
  };
17345
17537
  }
17346
17538
 
17347
- var MessagesEnum$1;
17539
+ var MessagesEnum$2;
17348
17540
  (function (MessagesEnum) {
17349
17541
  MessagesEnum["INVALID_DATE"] = "The date should not be before $1";
17350
- })(MessagesEnum$1 || (MessagesEnum$1 = {}));
17542
+ })(MessagesEnum$2 || (MessagesEnum$2 = {}));
17351
17543
 
17352
17544
  /**
17353
17545
  * Validation function, that checks If date form value is more than provided date
17354
17546
  */
17355
- function minDateValidator(date, message = MessagesEnum$1.INVALID_DATE.replace('$1', new DatePipe('en-US').transform(date))) {
17547
+ function minDateValidator(date, message = MessagesEnum$2.INVALID_DATE.replace('$1', new DatePipe('en-US').transform(date))) {
17356
17548
  return (control) => {
17357
17549
  if (!control.value) {
17358
17550
  return null;
@@ -18112,6 +18304,38 @@ class BankLoginForm extends AbstractForm {
18112
18304
  }
18113
18305
  }
18114
18306
 
18307
+ class AnnualClientDetailsForm extends AbstractForm {
18308
+ constructor(annualClientDetails = plainToClass(AnnualClientDetails, {})) {
18309
+ super({
18310
+ capitalLoss: new UntypedFormControl(annualClientDetails.capitalLoss, Validators.required),
18311
+ privateHealthCare: new UntypedFormControl(annualClientDetails.privateHealthCare, Validators.required),
18312
+ spouse: new UntypedFormControl(annualClientDetails.spouse, Validators.required),
18313
+ spouseAnnualIncome: new UntypedFormControl(annualClientDetails.spouseAnnualIncome, conditionalValidator(() => this.get('spouse').value, Validators.required)),
18314
+ hasDependants: new UntypedFormControl(!!annualClientDetails.spouseAnnualIncome, Validators.required),
18315
+ dependants: new UntypedFormControl(annualClientDetails.dependants, conditionalValidator(() => this.get('hasDependants').value, Validators.required)),
18316
+ hasStudentLoan: new UntypedFormControl(!!annualClientDetails.studentLoanAmount, Validators.required),
18317
+ studentLoanAmount: new UntypedFormControl(annualClientDetails.studentLoanAmount, conditionalValidator(() => this.get('hasStudentLoan').value, Validators.required)),
18318
+ }, annualClientDetails);
18319
+ this.annualClientDetails = annualClientDetails;
18320
+ this.watchFieldForToggle('spouse', 'spouseAnnualIncome');
18321
+ this.watchFieldForToggle('hasDependants', 'dependants');
18322
+ this.watchFieldForToggle('hasStudentLoan', 'studentLoanAmount');
18323
+ this.emitValues();
18324
+ }
18325
+ watchFieldForToggle(field, dependantField) {
18326
+ this.get(field).valueChanges.subscribe((value) => this.toggleField(dependantField, !!value));
18327
+ }
18328
+ toggleField(field, enable) {
18329
+ if (enable) {
18330
+ this.get(field).enable();
18331
+ }
18332
+ else {
18333
+ this.get(field).setValue(0);
18334
+ this.get(field).disable();
18335
+ }
18336
+ }
18337
+ }
18338
+
18115
18339
  class ClientIncomeTypesForm extends AbstractForm {
18116
18340
  constructor(clientIncomeTypes = plainToClass(ClientIncomeTypes, {})) {
18117
18341
  super({
@@ -18266,22 +18490,18 @@ class PropertySaleCostSaleForm extends AbstractForm {
18266
18490
  commission: new UntypedFormControl(propertySale.commission || 0, Validators.required),
18267
18491
  legalFees: new UntypedFormControl(propertySale.legalFees || 0, Validators.required),
18268
18492
  otherCost: new UntypedFormControl(propertySale.otherCost || 0, Validators.required),
18269
- capitalLoss: new UntypedFormControl(propertySale.capitalLoss || 0, Validators.required),
18270
- grossCGT: new UntypedFormControl({ value: propertySale.grossCGT, disabled: true }, Validators.required),
18271
- grossCGTAfterLoss: new UntypedFormControl({ value: propertySale.grossCGTAfterLoss, disabled: true }, Validators.required),
18493
+ grossCapitalGain: new UntypedFormControl({ value: propertySale.grossCapitalGain, disabled: true }, Validators.required),
18272
18494
  }, propertySale);
18273
18495
  this.propertySale = propertySale;
18274
18496
  this.property = property;
18275
18497
  this.listenEvents();
18276
- this.updateGrossCGT();
18498
+ this.updateGrossCapitalGain();
18277
18499
  }
18278
18500
  listenEvents() {
18279
18501
  this.listenCommissionUpdated();
18280
18502
  this.listenLegalFeesUpdated();
18281
18503
  this.listenOtherCostUpdated();
18282
18504
  this.listenPriceUpdated();
18283
- this.listenCapitalLossUpdated();
18284
- this.listenGrossCGT();
18285
18505
  }
18286
18506
  /**
18287
18507
  * Get property instance based on provided property and form value to get actual form calculations
@@ -18291,41 +18511,31 @@ class PropertySaleCostSaleForm extends AbstractForm {
18291
18511
  return plainToClass(PropertySale, Object.assign({}, this.propertySale, this.getRawValue()));
18292
18512
  }
18293
18513
  submit(data = {}) {
18294
- // 'grossCGT' field is always disabled, but we need it to submit result
18295
- Object.assign(data, { grossCGT: this.get('grossCGT').value });
18514
+ // 'grossCapitalGain' field is always disabled, but we need it to submit result
18515
+ Object.assign(data, { grossCapitalGain: this.get('grossCapitalGain').value });
18296
18516
  return super.submit(data);
18297
18517
  }
18298
- updateGrossCGT() {
18299
- this.get('grossCGT').setValue(Math.round(this.property.calculateGrossCGT(this.getPropertySale())).toFixed());
18518
+ updateGrossCapitalGain() {
18519
+ this.get('grossCapitalGain').setValue(Math.round(this.property.calculateGrossCapitalGain(this.getPropertySale())).toFixed());
18300
18520
  }
18301
18521
  listenCommissionUpdated() {
18302
18522
  this.get('commission').valueChanges.subscribe(() => {
18303
- this.updateGrossCGT();
18523
+ this.updateGrossCapitalGain();
18304
18524
  });
18305
18525
  }
18306
18526
  listenLegalFeesUpdated() {
18307
18527
  this.get('legalFees').valueChanges.subscribe(() => {
18308
- this.updateGrossCGT();
18528
+ this.updateGrossCapitalGain();
18309
18529
  });
18310
18530
  }
18311
18531
  listenOtherCostUpdated() {
18312
18532
  this.get('otherCost').valueChanges.subscribe(() => {
18313
- this.updateGrossCGT();
18533
+ this.updateGrossCapitalGain();
18314
18534
  });
18315
18535
  }
18316
18536
  listenPriceUpdated() {
18317
18537
  this.get('price').valueChanges.subscribe(() => {
18318
- this.updateGrossCGT();
18319
- });
18320
- }
18321
- listenCapitalLossUpdated() {
18322
- this.get('capitalLoss').valueChanges.subscribe(() => {
18323
- this.updateGrossCGT();
18324
- });
18325
- }
18326
- listenGrossCGT() {
18327
- this.get('grossCGT').valueChanges.subscribe((grossCGT) => {
18328
- this.get('grossCGTAfterLoss').setValue(this.getPropertySale().grossCGTAfterLoss);
18538
+ this.updateGrossCapitalGain();
18329
18539
  });
18330
18540
  }
18331
18541
  }
@@ -18338,7 +18548,8 @@ class PropertySaleExemptionsForm extends AbstractForm {
18338
18548
  super({
18339
18549
  taxExemption: new UntypedFormControl(taxExemptions.findBy('id', propertySale.taxExemption?.id ?? property.getCGTExemption(propertySale))),
18340
18550
  taxExemptionMetaFields: new UntypedFormArray([]),
18341
- netCGT: new UntypedFormControl(propertySale.netCGT)
18551
+ grossCapitalGain: new UntypedFormControl(propertySale.grossCapitalGain),
18552
+ netCapitalGain: new UntypedFormControl(propertySale.netCapitalGain),
18342
18553
  }, propertySale);
18343
18554
  this.propertySale = propertySale;
18344
18555
  this.property = property;
@@ -18346,7 +18557,7 @@ class PropertySaleExemptionsForm extends AbstractForm {
18346
18557
  if (propertySale.taxExemption) {
18347
18558
  this.setFormMetaFieldsControls();
18348
18559
  }
18349
- this.updateNetCGT();
18560
+ this.updateCapitalGains();
18350
18561
  this.listenEvents();
18351
18562
  }
18352
18563
  listenEvents() {
@@ -18358,12 +18569,19 @@ class PropertySaleExemptionsForm extends AbstractForm {
18358
18569
  getPropertySale() {
18359
18570
  return plainToClass(PropertySale, Object.assign({}, this.propertySale, this.getRawValue()));
18360
18571
  }
18361
- updateNetCGT() {
18362
- this.get('netCGT').setValue(this.property.calculateNetCGT(this.getPropertySale()));
18572
+ updateCapitalGains() {
18573
+ this.updateGrossCapitalGain();
18574
+ this.updateNetCapitalGain();
18575
+ }
18576
+ updateNetCapitalGain() {
18577
+ this.get('netCapitalGain').setValue(this.property.calculateNetCapitalGain(this.getPropertySale()));
18578
+ }
18579
+ updateGrossCapitalGain() {
18580
+ this.get('grossCapitalGain').setValue(this.property.calculateGrossCapitalGain(this.getPropertySale()));
18363
18581
  }
18364
18582
  listenTaxExemptionUpdated() {
18365
18583
  this.get('taxExemption').valueChanges.subscribe((taxExemption) => {
18366
- this.updateNetCGT();
18584
+ this.updateCapitalGains();
18367
18585
  this.setFormMetaFieldsControls(taxExemption);
18368
18586
  });
18369
18587
  }
@@ -18378,6 +18596,9 @@ class PropertySaleExemptionsForm extends AbstractForm {
18378
18596
  const formArray = this.get('taxExemptionMetaFields');
18379
18597
  // clean up
18380
18598
  formArray.clear();
18599
+ if (!currentTaxExemption) {
18600
+ return;
18601
+ }
18381
18602
  // show all tax exemption meta fields
18382
18603
  currentTaxExemption.metaFields.forEach((metaField) => {
18383
18604
  // use property sale tax exemption meta field value if it exists
@@ -18593,6 +18814,9 @@ class MyTaxBusinessIncomeOrLossesForm extends AbstractForm {
18593
18814
  }
18594
18815
  }
18595
18816
 
18817
+ /**
18818
+ * @TODO vik/nicole test
18819
+ */
18596
18820
  class MyTaxCgtForm extends AbstractForm {
18597
18821
  constructor(gainsOrLosses) {
18598
18822
  super({
@@ -19470,10 +19694,10 @@ class TransactionBaseForm extends AbstractForm {
19470
19694
  }
19471
19695
  }
19472
19696
 
19473
- var MessagesEnum;
19697
+ var MessagesEnum$1;
19474
19698
  (function (MessagesEnum) {
19475
19699
  MessagesEnum["DATE_VALIDATION_ERROR"] = "The transaction date is before the ownership date, please update the date to confirm";
19476
- })(MessagesEnum || (MessagesEnum = {}));
19700
+ })(MessagesEnum$1 || (MessagesEnum$1 = {}));
19477
19701
 
19478
19702
  class TransactionForm extends TransactionBaseForm {
19479
19703
  constructor(transaction, registeredForGst, allocations, controls = {}) {
@@ -19488,7 +19712,7 @@ class TransactionForm extends TransactionBaseForm {
19488
19712
  });
19489
19713
  // forbid to add transactions before property ownership
19490
19714
  if (transaction.property) {
19491
- this.get('date').addValidators(minDateValidator(transaction.property.myShare.fromDate, MessagesEnum.DATE_VALIDATION_ERROR));
19715
+ this.get('date').addValidators(minDateValidator(transaction.property.myShare.fromDate, MessagesEnum$1.DATE_VALIDATION_ERROR));
19492
19716
  }
19493
19717
  // property income usually comes with fees, add empty control for new transactions
19494
19718
  if (!transaction.id && transaction.property && !transaction.transactions.length && transaction.isCredit()) {
@@ -19743,11 +19967,91 @@ class DepreciationForm extends TransactionBaseForm {
19743
19967
  }
19744
19968
  }
19745
19969
 
19970
+ class HoldingSaleForm extends AbstractForm {
19971
+ constructor(sale, holding, type) {
19972
+ super({
19973
+ quantity: new UntypedFormControl(sale.quantity, [Validators.required, Validators.max(holding.currentQuantity)]),
19974
+ price: new UntypedFormControl(sale.price || type.price, Validators.required),
19975
+ fee: new UntypedFormControl(sale.fee, Validators.required),
19976
+ date: new UntypedFormControl(sale.date, Validators.required),
19977
+ grossCapitalGain: new UntypedFormControl({ value: sale.grossCapitalGain, disabled: true }),
19978
+ netCapitalGain: new UntypedFormControl({ value: sale.netCapitalGain, disabled: true }),
19979
+ file: new UntypedFormControl(sale.file)
19980
+ }, sale);
19981
+ this.holding = holding;
19982
+ if (sale.id) {
19983
+ this.emitValues();
19984
+ }
19985
+ this.listenEvents();
19986
+ }
19987
+ listenEvents() {
19988
+ this.listenQuantityChanges();
19989
+ this.listenPriceChanges();
19990
+ }
19991
+ listenQuantityChanges() {
19992
+ this.get('quantity').valueChanges.subscribe(() => {
19993
+ this.updateGainFields();
19994
+ });
19995
+ }
19996
+ listenPriceChanges() {
19997
+ this.get('price').valueChanges.subscribe(() => {
19998
+ this.updateGainFields();
19999
+ });
20000
+ }
20001
+ updateGainFields() {
20002
+ this.get('grossCapitalGain').setValue(this.currentValue.getCapitalGain(this.holding));
20003
+ this.get('netCapitalGain').setValue(this.currentValue.getNetCapitalGain(this.holding));
20004
+ }
20005
+ }
20006
+
20007
+ class HoldingTypeForm extends AbstractForm {
20008
+ constructor(holdingType = plainToClass(HoldingType, {})) {
20009
+ super({
20010
+ category: new UntypedFormControl(holdingType.category, Validators.required),
20011
+ name: new UntypedFormControl(holdingType.name, Validators.required),
20012
+ description: new UntypedFormControl(holdingType.description, Validators.required),
20013
+ price: new UntypedFormControl(holdingType.price, [Validators.required, Validators.min(0)]),
20014
+ dividendPercent: new UntypedFormControl(holdingType.dividendPercent, Validators.min(0))
20015
+ }, holdingType);
20016
+ }
20017
+ }
20018
+
20019
+ class HoldingForm extends AbstractForm {
20020
+ constructor(holding) {
20021
+ super({
20022
+ isTaxFree: new UntypedFormControl(holding.isTaxFree, Validators.required),
20023
+ quantity: new UntypedFormControl(holding.quantity, [Validators.required, Validators.min(0)]),
20024
+ price: new UntypedFormControl(holding.price, [Validators.required, Validators.min(0)]),
20025
+ fee: new UntypedFormControl(holding.fee, [Validators.required, Validators.min(0)]),
20026
+ date: new UntypedFormControl(holding.date, Validators.required),
20027
+ type: new UntypedFormControl(holding.type, Validators.required),
20028
+ ownershipPercent: new UntypedFormControl(holding.ownershipPercent || 100, Validators.required),
20029
+ file: new UntypedFormControl(holding.file)
20030
+ }, holding);
20031
+ }
20032
+ }
20033
+
20034
+ var MessagesEnum;
20035
+ (function (MessagesEnum) {
20036
+ MessagesEnum["HOLDING_CREATED"] = "Holding created";
20037
+ MessagesEnum["HOLDING_UPDATED"] = "Holding updated";
20038
+ MessagesEnum["HOLDING_CONFIRM_DELETE"] = "Are you sure you want to delete this holding?";
20039
+ MessagesEnum["HOLDING_DELETED"] = "Holding deleted";
20040
+ MessagesEnum["HOLDING_SALE_CREATED"] = "Holding sale created";
20041
+ MessagesEnum["HOLDING_SALE_UPDATED"] = "Holding sale updated";
20042
+ MessagesEnum["HOLDING_SALE_CONFIRM_DELETE"] = "Are you sure you want to delete this holding sale?";
20043
+ MessagesEnum["HOLDING_SALE_DELETED"] = "Holding sale deleted";
20044
+ MessagesEnum["HOLDING_TYPE_CREATED"] = "Holding type created";
20045
+ MessagesEnum["HOLDING_TYPE_UPDATED"] = "Holding type updated";
20046
+ MessagesEnum["HOLDING_TYPE_CONFIRM_DELETE"] = "Are you sure you want to delete this holding type?";
20047
+ MessagesEnum["HOLDING_TYPE_DELETED"] = "Holding type deleted";
20048
+ })(MessagesEnum || (MessagesEnum = {}));
20049
+
19746
20050
  // @TODO Alex: Create indexes everywhere and break this file to imports from indexes
19747
20051
 
19748
20052
  /**
19749
20053
  * Generated bundle index. Do not edit.
19750
20054
  */
19751
20055
 
19752
- export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressForm, AddressService, AddressTypeEnum, AllocationGroup, AllocationGroupCollection, AllocationRule, AllocationRuleCollection, AllocationRuleConditionComparisonOperatorEnum, AllocationRuleConditionFieldEnum, AllocationRuleConditionOperatorEnum, AllocationRuleForm, AllocationRuleService, AllocationRuleTransaction, AllocationRuleTransactionMetaField, AllocationRuleTypeEnum, AlphabetColorsEnum, AnnualFrequencyEnum, AppEvent, AppEvent2, AppEventTypeEnum, AppFile, AssetEntityTypeEnum, AssetTypeEnum, AssetsService, AuthService, BANK_ACCOUNT_TYPES, Badge, BadgeColorEnum, Bank, BankAccount, BankAccountAddManualForm, BankAccountAllocationForm, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountImportForm, BankAccountPropertiesForm, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankAccountsImportForm, BankConnection, BankConnectionService, BankConnectionStatusEnum, BankExternalStats, BankLoginData, BankLoginForm, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasReport, BasReportForm, BasReportService, BasiqConfig, BasiqJob, BasiqJobResponse, BasiqJobStep, BasiqService, BasiqToken, BasiqTokenService, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, BusinessTypeEnum, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsKeepSign, ChartAccountsListEnum, ChartAccountsMetaField, ChartAccountsMetaFieldListEnum, ChartAccountsMetaFieldTypeEnum, ChartAccountsSalaryAdjustmentsListEnum, ChartAccountsSalaryIncludedListEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartAccountsValue, ChartData, ChartSerie, Chat, ChatCollection, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientDetails, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientIncomeTypes, ClientIncomeTypesForm, ClientIncomeTypesService, ClientInvite, ClientInviteCollection, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, Collection, CollectionDictionary, CorelogicService, CorelogicSuggestion, Country, 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, DepreciationReceipt, DepreciationReceiptService, DepreciationReportItem, DepreciationReportItemCollection, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Dictionary, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, DocumentService, DocumentTypeEnum, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeInvite, EmployeeInviteService, EmployeeService, Endpoint, EquityPositionChartService, EventDispatcherService, ExportDataTable, ExportFormatEnum, ExportFormatterService, ExportableCollection, FacebookService, FileService, FileValidator, FinancialYear, Firm, FirmService, FirmTypeEnum, FormValidationsEnum, GoogleService, HeaderTitleService, Holding, HoldingSale, HoldingSaleService, HoldingService, HoldingType, HoldingTypeService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, InterceptorsModule, IntercomService, InviteStatusEnum, JsPdf, JwtService, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookBestPeriodService, LogbookPeriod, LoginForm, LossTypeEnum, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, 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, PdfSettings, Phone, PhoneForm, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementCollection, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyEquityChartTypeEnum, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciation, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleCostBase, PropertySaleCostBaseForm, PropertySaleCostSaleForm, PropertySaleExemptionsForm, PropertySaleService, PropertySaleTaxExemptionMetaField, PropertySaleTaxExemptionMetaFieldCollection, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareCollection, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, ReceiptService, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, RestService$1 as RestService, RewardfulService, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentMethod, ServicePaymentMethodService, ServicePaymentService, ServicePaymentStatusEnum, ServicePrice, ServicePriceCollection, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductCollection, ServiceProductIdEnum, ServiceProductService, ServiceProductStatusEnum, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, ShareFilterOptionsEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessLossForm, SoleBusinessLossOffsetRule, SoleBusinessLossOffsetRuleService, SoleBusinessLossReport, SoleBusinessLossService, SoleBusinessLossesCollection, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceCollection, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemCollection, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStatusesEnum, SoleInvoiceTaxTypeEnum, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SoleInvoiceTemplateTaxTypeEnum, SpareDocumentSpareTypeEnum, SseService, StatesEnum, StripePromoCode, SubscriptionItemCollection, SubscriptionService, TAX_RETURN_CATEGORIES, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxExemption, TaxExemptionEnum, TaxExemptionMetaField, TaxExemptionMetaFieldEnum, TaxExemptionService, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReview, TaxReviewCollection, TaxReviewHistoryService, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, Toast, ToastService, ToastTypeEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionBaseForm, TransactionCalculationService, TransactionCategoryEnum, TransactionCollection, TransactionForm, TransactionMetaField, TransactionOperationEnum, TransactionReceipt, TransactionReceiptService, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, TutorialVideoService, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeCollection, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserInviteForm, UserMedicareExemptionEnum, UserRolesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, UsersInviteService, Vehicle, VehicleClaim, VehicleClaimCollection, VehicleClaimDetails, VehicleClaimDetailsForm, VehicleClaimDetailsMethodEnum, VehicleClaimDetailsService, VehicleClaimForm, VehicleClaimService, VehicleExpense, VehicleExpenseCollection, VehicleForm, VehicleLogbook, VehicleLogbookCollection, VehicleLogbookForm, VehicleLogbookPurposeEnum, VehicleLogbookService, VehicleService, WorkExpenseForm, WorkIncomeForm, XlsxService, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, currentFinYearValidator, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, minDateValidator, passwordMatchValidator, passwordValidator, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate, toArray };
20056
+ 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, AppEvent, AppEvent2, AppEventTypeEnum, AppFile, AssetEntityTypeEnum, AssetTypeEnum, AssetsService, AuthService, BANK_ACCOUNT_TYPES, Badge, BadgeColorEnum, Bank, BankAccount, BankAccountAddManualForm, BankAccountAllocationForm, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountImportForm, BankAccountPropertiesForm, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankAccountsImportForm, BankConnection, BankConnectionService, BankConnectionStatusEnum, BankExternalStats, BankLoginData, BankLoginForm, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasReport, BasReportForm, BasReportService, BasiqConfig, BasiqJob, BasiqJobResponse, BasiqJobStep, BasiqService, BasiqToken, BasiqTokenService, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, BusinessTypeEnum, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsKeepSign, ChartAccountsListEnum, ChartAccountsMetaField, ChartAccountsMetaFieldListEnum, ChartAccountsMetaFieldTypeEnum, ChartAccountsSalaryAdjustmentsListEnum, ChartAccountsSalaryIncludedListEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartAccountsValue, ChartData, ChartSerie, Chat, ChatCollection, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientDetails, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientIncomeTypes, ClientIncomeTypesForm, ClientIncomeTypesService, ClientInvite, ClientInviteCollection, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, Collection, CollectionDictionary, CorelogicService, CorelogicSuggestion, Country, 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, DepreciationReceipt, DepreciationReceiptService, DepreciationReportItem, DepreciationReportItemCollection, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Dictionary, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, DocumentService, DocumentTypeEnum, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeInvite, EmployeeInviteService, EmployeeService, Endpoint, EquityPositionChartService, EventDispatcherService, ExportDataTable, ExportFormatEnum, ExportFormatterService, ExportableCollection, FacebookService, FileService, FileValidator, FinancialYear, Firm, FirmService, FirmTypeEnum, FormValidationsEnum, GoogleService, HeaderTitleService, Holding, HoldingCollection, HoldingForm, HoldingSale, HoldingSaleForm, HoldingSaleService, HoldingService, HoldingType, HoldingTypeCategoryEnum, HoldingTypeForm, HoldingTypeService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, InterceptorsModule, IntercomService, InviteStatusEnum, JsPdf, JwtService, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookBestPeriodService, LogbookPeriod, 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, PdfSettings, Phone, PhoneForm, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementCollection, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyEquityChartTypeEnum, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciation, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleCostBase, PropertySaleCostBaseForm, PropertySaleCostSaleForm, PropertySaleExemptionsForm, PropertySaleService, PropertySaleTaxExemptionMetaField, PropertySaleTaxExemptionMetaFieldCollection, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareCollection, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, ReceiptService, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, RestService$1 as RestService, RewardfulService, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentMethod, ServicePaymentMethodService, ServicePaymentService, ServicePaymentStatusEnum, ServicePrice, ServicePriceCollection, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductCollection, ServiceProductIdEnum, ServiceProductService, ServiceProductStatusEnum, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, ShareFilterOptionsEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessLossForm, SoleBusinessLossOffsetRule, SoleBusinessLossOffsetRuleService, SoleBusinessLossReport, SoleBusinessLossService, SoleBusinessLossesCollection, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceCollection, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemCollection, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStatusesEnum, SoleInvoiceTaxTypeEnum, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SoleInvoiceTemplateTaxTypeEnum, SpareDocumentSpareTypeEnum, SseService, StatesEnum, StripePromoCode, SubscriptionItemCollection, SubscriptionService, TAX_RETURN_CATEGORIES, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxExemption, TaxExemptionEnum, TaxExemptionMetaField, TaxExemptionMetaFieldEnum, TaxExemptionService, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReview, TaxReviewCollection, TaxReviewHistoryService, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, Toast, ToastService, ToastTypeEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionBaseForm, TransactionCalculationService, TransactionCategoryEnum, TransactionCollection, TransactionForm, TransactionMetaField, TransactionOperationEnum, TransactionReceipt, TransactionReceiptService, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, TutorialVideoService, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeCollection, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserInviteForm, UserMedicareExemptionEnum, UserRolesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, UsersInviteService, Vehicle, VehicleClaim, VehicleClaimCollection, VehicleClaimDetails, VehicleClaimDetailsForm, VehicleClaimDetailsMethodEnum, VehicleClaimDetailsService, VehicleClaimForm, VehicleClaimService, VehicleExpense, VehicleExpenseCollection, VehicleForm, VehicleLogbook, VehicleLogbookCollection, VehicleLogbookForm, VehicleLogbookPurposeEnum, VehicleLogbookService, VehicleService, WorkExpenseForm, WorkIncomeForm, XlsxService, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, currentFinYearValidator, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, minDateValidator, passwordMatchValidator, passwordValidator, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate, toArray };
19753
20057
  //# sourceMappingURL=taxtank-core.mjs.map