taxtank-core 0.30.16 → 0.30.18

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 (144) hide show
  1. package/esm2020/lib/collections/allocation-rule.collection.mjs +14 -0
  2. package/esm2020/lib/collections/index.mjs +2 -1
  3. package/esm2020/lib/collections/property/property-sale/index.mjs +2 -2
  4. package/esm2020/lib/collections/property/property-sale/property-sale-tax-exemption-meta-field.collection.mjs +17 -0
  5. package/esm2020/lib/collections/transaction/transaction.collection.mjs +6 -6
  6. package/esm2020/lib/db/Enums/allocation-rule-condition-comparison-operator.enum.mjs +9 -0
  7. package/esm2020/lib/db/Enums/allocation-rule-condition-field.enum.mjs +6 -0
  8. package/esm2020/lib/db/Enums/allocation-rule-condition-operator.enum.mjs +6 -0
  9. package/esm2020/lib/db/Enums/allocation-rule-type.enum.mjs +7 -0
  10. package/esm2020/lib/db/Enums/chart-accounts/chart-accounts-meta-field-list.enum.mjs +19 -0
  11. package/esm2020/lib/db/Enums/chart-accounts/chart-accounts-meta-field-type.enum.mjs +6 -0
  12. package/esm2020/lib/db/Enums/chart-accounts/index.mjs +3 -3
  13. package/esm2020/lib/db/Enums/index.mjs +6 -2
  14. package/esm2020/lib/db/Enums/property/property-sale/tax-exemption-meta-field.enum.mjs +9 -0
  15. package/esm2020/lib/db/Models/chart-accounts/chart-accounts-meta-field.mjs +4 -0
  16. package/esm2020/lib/db/Models/chart-accounts/chart-accounts.mjs +1 -1
  17. package/esm2020/lib/db/Models/index.mjs +5 -6
  18. package/esm2020/lib/db/Models/property/property-sale/property-sale-tax-exemption-meta-field.mjs +4 -0
  19. package/esm2020/lib/db/Models/property/property-sale/property-sale.mjs +1 -1
  20. package/esm2020/lib/db/Models/property/property-sale/tax-exemption-meta-field.mjs +4 -0
  21. package/esm2020/lib/db/Models/property/property-sale/tax-exemption.mjs +1 -1
  22. package/esm2020/lib/db/Models/transaction/allocation-rule-condition.mjs +4 -0
  23. package/esm2020/lib/db/Models/transaction/allocation-rule-transaction-meta-field.mjs +4 -0
  24. package/esm2020/lib/db/Models/transaction/allocation-rule-transaction.mjs +4 -0
  25. package/esm2020/lib/db/Models/transaction/allocation-rule.mjs +4 -0
  26. package/esm2020/lib/db/Models/transaction/transaction-meta-field.mjs +4 -0
  27. package/esm2020/lib/db/Models/transaction/transaction.mjs +1 -1
  28. package/esm2020/lib/forms/property/property-sale/property-sale-exemptions.form.mjs +18 -18
  29. package/esm2020/lib/forms/transaction/allocation-rule-condition.form.mjs +14 -0
  30. package/esm2020/lib/forms/transaction/allocation-rule-transaction-meta-field.form.mjs +12 -0
  31. package/esm2020/lib/forms/transaction/allocation-rule-transaction.form.mjs +125 -0
  32. package/esm2020/lib/forms/transaction/allocation-rule.form.mjs +135 -0
  33. package/esm2020/lib/forms/transaction/index.mjs +2 -1
  34. package/esm2020/lib/forms/transaction/work/work-expense.form.mjs +10 -10
  35. package/esm2020/lib/forms/transaction/work/work-transaction.form.mjs +12 -12
  36. package/esm2020/lib/models/chart-accounts/chart-accounts-meta-field.mjs +14 -0
  37. package/esm2020/lib/models/chart-accounts/chart-accounts.mjs +7 -4
  38. package/esm2020/lib/models/chart-accounts/index.mjs +2 -2
  39. package/esm2020/lib/models/endpoint/endpoints.const.mjs +5 -1
  40. package/esm2020/lib/models/property/property-sale/index.mjs +3 -3
  41. package/esm2020/lib/models/property/property-sale/property-sale-tax-exemption-meta-field.mjs +4 -0
  42. package/esm2020/lib/models/property/property-sale/property-sale.mjs +4 -4
  43. package/esm2020/lib/models/property/property-sale/tax-exemption-meta-field.mjs +4 -0
  44. package/esm2020/lib/models/property/property.mjs +6 -6
  45. package/esm2020/lib/models/report/my-tax/my-tax-dividends/my-tax-dividends.mjs +8 -8
  46. package/esm2020/lib/models/report/my-tax/my-tax-other-income/my-tax-other-income.mjs +12 -12
  47. package/esm2020/lib/models/report/my-tax/my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts.mjs +6 -6
  48. package/esm2020/lib/models/transaction/allocation-rule-condition.mjs +4 -0
  49. package/esm2020/lib/models/transaction/allocation-rule-transaction-meta-field.mjs +4 -0
  50. package/esm2020/lib/models/transaction/allocation-rule-transaction.mjs +56 -0
  51. package/esm2020/lib/models/transaction/allocation-rule.mjs +78 -0
  52. package/esm2020/lib/models/transaction/index.mjs +5 -2
  53. package/esm2020/lib/models/transaction/transaction-meta-field.mjs +10 -0
  54. package/esm2020/lib/models/transaction/transaction.mjs +15 -15
  55. package/esm2020/lib/services/http/google/google.service.mjs +77 -0
  56. package/esm2020/lib/services/http/google/index.mjs +2 -0
  57. package/esm2020/lib/services/http/index.mjs +2 -1
  58. package/esm2020/lib/services/http/transaction/index.mjs +2 -1
  59. package/esm2020/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.mjs +23 -0
  60. package/esm2020/lib/services/http/tutorial-video/video-source.interface.mjs +1 -1
  61. package/esm2020/public-api.mjs +5 -5
  62. package/fesm2015/taxtank-core.mjs +908 -375
  63. package/fesm2015/taxtank-core.mjs.map +1 -1
  64. package/fesm2020/taxtank-core.mjs +903 -374
  65. package/fesm2020/taxtank-core.mjs.map +1 -1
  66. package/lib/collections/allocation-rule.collection.d.ts +7 -0
  67. package/lib/collections/index.d.ts +1 -0
  68. package/lib/collections/property/property-sale/index.d.ts +1 -1
  69. package/lib/collections/property/property-sale/property-sale-tax-exemption-meta-field.collection.d.ts +8 -0
  70. package/lib/collections/transaction/transaction.collection.d.ts +3 -3
  71. package/lib/db/Enums/allocation-rule-condition-comparison-operator.enum.d.ts +7 -0
  72. package/lib/db/Enums/allocation-rule-condition-field.enum.d.ts +4 -0
  73. package/lib/db/Enums/allocation-rule-condition-operator.enum.d.ts +4 -0
  74. package/lib/db/Enums/allocation-rule-type.enum.d.ts +5 -0
  75. package/lib/db/Enums/chart-accounts/{chart-accounts-metadata-list.enum.d.ts → chart-accounts-meta-field-list.enum.d.ts} +1 -1
  76. package/lib/db/Enums/chart-accounts/chart-accounts-meta-field-type.enum.d.ts +4 -0
  77. package/lib/db/Enums/chart-accounts/index.d.ts +2 -2
  78. package/lib/db/Enums/index.d.ts +5 -1
  79. package/lib/db/Enums/property/property-sale/{tax-exemption-metadata.enum.d.ts → tax-exemption-meta-field.enum.d.ts} +1 -1
  80. package/lib/db/Models/chart-accounts/chart-accounts-meta-field.d.ts +11 -0
  81. package/lib/db/Models/chart-accounts/chart-accounts.d.ts +2 -2
  82. package/lib/db/Models/index.d.ts +4 -5
  83. package/lib/db/Models/property/property-sale/property-sale-tax-exemption-meta-field.d.ts +9 -0
  84. package/lib/db/Models/property/property-sale/property-sale.d.ts +2 -2
  85. package/lib/db/Models/property/property-sale/{tax-exemption-metadata.d.ts → tax-exemption-meta-field.d.ts} +1 -1
  86. package/lib/db/Models/property/property-sale/tax-exemption.d.ts +2 -2
  87. package/lib/db/Models/transaction/allocation-rule-condition.d.ts +10 -0
  88. package/lib/db/Models/transaction/allocation-rule-transaction-meta-field.d.ts +9 -0
  89. package/lib/db/Models/transaction/allocation-rule-transaction.d.ts +25 -0
  90. package/lib/db/Models/transaction/allocation-rule.d.ts +22 -0
  91. package/lib/db/Models/transaction/{transaction-metadata.d.ts → transaction-meta-field.d.ts} +3 -3
  92. package/lib/db/Models/transaction/transaction.d.ts +2 -2
  93. package/lib/forms/property/property-sale/property-sale-exemptions.form.d.ts +2 -2
  94. package/lib/forms/transaction/allocation-rule-condition.form.d.ts +5 -0
  95. package/lib/forms/transaction/allocation-rule-transaction-meta-field.form.d.ts +5 -0
  96. package/lib/forms/transaction/allocation-rule-transaction.form.d.ts +33 -0
  97. package/lib/forms/transaction/allocation-rule.form.d.ts +31 -0
  98. package/lib/forms/transaction/index.d.ts +1 -0
  99. package/lib/forms/transaction/work/work-expense.form.d.ts +1 -1
  100. package/lib/forms/transaction/work/work-transaction.form.d.ts +1 -1
  101. package/lib/models/chart-accounts/chart-accounts-meta-field.d.ts +8 -0
  102. package/lib/models/chart-accounts/chart-accounts.d.ts +3 -2
  103. package/lib/models/chart-accounts/index.d.ts +1 -1
  104. package/lib/models/property/property-sale/index.d.ts +2 -2
  105. package/lib/models/property/property-sale/property-sale-tax-exemption-meta-field.d.ts +3 -0
  106. package/lib/models/property/property-sale/property-sale.d.ts +2 -2
  107. package/lib/models/property/property-sale/tax-exemption-meta-field.d.ts +3 -0
  108. package/lib/models/transaction/allocation-rule-condition.d.ts +3 -0
  109. package/lib/models/transaction/allocation-rule-transaction-meta-field.d.ts +3 -0
  110. package/lib/models/transaction/allocation-rule-transaction.d.ts +17 -0
  111. package/lib/models/transaction/allocation-rule.d.ts +24 -0
  112. package/lib/models/transaction/index.d.ts +4 -1
  113. package/lib/models/transaction/transaction-meta-field.d.ts +5 -0
  114. package/lib/models/transaction/transaction.d.ts +6 -6
  115. package/lib/services/http/google/google.service.d.ts +43 -0
  116. package/lib/services/http/google/index.d.ts +1 -0
  117. package/lib/services/http/index.d.ts +1 -0
  118. package/lib/services/http/transaction/index.d.ts +1 -0
  119. package/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.d.ts +13 -0
  120. package/lib/services/http/tutorial-video/video-source.interface.d.ts +1 -1
  121. package/package.json +4 -1
  122. package/public-api.d.ts +4 -4
  123. package/esm2020/lib/collections/property/property-sale/property-sale-tax-exemption-metadata.collection.mjs +0 -17
  124. package/esm2020/lib/db/Enums/chart-accounts/chart-accounts-metadata-list.enum.mjs +0 -19
  125. package/esm2020/lib/db/Enums/chart-accounts/chart-accounts-metadata-type.enum.mjs +0 -6
  126. package/esm2020/lib/db/Enums/property/property-sale/tax-exemption-metadata.enum.mjs +0 -9
  127. package/esm2020/lib/db/Models/bank/bank-transaction-rule.mjs +0 -4
  128. package/esm2020/lib/db/Models/chart-accounts/chart-accounts-metadata.mjs +0 -4
  129. package/esm2020/lib/db/Models/property/property-sale/property-sale-tax-exemption-metadata.mjs +0 -4
  130. package/esm2020/lib/db/Models/property/property-sale/tax-exemption-metadata.mjs +0 -4
  131. package/esm2020/lib/db/Models/transaction/transaction-metadata.mjs +0 -4
  132. package/esm2020/lib/models/chart-accounts/chart-accounts-metadata.mjs +0 -14
  133. package/esm2020/lib/models/property/property-sale/property-sale-tax-exemption-metadata.mjs +0 -4
  134. package/esm2020/lib/models/property/property-sale/tax-exemption-metadata.mjs +0 -4
  135. package/esm2020/lib/models/transaction/transaction-metadata.mjs +0 -10
  136. package/lib/collections/property/property-sale/property-sale-tax-exemption-metadata.collection.d.ts +0 -8
  137. package/lib/db/Enums/chart-accounts/chart-accounts-metadata-type.enum.d.ts +0 -4
  138. package/lib/db/Models/bank/bank-transaction-rule.d.ts +0 -26
  139. package/lib/db/Models/chart-accounts/chart-accounts-metadata.d.ts +0 -11
  140. package/lib/db/Models/property/property-sale/property-sale-tax-exemption-metadata.d.ts +0 -9
  141. package/lib/models/chart-accounts/chart-accounts-metadata.d.ts +0 -8
  142. package/lib/models/property/property-sale/property-sale-tax-exemption-metadata.d.ts +0 -3
  143. package/lib/models/property/property-sale/tax-exemption-metadata.d.ts +0 -3
  144. package/lib/models/transaction/transaction-metadata.d.ts +0 -5
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Inject, NgModule, EventEmitter } from '@angular/core';
3
- import * as i1$2 from '@angular/common';
3
+ import * as i1$1 from '@angular/common';
4
4
  import { CommonModule, DatePipe } from '@angular/common';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
@@ -18,15 +18,15 @@ import uniqBy from 'lodash/uniqBy';
18
18
  import differenceBy from 'lodash/differenceBy';
19
19
  import moment from 'moment';
20
20
  import { DateRange } from 'moment-range';
21
- import intersection from 'lodash/intersection';
22
21
  import { Validators, UntypedFormGroup, UntypedFormControl, UntypedFormArray, FormArray, FormGroup, FormControl } from '@angular/forms';
22
+ import intersection from 'lodash/intersection';
23
23
  import compact from 'lodash/compact';
24
24
  import concat from 'lodash/concat';
25
25
  import cloneDeep$1 from 'lodash/cloneDeep';
26
26
  import clone from 'lodash/clone';
27
27
  import { EventSourcePolyfill } from 'event-source-polyfill/src/eventsource.min.js';
28
28
  import { throwError as throwError$1 } from 'rxjs/internal/observable/throwError';
29
- import * as i1$1 from '@angular/router';
29
+ import * as i4 from '@angular/router';
30
30
  import { NavigationEnd } from '@angular/router';
31
31
  import _ from 'lodash';
32
32
  import merge from 'lodash/merge';
@@ -327,9 +327,6 @@ let BankConnection$1 = class BankConnection extends ObservableModel {
327
327
  class BankTransactionImport extends AbstractModel {
328
328
  }
329
329
 
330
- class BankTransactionRule extends AbstractModel {
331
- }
332
-
333
330
  let BankTransaction$1 = class BankTransaction extends ObservableModel {
334
331
  };
335
332
 
@@ -345,7 +342,7 @@ let ChartAccountsDepreciation$1 = class ChartAccountsDepreciation extends Abstra
345
342
  let ChartAccountsHeading$1 = class ChartAccountsHeading extends AbstractModel {
346
343
  };
347
344
 
348
- let ChartAccountsMetadata$1 = class ChartAccountsMetadata extends AbstractModel {
345
+ let ChartAccountsMetaField$1 = class ChartAccountsMetaField extends AbstractModel {
349
346
  };
350
347
 
351
348
  let ChartAccountsValue$1 = class ChartAccountsValue extends AbstractModel {
@@ -534,13 +531,13 @@ let LoanPayout$1 = class LoanPayout extends ObservableModel {
534
531
  let Loan$1 = class Loan extends ObservableModel {
535
532
  };
536
533
 
537
- let PropertySaleTaxExemptionMetadata$1 = class PropertySaleTaxExemptionMetadata extends AbstractModel {
534
+ let PropertySaleTaxExemptionMetaField$1 = class PropertySaleTaxExemptionMetaField extends AbstractModel {
538
535
  };
539
536
 
540
537
  let PropertySale$1 = class PropertySale extends ObservableModel {
541
538
  };
542
539
 
543
- let TaxExemptionMetadata$1 = class TaxExemptionMetadata extends AbstractModel {
540
+ let TaxExemptionMetaField$1 = class TaxExemptionMetaField extends AbstractModel {
544
541
  };
545
542
 
546
543
  let TaxExemption$1 = class TaxExemption extends AbstractModel {
@@ -636,7 +633,7 @@ class TaxReturn extends AbstractModel {
636
633
  let TransactionAllocation$1 = class TransactionAllocation extends AbstractModel {
637
634
  };
638
635
 
639
- let TransactionMetadata$1 = class TransactionMetadata extends AbstractModel {
636
+ let TransactionMetaField$1 = class TransactionMetaField extends AbstractModel {
640
637
  };
641
638
 
642
639
  let TransactionReceipt$1 = class TransactionReceipt extends AbstractModel {
@@ -1615,30 +1612,30 @@ class PropertySaleCollection extends Collection {
1615
1612
  }
1616
1613
  }
1617
1614
 
1618
- var TaxExemptionMetadataEnum;
1619
- (function (TaxExemptionMetadataEnum) {
1615
+ var TaxExemptionMetaFieldEnum;
1616
+ (function (TaxExemptionMetaFieldEnum) {
1620
1617
  // principle place of residence
1621
- TaxExemptionMetadataEnum[TaxExemptionMetadataEnum["PPR_DAYS"] = 1] = "PPR_DAYS";
1618
+ TaxExemptionMetaFieldEnum[TaxExemptionMetaFieldEnum["PPR_DAYS"] = 1] = "PPR_DAYS";
1622
1619
  // market value once it was moved, decimal
1623
- TaxExemptionMetadataEnum[TaxExemptionMetadataEnum["MARKET_VALUE"] = 2] = "MARKET_VALUE";
1624
- TaxExemptionMetadataEnum[TaxExemptionMetadataEnum["CLAIM_PERCENT"] = 3] = "CLAIM_PERCENT";
1625
- })(TaxExemptionMetadataEnum || (TaxExemptionMetadataEnum = {}));
1620
+ TaxExemptionMetaFieldEnum[TaxExemptionMetaFieldEnum["MARKET_VALUE"] = 2] = "MARKET_VALUE";
1621
+ TaxExemptionMetaFieldEnum[TaxExemptionMetaFieldEnum["CLAIM_PERCENT"] = 3] = "CLAIM_PERCENT";
1622
+ })(TaxExemptionMetaFieldEnum || (TaxExemptionMetaFieldEnum = {}));
1626
1623
 
1627
- class PropertySaleTaxExemptionMetadataCollection extends Collection {
1624
+ class PropertySaleTaxExemptionMetaFieldCollection extends Collection {
1628
1625
  getPPRDays() {
1629
1626
  var _a, _b;
1630
- return (_b = (_a = this.getByMetadataId(TaxExemptionMetadataEnum.PPR_DAYS)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
1627
+ return (_b = (_a = this.getByMetaFieldId(TaxExemptionMetaFieldEnum.PPR_DAYS)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
1631
1628
  }
1632
1629
  getMarketValue() {
1633
1630
  var _a, _b;
1634
- return (_b = (_a = this.getByMetadataId(TaxExemptionMetadataEnum.MARKET_VALUE)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
1631
+ return (_b = (_a = this.getByMetaFieldId(TaxExemptionMetaFieldEnum.MARKET_VALUE)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
1635
1632
  }
1636
1633
  getClaimPercent() {
1637
1634
  var _a, _b;
1638
- return (_b = (_a = this.getByMetadataId(TaxExemptionMetadataEnum.CLAIM_PERCENT)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 100;
1635
+ return (_b = (_a = this.getByMetaFieldId(TaxExemptionMetaFieldEnum.CLAIM_PERCENT)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 100;
1639
1636
  }
1640
- getByMetadataId(id) {
1641
- return this.items.find((metadata) => metadata.metadata.id === id);
1637
+ getByMetaFieldId(id) {
1638
+ return this.items.find((metaField) => metaField.metaField.id === id);
1642
1639
  }
1643
1640
  }
1644
1641
 
@@ -1820,10 +1817,33 @@ var DepreciationCalculationEnum;
1820
1817
  DepreciationCalculationEnum[DepreciationCalculationEnum["SBP"] = 6] = "SBP";
1821
1818
  })(DepreciationCalculationEnum || (DepreciationCalculationEnum = {}));
1822
1819
 
1823
- var DocumentTypeEnum;
1824
- (function (DocumentTypeEnum) {
1825
- DocumentTypeEnum[DocumentTypeEnum["INVOICE"] = 1] = "INVOICE";
1826
- })(DocumentTypeEnum || (DocumentTypeEnum = {}));
1820
+ var AllocationRuleConditionComparisonOperatorEnum;
1821
+ (function (AllocationRuleConditionComparisonOperatorEnum) {
1822
+ AllocationRuleConditionComparisonOperatorEnum[AllocationRuleConditionComparisonOperatorEnum["EQUALS"] = 1] = "EQUALS";
1823
+ AllocationRuleConditionComparisonOperatorEnum[AllocationRuleConditionComparisonOperatorEnum["CONTAINS"] = 2] = "CONTAINS";
1824
+ AllocationRuleConditionComparisonOperatorEnum[AllocationRuleConditionComparisonOperatorEnum["STARTS"] = 3] = "STARTS";
1825
+ AllocationRuleConditionComparisonOperatorEnum[AllocationRuleConditionComparisonOperatorEnum["EQUALS_OR_GREATER"] = 4] = "EQUALS_OR_GREATER";
1826
+ AllocationRuleConditionComparisonOperatorEnum[AllocationRuleConditionComparisonOperatorEnum["EQUALS_OR_LESS"] = 5] = "EQUALS_OR_LESS";
1827
+ })(AllocationRuleConditionComparisonOperatorEnum || (AllocationRuleConditionComparisonOperatorEnum = {}));
1828
+
1829
+ var AllocationRuleConditionFieldEnum;
1830
+ (function (AllocationRuleConditionFieldEnum) {
1831
+ AllocationRuleConditionFieldEnum[AllocationRuleConditionFieldEnum["AMOUNT"] = 1] = "AMOUNT";
1832
+ AllocationRuleConditionFieldEnum[AllocationRuleConditionFieldEnum["DESCRIPTION"] = 2] = "DESCRIPTION";
1833
+ })(AllocationRuleConditionFieldEnum || (AllocationRuleConditionFieldEnum = {}));
1834
+
1835
+ var AllocationRuleConditionOperatorEnum;
1836
+ (function (AllocationRuleConditionOperatorEnum) {
1837
+ AllocationRuleConditionOperatorEnum[AllocationRuleConditionOperatorEnum["AND"] = 1] = "AND";
1838
+ AllocationRuleConditionOperatorEnum[AllocationRuleConditionOperatorEnum["OR"] = 2] = "OR";
1839
+ })(AllocationRuleConditionOperatorEnum || (AllocationRuleConditionOperatorEnum = {}));
1840
+
1841
+ var AllocationRuleTypeEnum;
1842
+ (function (AllocationRuleTypeEnum) {
1843
+ AllocationRuleTypeEnum[AllocationRuleTypeEnum["EXPENSE"] = 1] = "EXPENSE";
1844
+ AllocationRuleTypeEnum[AllocationRuleTypeEnum["INCOME"] = 2] = "INCOME";
1845
+ AllocationRuleTypeEnum[AllocationRuleTypeEnum["TRANSFER"] = 3] = "TRANSFER";
1846
+ })(AllocationRuleTypeEnum || (AllocationRuleTypeEnum = {}));
1827
1847
 
1828
1848
  var AnnualFrequencyEnum;
1829
1849
  (function (AnnualFrequencyEnum) {
@@ -2029,30 +2049,30 @@ var ChartAccountsListEnum;
2029
2049
  ChartAccountsListEnum[ChartAccountsListEnum["PSI_DEDUCTION_OTHER"] = 860] = "PSI_DEDUCTION_OTHER";
2030
2050
  })(ChartAccountsListEnum || (ChartAccountsListEnum = {}));
2031
2051
 
2032
- var ChartAccountsMetadataListEnum;
2033
- (function (ChartAccountsMetadataListEnum) {
2034
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_INSTALMENTS"] = 4] = "TAX_INSTALMENTS";
2035
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["FRANKING_CREDIT"] = 5] = "FRANKING_CREDIT";
2036
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["ELIGIBLE_FOR_REDUCTION"] = 6] = "ELIGIBLE_FOR_REDUCTION";
2037
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["SHARE_PERCENTAGE"] = 7] = "SHARE_PERCENTAGE";
2038
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_OFFSETS"] = 8] = "TAX_OFFSETS";
2039
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["HOURS"] = 11] = "HOURS";
2040
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_PAID"] = 13] = "TAX_PAID";
2041
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_FREE_COMPONENT"] = 18] = "TAX_FREE_COMPONENT";
2042
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["YEARS_OF_SERVICE"] = 19] = "YEARS_OF_SERVICE";
2043
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["UNTAXED_ELEMENT"] = 24] = "UNTAXED_ELEMENT";
2044
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["NOT_ELIGIBLE_FOR_DEDUCTION"] = 25] = "NOT_ELIGIBLE_FOR_DEDUCTION";
2045
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["FRANKED"] = 26] = "FRANKED";
2046
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["UNFRANKED"] = 27] = "UNFRANKED";
2047
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_OFFSETS_N_R_A_S"] = 29] = "TAX_OFFSETS_N_R_A_S";
2048
- ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["DISCOUNT_FROM_DEFERRED_SCHEMES"] = 32] = "DISCOUNT_FROM_DEFERRED_SCHEMES";
2049
- })(ChartAccountsMetadataListEnum || (ChartAccountsMetadataListEnum = {}));
2050
-
2051
- var ChartAccountsMetadataTypeEnum;
2052
- (function (ChartAccountsMetadataTypeEnum) {
2053
- ChartAccountsMetadataTypeEnum[ChartAccountsMetadataTypeEnum["NUMBER"] = 3] = "NUMBER";
2054
- ChartAccountsMetadataTypeEnum[ChartAccountsMetadataTypeEnum["BOOLEAN"] = 4] = "BOOLEAN";
2055
- })(ChartAccountsMetadataTypeEnum || (ChartAccountsMetadataTypeEnum = {}));
2052
+ var ChartAccountsMetaFieldListEnum;
2053
+ (function (ChartAccountsMetaFieldListEnum) {
2054
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["TAX_INSTALMENTS"] = 4] = "TAX_INSTALMENTS";
2055
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["FRANKING_CREDIT"] = 5] = "FRANKING_CREDIT";
2056
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["ELIGIBLE_FOR_REDUCTION"] = 6] = "ELIGIBLE_FOR_REDUCTION";
2057
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["SHARE_PERCENTAGE"] = 7] = "SHARE_PERCENTAGE";
2058
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["TAX_OFFSETS"] = 8] = "TAX_OFFSETS";
2059
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["HOURS"] = 11] = "HOURS";
2060
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["TAX_PAID"] = 13] = "TAX_PAID";
2061
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["TAX_FREE_COMPONENT"] = 18] = "TAX_FREE_COMPONENT";
2062
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["YEARS_OF_SERVICE"] = 19] = "YEARS_OF_SERVICE";
2063
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["UNTAXED_ELEMENT"] = 24] = "UNTAXED_ELEMENT";
2064
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["NOT_ELIGIBLE_FOR_DEDUCTION"] = 25] = "NOT_ELIGIBLE_FOR_DEDUCTION";
2065
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["FRANKED"] = 26] = "FRANKED";
2066
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["UNFRANKED"] = 27] = "UNFRANKED";
2067
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["TAX_OFFSETS_N_R_A_S"] = 29] = "TAX_OFFSETS_N_R_A_S";
2068
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["DISCOUNT_FROM_DEFERRED_SCHEMES"] = 32] = "DISCOUNT_FROM_DEFERRED_SCHEMES";
2069
+ })(ChartAccountsMetaFieldListEnum || (ChartAccountsMetaFieldListEnum = {}));
2070
+
2071
+ var ChartAccountsMetaFieldTypeEnum;
2072
+ (function (ChartAccountsMetaFieldTypeEnum) {
2073
+ ChartAccountsMetaFieldTypeEnum[ChartAccountsMetaFieldTypeEnum["NUMBER"] = 3] = "NUMBER";
2074
+ ChartAccountsMetaFieldTypeEnum[ChartAccountsMetaFieldTypeEnum["BOOLEAN"] = 4] = "BOOLEAN";
2075
+ })(ChartAccountsMetaFieldTypeEnum || (ChartAccountsMetaFieldTypeEnum = {}));
2056
2076
 
2057
2077
  var ChartAccountsSalaryAdjustmentsListEnum;
2058
2078
  (function (ChartAccountsSalaryAdjustmentsListEnum) {
@@ -2101,6 +2121,11 @@ var ChartAccountsKeepSign;
2101
2121
  ChartAccountsKeepSign[ChartAccountsKeepSign["ADVANCE"] = 556] = "ADVANCE";
2102
2122
  })(ChartAccountsKeepSign || (ChartAccountsKeepSign = {}));
2103
2123
 
2124
+ var DocumentTypeEnum;
2125
+ (function (DocumentTypeEnum) {
2126
+ DocumentTypeEnum[DocumentTypeEnum["INVOICE"] = 1] = "INVOICE";
2127
+ })(DocumentTypeEnum || (DocumentTypeEnum = {}));
2128
+
2104
2129
  // @TODO Artem TT-2308 move everything
2105
2130
 
2106
2131
  class DepreciationCapitalProject extends DepreciationCapitalProject$1 {
@@ -2292,15 +2317,15 @@ class ChartAccountsCategoryECollection {
2292
2317
  class ChartAccountsHeading extends ChartAccountsHeading$1 {
2293
2318
  }
2294
2319
 
2295
- class ChartAccountsMetadata extends ChartAccountsMetadata$1 {
2320
+ class ChartAccountsMetaField extends ChartAccountsMetaField$1 {
2296
2321
  /**
2297
- * Check if metadata id is related to SHARE_PERCENTAGE value
2322
+ * Check if meta field id is related to SHARE_PERCENTAGE value
2298
2323
  */
2299
2324
  isSharePercentage() {
2300
- return this.id === ChartAccountsMetadataListEnum.SHARE_PERCENTAGE;
2325
+ return this.id === ChartAccountsMetaFieldListEnum.SHARE_PERCENTAGE;
2301
2326
  }
2302
2327
  isHours() {
2303
- return this.id === ChartAccountsMetadataListEnum.HOURS;
2328
+ return this.id === ChartAccountsMetaFieldListEnum.HOURS;
2304
2329
  }
2305
2330
  }
2306
2331
 
@@ -3011,6 +3036,9 @@ class ChartAccounts extends ChartAccounts$1 {
3011
3036
  isPropertyCapitalWorks() {
3012
3037
  return this.category === ChartAccountsCategoryEnum.PROPERTY_CAPITAL_WORKS;
3013
3038
  }
3039
+ isTaxable() {
3040
+ return !this.isNRAS() && this.isWorkIncome();
3041
+ }
3014
3042
  }
3015
3043
  /**
3016
3044
  * Australian GST percent value (VAT)
@@ -3022,8 +3050,8 @@ __decorate([
3022
3050
  Type(() => ChartAccountsHeading)
3023
3051
  ], ChartAccounts.prototype, "heading", void 0);
3024
3052
  __decorate([
3025
- Type(() => ChartAccountsMetadata)
3026
- ], ChartAccounts.prototype, "metadata", void 0);
3053
+ Type(() => ChartAccountsMetaField)
3054
+ ], ChartAccounts.prototype, "metaFields", void 0);
3027
3055
  __decorate([
3028
3056
  Type(() => ChartAccountsValue),
3029
3057
  Transform(({ obj }) => CHART_ACCOUNTS_VALUES.get(obj.id).toArray(), { toClassOnly: true }),
@@ -3043,6 +3071,308 @@ __decorate([
3043
3071
  Transform(({ value }) => +value)
3044
3072
  ], ChartAccountsDepreciation.prototype, "effectiveLife", void 0);
3045
3073
 
3074
+ let AllocationRule$1 = class AllocationRule extends AbstractModel {
3075
+ };
3076
+
3077
+ let AllocationRuleCondition$1 = class AllocationRuleCondition extends AbstractModel {
3078
+ };
3079
+
3080
+ class AllocationRuleCondition extends AllocationRuleCondition$1 {
3081
+ }
3082
+
3083
+ let AllocationRuleTransaction$1 = class AllocationRuleTransaction extends TransactionBase {
3084
+ };
3085
+
3086
+ let AllocationRuleTransactionMetaField$1 = class AllocationRuleTransactionMetaField extends AbstractModel {
3087
+ };
3088
+
3089
+ class AllocationRuleTransactionMetaField extends AllocationRuleTransactionMetaField$1 {
3090
+ }
3091
+
3092
+ var IncomeSourceTypeEnum;
3093
+ (function (IncomeSourceTypeEnum) {
3094
+ IncomeSourceTypeEnum[IncomeSourceTypeEnum["WORK"] = 1] = "WORK";
3095
+ IncomeSourceTypeEnum[IncomeSourceTypeEnum["SOLE"] = 2] = "SOLE";
3096
+ IncomeSourceTypeEnum[IncomeSourceTypeEnum["OTHER"] = 3] = "OTHER";
3097
+ })(IncomeSourceTypeEnum || (IncomeSourceTypeEnum = {}));
3098
+
3099
+ class SalaryForecast extends SalaryForecast$1 {
3100
+ get taxWithheld() {
3101
+ return this.grossAmount - this.netPay;
3102
+ }
3103
+ }
3104
+ __decorate([
3105
+ Transform(({ obj }) => obj.netPay + obj.tax),
3106
+ Expose()
3107
+ ], SalaryForecast.prototype, "grossAmount", void 0);
3108
+ __decorate([
3109
+ Type(() => IncomeSource)
3110
+ ], SalaryForecast.prototype, "incomeSource", void 0);
3111
+
3112
+ class SoleForecast extends SoleForecast$1 {
3113
+ get netPay() {
3114
+ return this.amount;
3115
+ }
3116
+ ;
3117
+ }
3118
+ __decorate([
3119
+ Type(() => IncomeSource)
3120
+ ], SoleForecast.prototype, "incomeSource", void 0);
3121
+
3122
+ var SalaryForecastFrequencyEnum;
3123
+ (function (SalaryForecastFrequencyEnum) {
3124
+ SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["ANNUAL"] = 1] = "ANNUAL";
3125
+ SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["MONTHLY"] = 12] = "MONTHLY";
3126
+ SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["FORTNIGHTLY"] = 26] = "FORTNIGHTLY";
3127
+ SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["WEEKLY"] = 52] = "WEEKLY";
3128
+ })(SalaryForecastFrequencyEnum || (SalaryForecastFrequencyEnum = {}));
3129
+
3130
+ var IncomeSourceTypeListWorkEnum;
3131
+ (function (IncomeSourceTypeListWorkEnum) {
3132
+ IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["BONUSES"] = 1] = "BONUSES";
3133
+ IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["DIRECTOR_FEES"] = 2] = "DIRECTOR_FEES";
3134
+ IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["DIVIDENDS"] = 3] = "DIVIDENDS";
3135
+ IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["INTEREST"] = 4] = "INTEREST";
3136
+ IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["PENSIONS_AND_ALLOWANCES"] = 5] = "PENSIONS_AND_ALLOWANCES";
3137
+ IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["SUPERANNUATION"] = 8] = "SUPERANNUATION";
3138
+ IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["ATTRIBUTED_P_S_I"] = 11] = "ATTRIBUTED_P_S_I";
3139
+ })(IncomeSourceTypeListWorkEnum || (IncomeSourceTypeListWorkEnum = {}));
3140
+
3141
+ var IncomeSourceTypeListOtherEnum;
3142
+ (function (IncomeSourceTypeListOtherEnum) {
3143
+ IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["PSI"] = 6] = "PSI";
3144
+ IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["SOLE_TRADER"] = 7] = "SOLE_TRADER";
3145
+ IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["TRUSTS"] = 9] = "TRUSTS";
3146
+ IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["OTHER_INCOME"] = 10] = "OTHER_INCOME";
3147
+ IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["PARTNERSHIPS"] = 12] = "PARTNERSHIPS";
3148
+ })(IncomeSourceTypeListOtherEnum || (IncomeSourceTypeListOtherEnum = {}));
3149
+
3150
+ var IncomeSourceTypeListSoleEnum;
3151
+ (function (IncomeSourceTypeListSoleEnum) {
3152
+ IncomeSourceTypeListSoleEnum[IncomeSourceTypeListSoleEnum["SOLE_TRADER"] = 7] = "SOLE_TRADER";
3153
+ })(IncomeSourceTypeListSoleEnum || (IncomeSourceTypeListSoleEnum = {}));
3154
+
3155
+ class IncomeSourceType extends IncomeSourceType$1 {
3156
+ isBonuses() {
3157
+ return this.id === IncomeSourceTypeListWorkEnum.BONUSES;
3158
+ }
3159
+ isWork() {
3160
+ return !!IncomeSourceTypeListWorkEnum[this.id];
3161
+ }
3162
+ isOther() {
3163
+ return !!IncomeSourceTypeListOtherEnum[this.id];
3164
+ }
3165
+ isSole() {
3166
+ return !!IncomeSourceTypeListSoleEnum[this.id];
3167
+ }
3168
+ get type() {
3169
+ switch (true) {
3170
+ case this.isWork():
3171
+ return IncomeSourceTypeEnum.WORK;
3172
+ case this.isSole():
3173
+ return IncomeSourceTypeEnum.SOLE;
3174
+ default:
3175
+ return IncomeSourceTypeEnum.OTHER;
3176
+ }
3177
+ }
3178
+ }
3179
+
3180
+ class IncomeSourceForecast extends IncomeSourceForecast$1 {
3181
+ constructor() {
3182
+ super(...arguments);
3183
+ this.paygIncome = 0;
3184
+ this.frequency = SalaryForecastFrequencyEnum.ANNUAL;
3185
+ this.isTaxFree = false;
3186
+ }
3187
+ /**
3188
+ * Sometimes Income source has Salary & Income source forecasts,
3189
+ * and we need these fields to work with Income source forecasts like with Salary Forecasts
3190
+ */
3191
+ get netPay() {
3192
+ return this.amount;
3193
+ }
3194
+ get grossAmount() {
3195
+ return this.amount + this.tax + this.taxInstalments + this.frankingCredits;
3196
+ }
3197
+ }
3198
+ __decorate([
3199
+ Type(() => IncomeSourceType)
3200
+ ], IncomeSourceForecast.prototype, "incomeSourceType", void 0);
3201
+ __decorate([
3202
+ Type(() => IncomeSource)
3203
+ ], IncomeSourceForecast.prototype, "incomeSource", void 0);
3204
+
3205
+ class IncomeSource extends IncomeSource$1 {
3206
+ isSalaryIncome() {
3207
+ return !!this.salaryForecasts.length;
3208
+ // @TODO Vik: old code
3209
+ // return this.type === IncomeSourceTypeEnum.SALARY;
3210
+ }
3211
+ isSoleIncome() {
3212
+ return !!this.soleForecasts.length;
3213
+ }
3214
+ isWorkIncome() {
3215
+ return this.type === IncomeSourceTypeEnum.WORK;
3216
+ }
3217
+ isOtherIncome() {
3218
+ return this.type === IncomeSourceTypeEnum.OTHER || (!this.isSoleIncome() && !this.isSalaryIncome());
3219
+ }
3220
+ /**
3221
+ * Get salary and other income forecasts
3222
+ */
3223
+ get forecasts() {
3224
+ return [...this.salaryForecasts, ...this.incomeSourceForecasts, ...this.soleForecasts];
3225
+ }
3226
+ /**
3227
+ * Get actual (1st from the list) forecast
3228
+ */
3229
+ get actualForecast() {
3230
+ return this.forecasts[0];
3231
+ }
3232
+ /**
3233
+ * Check if user was working in month taken by the index
3234
+ * @param monthIndex by which month should be taken
3235
+ */
3236
+ isWorkedInMonth(monthIndex) {
3237
+ const monthDate = new FinancialYear().getMonthDate(monthIndex);
3238
+ return (!this.dateFrom || monthDate >= this.dateFrom) && (!this.dateTo || monthDate < this.dateTo);
3239
+ }
3240
+ }
3241
+ __decorate([
3242
+ Type(() => SalaryForecast)
3243
+ ], IncomeSource.prototype, "salaryForecasts", void 0);
3244
+ __decorate([
3245
+ Type(() => SoleForecast)
3246
+ ], IncomeSource.prototype, "soleForecasts", void 0);
3247
+ __decorate([
3248
+ Type(() => IncomeSourceForecast)
3249
+ ], IncomeSource.prototype, "incomeSourceForecasts", void 0);
3250
+ __decorate([
3251
+ Type(() => Date)
3252
+ ], IncomeSource.prototype, "dateFrom", void 0);
3253
+ __decorate([
3254
+ Type(() => Date)
3255
+ ], IncomeSource.prototype, "dateTo", void 0);
3256
+
3257
+ class AllocationRuleTransaction extends AllocationRuleTransaction$1 {
3258
+ calculateClaimPercent() {
3259
+ var _a, _b;
3260
+ if (!this.chartAccounts) {
3261
+ return null;
3262
+ }
3263
+ let claimPercent = this.chartAccounts.taxablePercent;
3264
+ // Property claim (ownership% x shared%) for property expenses, taxable percent for others
3265
+ if (((_a = this.chartAccounts) === null || _a === void 0 ? void 0 : _a.isProperty()) && this.property) {
3266
+ if (this.chartAccounts.isPropertyExpense() && this.chartAccounts.id !== ChartAccountsListEnum.PLATFORM_FEES) {
3267
+ claimPercent *= (_b = this.property) === null || _b === void 0 ? void 0 : _b.claimCoefficient;
3268
+ }
3269
+ }
3270
+ return claimPercent;
3271
+ }
3272
+ }
3273
+ __decorate([
3274
+ Type(() => ChartAccounts),
3275
+ Transform(({ value }) => { return { id: value.id }; }, { toPlainOnly: true })
3276
+ ], AllocationRuleTransaction.prototype, "chartAccounts", void 0);
3277
+ __decorate([
3278
+ Type(() => Property),
3279
+ Transform(({ value }) => { return value ? { id: value.id } : null; }, { toPlainOnly: true })
3280
+ ], AllocationRuleTransaction.prototype, "property", void 0);
3281
+ __decorate([
3282
+ Type(() => Loan),
3283
+ Transform(({ value }) => { return value ? { id: value.id } : null; }, { toPlainOnly: true })
3284
+ ], AllocationRuleTransaction.prototype, "loan", void 0);
3285
+ __decorate([
3286
+ Type(() => IncomeSource),
3287
+ Transform(({ value }) => { return value ? { id: value.id } : null; }, { toPlainOnly: true })
3288
+ ], AllocationRuleTransaction.prototype, "incomeSource", void 0);
3289
+ __decorate([
3290
+ Type(() => SoleBusiness),
3291
+ Transform(({ value }) => { return value ? { id: value.id } : null; }, { toPlainOnly: true })
3292
+ ], AllocationRuleTransaction.prototype, "business", void 0);
3293
+ __decorate([
3294
+ Type(() => AllocationRuleTransactionMetaField)
3295
+ ], AllocationRuleTransaction.prototype, "metaFields", void 0);
3296
+ __decorate([
3297
+ Type(() => AllocationRuleTransaction)
3298
+ ], AllocationRuleTransaction.prototype, "parentTransaction", void 0);
3299
+ __decorate([
3300
+ Type(() => AllocationRuleTransaction)
3301
+ ], AllocationRuleTransaction.prototype, "childTransactions", void 0);
3302
+ __decorate([
3303
+ Type(() => Number)
3304
+ ], AllocationRuleTransaction.prototype, "claimPercent", void 0);
3305
+
3306
+ class AllocationRule extends AllocationRule$1 {
3307
+ constructor() {
3308
+ super(...arguments);
3309
+ this.type = AllocationRuleTypeEnum.EXPENSE;
3310
+ this.conditionOperator = AllocationRuleConditionOperatorEnum.OR;
3311
+ }
3312
+ get typeLabel() {
3313
+ switch (this.type) {
3314
+ case AllocationRuleTypeEnum.EXPENSE:
3315
+ return 'expense';
3316
+ case AllocationRuleTypeEnum.INCOME:
3317
+ return 'income';
3318
+ default:
3319
+ return 'transfer';
3320
+ }
3321
+ }
3322
+ get tankTypeLabel() {
3323
+ switch (this.transaction.tankType) {
3324
+ case TankTypeEnum.WORK:
3325
+ return 'work';
3326
+ case TankTypeEnum.PROPERTY:
3327
+ return 'property';
3328
+ case TankTypeEnum.SOLE:
3329
+ return 'sole';
3330
+ default:
3331
+ return 'personal';
3332
+ }
3333
+ }
3334
+ isIncome() {
3335
+ return this.type === AllocationRuleTypeEnum.INCOME;
3336
+ }
3337
+ isExpense() {
3338
+ return this.type === AllocationRuleTypeEnum.EXPENSE;
3339
+ }
3340
+ isTransfer() {
3341
+ return this.type === AllocationRuleTypeEnum.TRANSFER;
3342
+ }
3343
+ isPropertyTank() {
3344
+ return this.transaction.tankType === TankTypeEnum.PROPERTY;
3345
+ }
3346
+ isWorkTank() {
3347
+ return this.transaction.tankType === TankTypeEnum.WORK;
3348
+ }
3349
+ isSoleTank() {
3350
+ return this.transaction.tankType === TankTypeEnum.SOLE;
3351
+ }
3352
+ isPropertyIncome() {
3353
+ return this.isIncome() && this.isPropertyTank();
3354
+ }
3355
+ isWorkIncome() {
3356
+ return this.isIncome() && this.isWorkTank();
3357
+ }
3358
+ isSoleIncome() {
3359
+ return this.isIncome() && this.isSoleTank();
3360
+ }
3361
+ }
3362
+ __decorate([
3363
+ Type(() => BankAccount),
3364
+ Transform(({ value }) => { return { id: value.id }; }, { toPlainOnly: true })
3365
+ ], AllocationRule.prototype, "bankAccount", void 0);
3366
+ __decorate([
3367
+ Type(() => AllocationRuleCondition)
3368
+ ], AllocationRule.prototype, "conditions", void 0);
3369
+ __decorate([
3370
+ Type(() => AllocationRuleTransaction)
3371
+ ], AllocationRule.prototype, "transaction", void 0);
3372
+ __decorate([
3373
+ Type(() => BankAccount)
3374
+ ], AllocationRule.prototype, "transferBankAccount", void 0);
3375
+
3046
3376
  /**
3047
3377
  * Enum with income amount types (Net or Gross)
3048
3378
  */
@@ -3111,8 +3441,8 @@ __decorate([
3111
3441
  Type(() => Date)
3112
3442
  ], PropertySale.prototype, "contractDate", void 0);
3113
3443
  __decorate([
3114
- Type(() => PropertySaleTaxExemptionMetadata$1)
3115
- ], PropertySale.prototype, "taxExemptionMetadata", void 0);
3444
+ Type(() => PropertySaleTaxExemptionMetaField$1)
3445
+ ], PropertySale.prototype, "taxExemptionMetaFields", void 0);
3116
3446
 
3117
3447
  /**
3118
3448
  * @Todo TT-2143 should be removed when PropertySaleCostBaseForm refactored (cut property to separated form)
@@ -3131,13 +3461,13 @@ class PropertySaleCostBase {
3131
3461
  }
3132
3462
  }
3133
3463
 
3134
- class PropertySaleTaxExemptionMetadata extends PropertySaleTaxExemptionMetadata$1 {
3464
+ class PropertySaleTaxExemptionMetaField extends PropertySaleTaxExemptionMetaField$1 {
3135
3465
  }
3136
3466
 
3137
3467
  class TaxExemption extends TaxExemption$1 {
3138
3468
  }
3139
3469
 
3140
- class TaxExemptionMetadata extends TaxExemptionMetadata$1 {
3470
+ class TaxExemptionMetaField extends TaxExemptionMetaField$1 {
3141
3471
  }
3142
3472
 
3143
3473
  /**
@@ -3548,258 +3878,93 @@ __decorate([
3548
3878
  Transform(({ value }) => -Math.abs(+value))
3549
3879
  ], PropertyForecast.prototype, "depreciation", void 0);
3550
3880
  __decorate([
3551
- Transform(({ value }) => +value)
3552
- ], PropertyForecast.prototype, "loanBalance", void 0);
3553
- __decorate([
3554
- Transform(({ value }) => +value)
3555
- ], PropertyForecast.prototype, "marketValue", void 0);
3556
-
3557
- var PropertyShareStatusEnum;
3558
- (function (PropertyShareStatusEnum) {
3559
- PropertyShareStatusEnum[PropertyShareStatusEnum["PENDING"] = 1] = "PENDING";
3560
- PropertyShareStatusEnum[PropertyShareStatusEnum["APPROVED"] = 2] = "APPROVED";
3561
- PropertyShareStatusEnum[PropertyShareStatusEnum["REJECTED"] = 3] = "REJECTED";
3562
- })(PropertyShareStatusEnum || (PropertyShareStatusEnum = {}));
3563
-
3564
- class RegistrationInvite extends RegistrationInvite$1 {
3565
- getPhotoPlaceholder() {
3566
- return `${this.firstName[0].toUpperCase()}${this.firstName[1]}`;
3567
- }
3568
- getPhoto() {
3569
- return null;
3570
- }
3571
- }
3572
-
3573
- class PropertyShare extends PropertyShare$1 {
3574
- isAccepted() {
3575
- return this.status === PropertyShareStatusEnum.APPROVED;
3576
- }
3577
- isPending() {
3578
- return this.status === PropertyShareStatusEnum.PENDING;
3579
- }
3580
- isRejected() {
3581
- return this.status === PropertyShareStatusEnum.REJECTED;
3582
- }
3583
- get statusName() {
3584
- var _a;
3585
- return (_a = PropertyShareStatusEnum[this.status]) === null || _a === void 0 ? void 0 : _a.toLowerCase();
3586
- }
3587
- /**
3588
- * Return full user name if user is already registered.
3589
- * Otherwise - return first name from invitation
3590
- */
3591
- get userName() {
3592
- return this.user ? this.user.fullName : `${this.invite.firstName}`;
3593
- }
3594
- }
3595
- __decorate([
3596
- Type(() => Date)
3597
- ], PropertyShare.prototype, "fromDate", void 0);
3598
- __decorate([
3599
- Type(() => Date)
3600
- ], PropertyShare.prototype, "toDate", void 0);
3601
- __decorate([
3602
- Type(() => User)
3603
- ], PropertyShare.prototype, "user", void 0);
3604
- __decorate([
3605
- Type(() => RegistrationInvite)
3606
- ], PropertyShare.prototype, "invite", void 0);
3607
- __decorate([
3608
- Type(() => Property)
3609
- ], PropertyShare.prototype, "property", void 0);
3610
- __decorate([
3611
- Transform(({ obj }) => obj.user ? obj.user.email : obj.invite.email)
3612
- ], PropertyShare.prototype, "email", void 0);
3613
-
3614
- /**
3615
- * @TODO used only on dashboard, move from tt-core
3616
- * Enum with properties ownership filter options
3617
- */
3618
- var ShareFilterOptionsEnum;
3619
- (function (ShareFilterOptionsEnum) {
3620
- ShareFilterOptionsEnum[ShareFilterOptionsEnum["ALL"] = 1] = "ALL";
3621
- ShareFilterOptionsEnum[ShareFilterOptionsEnum["CREATED"] = 2] = "CREATED";
3622
- ShareFilterOptionsEnum[ShareFilterOptionsEnum["SHARED"] = 3] = "SHARED";
3623
- })(ShareFilterOptionsEnum || (ShareFilterOptionsEnum = {}));
3624
-
3625
- class TransactionReceipt extends TransactionReceipt$1 {
3626
- constructor() {
3627
- super(...arguments);
3628
- this.type = AssetTypeEnum.TRANSACTION_RECEIPT;
3629
- this.entityType = AssetEntityTypeEnum.TRANSACTIONS;
3630
- }
3631
- }
3632
-
3633
- var IncomeSourceTypeEnum;
3634
- (function (IncomeSourceTypeEnum) {
3635
- IncomeSourceTypeEnum[IncomeSourceTypeEnum["WORK"] = 1] = "WORK";
3636
- IncomeSourceTypeEnum[IncomeSourceTypeEnum["SOLE"] = 2] = "SOLE";
3637
- IncomeSourceTypeEnum[IncomeSourceTypeEnum["OTHER"] = 3] = "OTHER";
3638
- })(IncomeSourceTypeEnum || (IncomeSourceTypeEnum = {}));
3639
-
3640
- class SalaryForecast extends SalaryForecast$1 {
3641
- get taxWithheld() {
3642
- return this.grossAmount - this.netPay;
3643
- }
3644
- }
3645
- __decorate([
3646
- Transform(({ obj }) => obj.netPay + obj.tax),
3647
- Expose()
3648
- ], SalaryForecast.prototype, "grossAmount", void 0);
3649
- __decorate([
3650
- Type(() => IncomeSource)
3651
- ], SalaryForecast.prototype, "incomeSource", void 0);
3652
-
3653
- class SoleForecast extends SoleForecast$1 {
3654
- get netPay() {
3655
- return this.amount;
3656
- }
3657
- ;
3658
- }
3659
- __decorate([
3660
- Type(() => IncomeSource)
3661
- ], SoleForecast.prototype, "incomeSource", void 0);
3662
-
3663
- var SalaryForecastFrequencyEnum;
3664
- (function (SalaryForecastFrequencyEnum) {
3665
- SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["ANNUAL"] = 1] = "ANNUAL";
3666
- SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["MONTHLY"] = 12] = "MONTHLY";
3667
- SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["FORTNIGHTLY"] = 26] = "FORTNIGHTLY";
3668
- SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["WEEKLY"] = 52] = "WEEKLY";
3669
- })(SalaryForecastFrequencyEnum || (SalaryForecastFrequencyEnum = {}));
3670
-
3671
- var IncomeSourceTypeListWorkEnum;
3672
- (function (IncomeSourceTypeListWorkEnum) {
3673
- IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["BONUSES"] = 1] = "BONUSES";
3674
- IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["DIRECTOR_FEES"] = 2] = "DIRECTOR_FEES";
3675
- IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["DIVIDENDS"] = 3] = "DIVIDENDS";
3676
- IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["INTEREST"] = 4] = "INTEREST";
3677
- IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["PENSIONS_AND_ALLOWANCES"] = 5] = "PENSIONS_AND_ALLOWANCES";
3678
- IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["SUPERANNUATION"] = 8] = "SUPERANNUATION";
3679
- IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["ATTRIBUTED_P_S_I"] = 11] = "ATTRIBUTED_P_S_I";
3680
- })(IncomeSourceTypeListWorkEnum || (IncomeSourceTypeListWorkEnum = {}));
3681
-
3682
- var IncomeSourceTypeListOtherEnum;
3683
- (function (IncomeSourceTypeListOtherEnum) {
3684
- IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["PSI"] = 6] = "PSI";
3685
- IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["SOLE_TRADER"] = 7] = "SOLE_TRADER";
3686
- IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["TRUSTS"] = 9] = "TRUSTS";
3687
- IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["OTHER_INCOME"] = 10] = "OTHER_INCOME";
3688
- IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["PARTNERSHIPS"] = 12] = "PARTNERSHIPS";
3689
- })(IncomeSourceTypeListOtherEnum || (IncomeSourceTypeListOtherEnum = {}));
3690
-
3691
- var IncomeSourceTypeListSoleEnum;
3692
- (function (IncomeSourceTypeListSoleEnum) {
3693
- IncomeSourceTypeListSoleEnum[IncomeSourceTypeListSoleEnum["SOLE_TRADER"] = 7] = "SOLE_TRADER";
3694
- })(IncomeSourceTypeListSoleEnum || (IncomeSourceTypeListSoleEnum = {}));
3695
-
3696
- class IncomeSourceType extends IncomeSourceType$1 {
3697
- isBonuses() {
3698
- return this.id === IncomeSourceTypeListWorkEnum.BONUSES;
3699
- }
3700
- isWork() {
3701
- return !!IncomeSourceTypeListWorkEnum[this.id];
3702
- }
3703
- isOther() {
3704
- return !!IncomeSourceTypeListOtherEnum[this.id];
3705
- }
3706
- isSole() {
3707
- return !!IncomeSourceTypeListSoleEnum[this.id];
3708
- }
3709
- get type() {
3710
- switch (true) {
3711
- case this.isWork():
3712
- return IncomeSourceTypeEnum.WORK;
3713
- case this.isSole():
3714
- return IncomeSourceTypeEnum.SOLE;
3715
- default:
3716
- return IncomeSourceTypeEnum.OTHER;
3717
- }
3718
- }
3719
- }
3720
-
3721
- class IncomeSourceForecast extends IncomeSourceForecast$1 {
3722
- constructor() {
3723
- super(...arguments);
3724
- this.paygIncome = 0;
3725
- this.frequency = SalaryForecastFrequencyEnum.ANNUAL;
3726
- this.isTaxFree = false;
3727
- }
3728
- /**
3729
- * Sometimes Income source has Salary & Income source forecasts,
3730
- * and we need these fields to work with Income source forecasts like with Salary Forecasts
3731
- */
3732
- get netPay() {
3733
- return this.amount;
3734
- }
3735
- get grossAmount() {
3736
- return this.amount + this.tax + this.taxInstalments + this.frankingCredits;
3737
- }
3738
- }
3739
- __decorate([
3740
- Type(() => IncomeSourceType)
3741
- ], IncomeSourceForecast.prototype, "incomeSourceType", void 0);
3881
+ Transform(({ value }) => +value)
3882
+ ], PropertyForecast.prototype, "loanBalance", void 0);
3742
3883
  __decorate([
3743
- Type(() => IncomeSource)
3744
- ], IncomeSourceForecast.prototype, "incomeSource", void 0);
3884
+ Transform(({ value }) => +value)
3885
+ ], PropertyForecast.prototype, "marketValue", void 0);
3745
3886
 
3746
- class IncomeSource extends IncomeSource$1 {
3747
- isSalaryIncome() {
3748
- return !!this.salaryForecasts.length;
3749
- // @TODO Vik: old code
3750
- // return this.type === IncomeSourceTypeEnum.SALARY;
3887
+ var PropertyShareStatusEnum;
3888
+ (function (PropertyShareStatusEnum) {
3889
+ PropertyShareStatusEnum[PropertyShareStatusEnum["PENDING"] = 1] = "PENDING";
3890
+ PropertyShareStatusEnum[PropertyShareStatusEnum["APPROVED"] = 2] = "APPROVED";
3891
+ PropertyShareStatusEnum[PropertyShareStatusEnum["REJECTED"] = 3] = "REJECTED";
3892
+ })(PropertyShareStatusEnum || (PropertyShareStatusEnum = {}));
3893
+
3894
+ class RegistrationInvite extends RegistrationInvite$1 {
3895
+ getPhotoPlaceholder() {
3896
+ return `${this.firstName[0].toUpperCase()}${this.firstName[1]}`;
3751
3897
  }
3752
- isSoleIncome() {
3753
- return !!this.soleForecasts.length;
3898
+ getPhoto() {
3899
+ return null;
3754
3900
  }
3755
- isWorkIncome() {
3756
- return this.type === IncomeSourceTypeEnum.WORK;
3901
+ }
3902
+
3903
+ class PropertyShare extends PropertyShare$1 {
3904
+ isAccepted() {
3905
+ return this.status === PropertyShareStatusEnum.APPROVED;
3757
3906
  }
3758
- isOtherIncome() {
3759
- return this.type === IncomeSourceTypeEnum.OTHER || (!this.isSoleIncome() && !this.isSalaryIncome());
3907
+ isPending() {
3908
+ return this.status === PropertyShareStatusEnum.PENDING;
3760
3909
  }
3761
- /**
3762
- * Get salary and other income forecasts
3763
- */
3764
- get forecasts() {
3765
- return [...this.salaryForecasts, ...this.incomeSourceForecasts, ...this.soleForecasts];
3910
+ isRejected() {
3911
+ return this.status === PropertyShareStatusEnum.REJECTED;
3766
3912
  }
3767
- /**
3768
- * Get actual (1st from the list) forecast
3769
- */
3770
- get actualForecast() {
3771
- return this.forecasts[0];
3913
+ get statusName() {
3914
+ var _a;
3915
+ return (_a = PropertyShareStatusEnum[this.status]) === null || _a === void 0 ? void 0 : _a.toLowerCase();
3772
3916
  }
3773
3917
  /**
3774
- * Check if user was working in month taken by the index
3775
- * @param monthIndex by which month should be taken
3918
+ * Return full user name if user is already registered.
3919
+ * Otherwise - return first name from invitation
3776
3920
  */
3777
- isWorkedInMonth(monthIndex) {
3778
- const monthDate = new FinancialYear().getMonthDate(monthIndex);
3779
- return (!this.dateFrom || monthDate >= this.dateFrom) && (!this.dateTo || monthDate < this.dateTo);
3921
+ get userName() {
3922
+ return this.user ? this.user.fullName : `${this.invite.firstName}`;
3780
3923
  }
3781
3924
  }
3782
3925
  __decorate([
3783
- Type(() => SalaryForecast)
3784
- ], IncomeSource.prototype, "salaryForecasts", void 0);
3926
+ Type(() => Date)
3927
+ ], PropertyShare.prototype, "fromDate", void 0);
3785
3928
  __decorate([
3786
- Type(() => SoleForecast)
3787
- ], IncomeSource.prototype, "soleForecasts", void 0);
3929
+ Type(() => Date)
3930
+ ], PropertyShare.prototype, "toDate", void 0);
3788
3931
  __decorate([
3789
- Type(() => IncomeSourceForecast)
3790
- ], IncomeSource.prototype, "incomeSourceForecasts", void 0);
3932
+ Type(() => User)
3933
+ ], PropertyShare.prototype, "user", void 0);
3791
3934
  __decorate([
3792
- Type(() => Date)
3793
- ], IncomeSource.prototype, "dateFrom", void 0);
3935
+ Type(() => RegistrationInvite)
3936
+ ], PropertyShare.prototype, "invite", void 0);
3794
3937
  __decorate([
3795
- Type(() => Date)
3796
- ], IncomeSource.prototype, "dateTo", void 0);
3938
+ Type(() => Property)
3939
+ ], PropertyShare.prototype, "property", void 0);
3940
+ __decorate([
3941
+ Transform(({ obj }) => obj.user ? obj.user.email : obj.invite.email)
3942
+ ], PropertyShare.prototype, "email", void 0);
3943
+
3944
+ /**
3945
+ * @TODO used only on dashboard, move from tt-core
3946
+ * Enum with properties ownership filter options
3947
+ */
3948
+ var ShareFilterOptionsEnum;
3949
+ (function (ShareFilterOptionsEnum) {
3950
+ ShareFilterOptionsEnum[ShareFilterOptionsEnum["ALL"] = 1] = "ALL";
3951
+ ShareFilterOptionsEnum[ShareFilterOptionsEnum["CREATED"] = 2] = "CREATED";
3952
+ ShareFilterOptionsEnum[ShareFilterOptionsEnum["SHARED"] = 3] = "SHARED";
3953
+ })(ShareFilterOptionsEnum || (ShareFilterOptionsEnum = {}));
3954
+
3955
+ class TransactionReceipt extends TransactionReceipt$1 {
3956
+ constructor() {
3957
+ super(...arguments);
3958
+ this.type = AssetTypeEnum.TRANSACTION_RECEIPT;
3959
+ this.entityType = AssetEntityTypeEnum.TRANSACTIONS;
3960
+ }
3961
+ }
3797
3962
 
3798
- class TransactionMetadata extends TransactionMetadata$1 {
3963
+ class TransactionMetaField extends TransactionMetaField$1 {
3799
3964
  }
3800
3965
  __decorate([
3801
- Type(() => ChartAccountsMetadata)
3802
- ], TransactionMetadata.prototype, "metadata", void 0);
3966
+ Type(() => ChartAccountsMetaField)
3967
+ ], TransactionMetaField.prototype, "metaField", void 0);
3803
3968
 
3804
3969
  /**
3805
3970
  * Enum with maximum number of payments, depending on the frequency.
@@ -4558,7 +4723,7 @@ class Transaction extends Transaction$1 {
4558
4723
  super(...arguments);
4559
4724
  // list of child transactions (fees)
4560
4725
  this.transactions = [];
4561
- this.metadata = [];
4726
+ this.metaFields = [];
4562
4727
  this.allocations = [];
4563
4728
  this.tax = 0;
4564
4729
  this.operation = TransactionOperationEnum.FIND_AND_MATCH;
@@ -4626,16 +4791,16 @@ class Transaction extends Transaction$1 {
4626
4791
  return this.chartAccounts.isVehicleExpense();
4627
4792
  }
4628
4793
  get taxFreeComponent() {
4629
- return this.getMetadataFieldValue(ChartAccountsMetadataListEnum.TAX_FREE_COMPONENT);
4794
+ return this.getMetaFieldValue(ChartAccountsMetaFieldListEnum.TAX_FREE_COMPONENT);
4630
4795
  }
4631
4796
  get frankingCredit() {
4632
- return this.getMetadataFieldValue(ChartAccountsMetadataListEnum.FRANKING_CREDIT);
4797
+ return this.getMetaFieldValue(ChartAccountsMetaFieldListEnum.FRANKING_CREDIT);
4633
4798
  }
4634
4799
  get eligibleForReduction() {
4635
- return this.getMetadataFieldValue(ChartAccountsMetadataListEnum.ELIGIBLE_FOR_REDUCTION);
4800
+ return this.getMetaFieldValue(ChartAccountsMetaFieldListEnum.ELIGIBLE_FOR_REDUCTION);
4636
4801
  }
4637
4802
  get untaxedElement() {
4638
- return this.getMetadataFieldValue(ChartAccountsMetadataListEnum.UNTAXED_ELEMENT);
4803
+ return this.getMetaFieldValue(ChartAccountsMetaFieldListEnum.UNTAXED_ELEMENT);
4639
4804
  }
4640
4805
  /**
4641
4806
  * Check if transaction reconcile operation if TRANSFER
@@ -4657,14 +4822,14 @@ class Transaction extends Transaction$1 {
4657
4822
  return this.isCredit() ? Math.abs(this.grossAmount) : 0;
4658
4823
  }
4659
4824
  /**
4660
- * Get value of transaction metadata field
4825
+ * Get value of transaction meta field
4661
4826
  * @param field for which value should be returned
4662
- * @Todo modify 'metadata' property from array to Collection
4827
+ * @Todo modify 'metaFields' property from array to Collection
4663
4828
  */
4664
- getMetadataFieldValue(field) {
4829
+ getMetaFieldValue(field) {
4665
4830
  var _a;
4666
- return +((_a = this.metadata.find((transactionMetadata) => {
4667
- return transactionMetadata.chartAccountsMetadata.id === field;
4831
+ return +((_a = this.metaFields.find((transactionMetaField) => {
4832
+ return transactionMetaField.chartAccountsMetaField.id === field;
4668
4833
  })) === null || _a === void 0 ? void 0 : _a.value) || 0;
4669
4834
  }
4670
4835
  isCash() {
@@ -4756,8 +4921,8 @@ __decorate([
4756
4921
  Type(() => IncomeSource)
4757
4922
  ], Transaction.prototype, "incomeSource", void 0);
4758
4923
  __decorate([
4759
- Type(() => TransactionMetadata)
4760
- ], Transaction.prototype, "metadata", void 0);
4924
+ Type(() => TransactionMetaField)
4925
+ ], Transaction.prototype, "metaFields", void 0);
4761
4926
  __decorate([
4762
4927
  Type(() => Transaction)
4763
4928
  ], Transaction.prototype, "transfer", void 0);
@@ -5054,14 +5219,14 @@ class TransactionCollection extends ExportableCollection {
5054
5219
  return new TransactionCollection(this.items.filter((transaction) => transaction.date.getMonth() === monthIndex));
5055
5220
  }
5056
5221
  /**
5057
- * Get collection of transactions metadata
5222
+ * Get collection of transactions meta fields
5058
5223
  */
5059
- getTransactionsMetadata() {
5060
- const metadataArray = [];
5224
+ getTransactionsMetaFields() {
5225
+ const metaFieldsArray = [];
5061
5226
  this.items.forEach((transaction) => {
5062
- metadataArray.push(...transaction.metadata);
5227
+ metaFieldsArray.push(...transaction.metaFields);
5063
5228
  });
5064
- return new Collection(metadataArray);
5229
+ return new Collection(metaFieldsArray);
5065
5230
  }
5066
5231
  getIncomeTransactions() {
5067
5232
  return new TransactionCollection(this.items.filter((transaction) => transaction.isIncome()));
@@ -6179,6 +6344,18 @@ class AllocationGroupCollection extends Collection {
6179
6344
  }
6180
6345
  }
6181
6346
 
6347
+ class AllocationRuleCollection extends Collection {
6348
+ getExpense() {
6349
+ return this.filterBy('type', AllocationRuleTypeEnum.EXPENSE);
6350
+ }
6351
+ getIncome() {
6352
+ return this.filterBy('type', AllocationRuleTypeEnum.INCOME);
6353
+ }
6354
+ getTransfer() {
6355
+ return this.filterBy('type', AllocationRuleTypeEnum.TRANSFER);
6356
+ }
6357
+ }
6358
+
6182
6359
  class AccountSetupItemCollection extends Collection {
6183
6360
  constructor(items) {
6184
6361
  super(compact(items));
@@ -7056,7 +7233,7 @@ class Property extends Property$1 {
7056
7233
  * in that case it's equal to market value, when property became an investment property
7057
7234
  */
7058
7235
  calculateCostBase(sale) {
7059
- const marketValue = new PropertySaleTaxExemptionMetadataCollection(sale.taxExemptionMetadata).getMarketValue();
7236
+ const marketValue = new PropertySaleTaxExemptionMetaFieldCollection(sale.taxExemptionMetaFields).getMarketValue();
7060
7237
  if (marketValue) {
7061
7238
  return marketValue;
7062
7239
  }
@@ -7097,7 +7274,7 @@ class Property extends Property$1 {
7097
7274
  */
7098
7275
  getCGTExemptionRatio(sale) {
7099
7276
  var _a;
7100
- const metadata = new PropertySaleTaxExemptionMetadataCollection(sale.taxExemptionMetadata);
7277
+ const metaFields = new PropertySaleTaxExemptionMetaFieldCollection(sale.taxExemptionMetaFields);
7101
7278
  switch ((_a = sale.taxExemption) === null || _a === void 0 ? void 0 : _a.id) {
7102
7279
  // 50% exemption for investments owned for at least one year
7103
7280
  case TaxExemptionEnum.ONE_YEAR_RULE:
@@ -7105,12 +7282,12 @@ class Property extends Property$1 {
7105
7282
  // investment property become main residence (exemption for main residence ownership duration)
7106
7283
  case TaxExemptionEnum.INVESTMENT_TO_PPR:
7107
7284
  const ownershipDays = this.getOwnershipDuration(sale);
7108
- return (ownershipDays - metadata.getPPRDays()) / ownershipDays;
7285
+ return (ownershipDays - metaFields.getPPRDays()) / ownershipDays;
7109
7286
  // main residence become investment (exemption for home office percent usage)
7110
7287
  case TaxExemptionEnum.PPR_TO_INVESTMENT:
7111
7288
  // 1 year CGT discount can still apply (on the income producing % if used for 12 months or more)
7112
7289
  const ratio = this.isOneYearExemptionApplicable(sale) ? 0.5 : 1;
7113
- return metadata.getClaimPercent() / 100 * ratio;
7290
+ return metaFields.getClaimPercent() / 100 * ratio;
7114
7291
  // full exemption
7115
7292
  case TaxExemptionEnum.PPR:
7116
7293
  case TaxExemptionEnum.SIX_YEARS_RULE:
@@ -8303,6 +8480,10 @@ class Endpoint {
8303
8480
  */
8304
8481
  const ENDPOINTS = {
8305
8482
  ASSETS_GET: new Endpoint('GET', '\\/assets\\/\.\*\\/\\d+'),
8483
+ ALLOCATION_RULES_GET: new Endpoint('GET', '\\/allocation-rules'),
8484
+ ALLOCATION_RULES_POST: new Endpoint('POST', '\\/allocation-rules'),
8485
+ ALLOCATION_RULES_PUT: new Endpoint('PUT', '\\/allocation-rules\\/\\d+'),
8486
+ ALLOCATION_RULES_DELETE: new Endpoint('DELETE', '\\/allocation-rules\\/\\d+'),
8306
8487
  BANKS_GET: new Endpoint('GET', '\\/banks'),
8307
8488
  BANK_ACCOUNTS_GET: new Endpoint('GET', '\\/bank-accounts'),
8308
8489
  BANK_ACCOUNTS_POST: new Endpoint('POST', '\\/bank-accounts'),
@@ -10665,14 +10846,14 @@ MyTaxDeductions.selfEducationNotDeductibleAmount = -250;
10665
10846
  class MyTaxDividends {
10666
10847
  constructor(transactions) {
10667
10848
  this.transactions = transactions.filterBy('chartAccounts.id', ChartAccountsListEnum.DIVIDENDS);
10668
- this.dividendsUnfrankedAmount = this.transactions.getTransactionsMetadata()
10669
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.UNFRANKED)
10849
+ this.dividendsUnfrankedAmount = this.transactions.getTransactionsMetaFields()
10850
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.UNFRANKED)
10670
10851
  .sumBy('value');
10671
- this.dividendsFrankedAmount = this.transactions.getTransactionsMetadata()
10672
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.FRANKED)
10852
+ this.dividendsFrankedAmount = this.transactions.getTransactionsMetaFields()
10853
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.FRANKED)
10673
10854
  .sumBy('value');
10674
- this.dividendsFrankingCreditsAmount = this.transactions.getTransactionsMetadata()
10675
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.FRANKING_CREDIT)
10855
+ this.dividendsFrankingCreditsAmount = this.transactions.getTransactionsMetaFields()
10856
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.FRANKING_CREDIT)
10676
10857
  .sumBy('value');
10677
10858
  this.dividendsTotalTax = this.transactions.sumBy('tax');
10678
10859
  }
@@ -10827,20 +11008,20 @@ class MyTaxOtherIncome {
10827
11008
  this.employeeShareSchemesTransactions = transactions
10828
11009
  .filterBy('chartAccounts.id', ChartAccountsListEnum.EMPLOYEE_SHARE_SCHEME_INCOME);
10829
11010
  // Employee Share Schemes data
10830
- this.eligibleForReductionAmount = this.employeeShareSchemesTransactions.getTransactionsMetadata()
10831
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.ELIGIBLE_FOR_REDUCTION)
11011
+ this.eligibleForReductionAmount = this.employeeShareSchemesTransactions.getTransactionsMetaFields()
11012
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.ELIGIBLE_FOR_REDUCTION)
10832
11013
  .sumBy('value');
10833
- this.notEligibleForReductionAmount = this.employeeShareSchemesTransactions.getTransactionsMetadata()
10834
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.NOT_ELIGIBLE_FOR_DEDUCTION)
11014
+ this.notEligibleForReductionAmount = this.employeeShareSchemesTransactions.getTransactionsMetaFields()
11015
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.NOT_ELIGIBLE_FOR_DEDUCTION)
10835
11016
  .sumBy('value');
10836
- this.discountFromDeferredSchemeAmount = this.employeeShareSchemesTransactions.getTransactionsMetadata()
10837
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.DISCOUNT_FROM_DEFERRED_SCHEMES)
11017
+ this.discountFromDeferredSchemeAmount = this.employeeShareSchemesTransactions.getTransactionsMetaFields()
11018
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.DISCOUNT_FROM_DEFERRED_SCHEMES)
10838
11019
  .sumBy('value');
10839
- this.totalAssessableDiscountAmount = this.employeeShareSchemesTransactions.getTransactionsMetadata()
10840
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.NOT_ELIGIBLE_FOR_DEDUCTION)
11020
+ this.totalAssessableDiscountAmount = this.employeeShareSchemesTransactions.getTransactionsMetaFields()
11021
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.NOT_ELIGIBLE_FOR_DEDUCTION)
10841
11022
  .sumBy('value') +
10842
- this.employeeShareSchemesTransactions.getTransactionsMetadata()
10843
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.DISCOUNT_FROM_DEFERRED_SCHEMES)
11023
+ this.employeeShareSchemesTransactions.getTransactionsMetaFields()
11024
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.DISCOUNT_FROM_DEFERRED_SCHEMES)
10844
11025
  .sumBy('value');
10845
11026
  this.shareSchemesTotalTax = this.employeeShareSchemesTransactions.sumBy('tax');
10846
11027
  // Other income data
@@ -10883,14 +11064,14 @@ class MyTaxPartnershipsAndTrusts {
10883
11064
  this.trustsNetNonPrimaryProductionAmount = this.trustsIncomeTotalAmount - this.trustsExpenseTotalAmount;
10884
11065
  this.frankingCreditsTotal = this.transactions
10885
11066
  .filterBy('chartAccounts.heading.id', ChartAccountsHeadingTaxableEnum.PARTNERSHIPS_AND_TRUSTS_INCOME)
10886
- .getTransactionsMetadata()
10887
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.FRANKING_CREDIT)
11067
+ .getTransactionsMetaFields()
11068
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.FRANKING_CREDIT)
10888
11069
  .sumBy('value');
10889
11070
  this.trustsIncomeTotalTax = this.trustsIncomes.sumBy('tax');
10890
11071
  this.frankingCreditsTotal = this.transactions
10891
11072
  .filterBy('chartAccounts.heading.id', ChartAccountsHeadingTaxableEnum.PARTNERSHIPS_AND_TRUSTS_INCOME)
10892
- .getTransactionsMetadata()
10893
- .filterBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.FRANKING_CREDIT)
11073
+ .getTransactionsMetaFields()
11074
+ .filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.FRANKING_CREDIT)
10894
11075
  .sumBy('value');
10895
11076
  this.taxOffsetNRASTotalAmount = this.transactions.filterBy('chartAccounts.id', ChartAccountsListEnum.TAX_OFFSETS_N_R_A_S).sumBy('amount');
10896
11077
  }
@@ -12416,7 +12597,7 @@ FacebookService.authOptions = {
12416
12597
  auth_type: 'rerequest',
12417
12598
  return_scopes: true
12418
12599
  };
12419
- FacebookService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FacebookService, deps: [{ token: i1.HttpClient }, { token: ToastService }, { token: JwtService }, { token: i1$1.Router }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
12600
+ FacebookService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FacebookService, deps: [{ token: i1.HttpClient }, { token: ToastService }, { token: JwtService }, { token: i4.Router }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
12420
12601
  FacebookService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FacebookService, providedIn: 'root' });
12421
12602
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FacebookService, decorators: [{
12422
12603
  type: Injectable,
@@ -12424,7 +12605,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
12424
12605
  providedIn: 'root'
12425
12606
  }]
12426
12607
  }], ctorParameters: function () {
12427
- return [{ type: i1.HttpClient }, { type: ToastService }, { type: JwtService }, { type: i1$1.Router }, { type: undefined, decorators: [{
12608
+ return [{ type: i1.HttpClient }, { type: ToastService }, { type: JwtService }, { type: i4.Router }, { type: undefined, decorators: [{
12609
+ type: Inject,
12610
+ args: ['environment']
12611
+ }] }];
12612
+ } });
12613
+
12614
+ /**
12615
+ * Google instance
12616
+ * https://developers.google.com/identity/oauth2/web/guides/overview
12617
+ * https://developers.google.com/identity/gsi/web/guides/overview
12618
+ */
12619
+ class GoogleService {
12620
+ constructor(http, toastService, jwtService, router, environment) {
12621
+ this.http = http;
12622
+ this.toastService = toastService;
12623
+ this.jwtService = jwtService;
12624
+ this.router = router;
12625
+ this.environment = environment;
12626
+ this.isLoggedInSubject = new BehaviorSubject(!this.jwtService.isTokenExpired());
12627
+ this.isGoogleEnabled = !!this.environment['googleClientId'];
12628
+ // depending on the level of access
12629
+ this.googleScope = 'https://www.googleapis.com/auth/userinfo.profile';
12630
+ }
12631
+ /**
12632
+ * prompt for user consent and obtain an access token to work with user data
12633
+ * requestAccessToken() method to trigger the token UX flow and obtain an access token.
12634
+ * https://developers.google.com/identity/oauth2/web/guides/use-token-model
12635
+ */
12636
+ // prompt for user consent and obtain an access token to work with user data
12637
+ login() {
12638
+ return google.accounts.oauth2.initTokenClient({
12639
+ client_id: this.environment['googleClientId'],
12640
+ scope: this.googleScope,
12641
+ callback: (response) => {
12642
+ this.setAuth(response.access_token);
12643
+ },
12644
+ }).requestAccessToken();
12645
+ }
12646
+ /**
12647
+ * requestAccessToken() method to trigger the token UX flow and obtain an access token:
12648
+ * Choose their account;
12649
+ * sign-in to the Google Account if not already signed-in;
12650
+ * grant consent for your web app to access each requested scope.
12651
+ */
12652
+ setAuth(accessToken, redirectUrl = '/client') {
12653
+ this.http.post(`${this.environment.apiV2}/users/authentication/google`, { accessToken })
12654
+ .subscribe((response) => {
12655
+ this.jwtService.saveTokens(response);
12656
+ this.isLoggedInSubject.next(true);
12657
+ this.router.navigate([redirectUrl]);
12658
+ }, (error) => {
12659
+ this.toastService.error(error.error.violations[0].message);
12660
+ this.logout();
12661
+ });
12662
+ }
12663
+ /**
12664
+ * When the user signs out of your website, you need to call the method
12665
+ * google.accounts.id.disableAutoSelect to record the status in cookies.
12666
+ * https://developers.google.com/identity/oauth2/web/guides/use-token-model
12667
+ */
12668
+ logout() {
12669
+ google.accounts.id.disableAutoSelect();
12670
+ }
12671
+ }
12672
+ GoogleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GoogleService, deps: [{ token: i1.HttpClient }, { token: ToastService }, { token: JwtService }, { token: i4.Router }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
12673
+ GoogleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GoogleService, providedIn: 'root' });
12674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GoogleService, decorators: [{
12675
+ type: Injectable,
12676
+ args: [{
12677
+ providedIn: 'root'
12678
+ }]
12679
+ }], ctorParameters: function () {
12680
+ return [{ type: i1.HttpClient }, { type: ToastService }, { type: JwtService }, { type: i4.Router }, { type: undefined, decorators: [{
12428
12681
  type: Inject,
12429
12682
  args: ['environment']
12430
12683
  }] }];
@@ -14440,6 +14693,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
14440
14693
  }] }];
14441
14694
  } });
14442
14695
 
14696
+ class AllocationRuleService extends RestService$1 {
14697
+ constructor() {
14698
+ super(...arguments);
14699
+ this.endpointUri = 'allocation-rules';
14700
+ this.collectionClass = AllocationRuleCollection;
14701
+ this.modelClass = AllocationRule;
14702
+ this.isApiPlatform = true;
14703
+ }
14704
+ }
14705
+ AllocationRuleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AllocationRuleService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
14706
+ AllocationRuleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AllocationRuleService, providedIn: 'root' });
14707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AllocationRuleService, decorators: [{
14708
+ type: Injectable,
14709
+ args: [{
14710
+ providedIn: 'root'
14711
+ }]
14712
+ }] });
14713
+
14443
14714
  // @TODO Don't look at the commented code. Will be refactored/removed during TT-1503
14444
14715
  /**
14445
14716
  * Service for transaction allocations business logic
@@ -15625,14 +15896,14 @@ class ExportFormatterService {
15625
15896
  }));
15626
15897
  }
15627
15898
  }
15628
- ExportFormatterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ExportFormatterService, deps: [{ token: i1$2.CurrencyPipe }, { token: i1$2.DatePipe }], target: i0.ɵɵFactoryTarget.Injectable });
15899
+ ExportFormatterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ExportFormatterService, deps: [{ token: i1$1.CurrencyPipe }, { token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Injectable });
15629
15900
  ExportFormatterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ExportFormatterService, providedIn: 'root' });
15630
15901
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ExportFormatterService, decorators: [{
15631
15902
  type: Injectable,
15632
15903
  args: [{
15633
15904
  providedIn: 'root'
15634
15905
  }]
15635
- }], ctorParameters: function () { return [{ type: i1$2.CurrencyPipe }, { type: i1$2.DatePipe }]; } });
15906
+ }], ctorParameters: function () { return [{ type: i1$1.CurrencyPipe }, { type: i1$1.DatePipe }]; } });
15636
15907
 
15637
15908
  class HeaderTitleService {
15638
15909
  constructor(router, activatedRoute) {
@@ -15648,14 +15919,14 @@ class HeaderTitleService {
15648
15919
  }), filter((route) => route.outlet === 'primary'), mergeMap((route) => route.data));
15649
15920
  }
15650
15921
  }
15651
- HeaderTitleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: HeaderTitleService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
15922
+ HeaderTitleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: HeaderTitleService, deps: [{ token: i4.Router }, { token: i4.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
15652
15923
  HeaderTitleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: HeaderTitleService, providedIn: 'root' });
15653
15924
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: HeaderTitleService, decorators: [{
15654
15925
  type: Injectable,
15655
15926
  args: [{
15656
15927
  providedIn: 'root'
15657
15928
  }]
15658
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
15929
+ }], ctorParameters: function () { return [{ type: i4.Router }, { type: i4.ActivatedRoute }]; } });
15659
15930
 
15660
15931
  /**
15661
15932
  * Service to work with intercom
@@ -17856,14 +18127,14 @@ class PropertySaleExemptionsForm extends AbstractForm {
17856
18127
  var _a, _b;
17857
18128
  super({
17858
18129
  taxExemption: new UntypedFormControl(taxExemptions.findBy('id', (_b = (_a = propertySale.taxExemption) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : property.getCGTExemption(propertySale))),
17859
- taxExemptionMetadata: new UntypedFormArray([]),
18130
+ taxExemptionMetaFields: new UntypedFormArray([]),
17860
18131
  netCGT: new UntypedFormControl(propertySale.netCGT)
17861
18132
  }, propertySale);
17862
18133
  this.propertySale = propertySale;
17863
18134
  this.property = property;
17864
18135
  this.taxExemptions = taxExemptions;
17865
18136
  if (propertySale.taxExemption) {
17866
- this.setFormMetadataControls();
18137
+ this.setFormMetaFieldsControls();
17867
18138
  }
17868
18139
  this.updateNetCGT();
17869
18140
  this.listenEvents();
@@ -17883,36 +18154,36 @@ class PropertySaleExemptionsForm extends AbstractForm {
17883
18154
  listenTaxExemptionUpdated() {
17884
18155
  this.get('taxExemption').valueChanges.subscribe((taxExemption) => {
17885
18156
  this.updateNetCGT();
17886
- this.setFormMetadataControls(taxExemption);
18157
+ this.setFormMetaFieldsControls(taxExemption);
17887
18158
  });
17888
18159
  }
17889
18160
  /**
17890
- * show metadata related to passed tax exemption or existing property sale metadata
18161
+ * show meta fields related to passed tax exemption or existing property sale meta fields
17891
18162
  */
17892
- setFormMetadataControls(taxExemption) {
18163
+ setFormMetaFieldsControls(taxExemption) {
17893
18164
  // use property sale tax exemption if it exists to preselect data
17894
18165
  const currentTaxExemption = this.propertySale.taxExemption ?
17895
18166
  this.taxExemptions.findBy('id', this.propertySale.taxExemption.id) :
17896
18167
  taxExemption;
17897
- const formArray = this.get('taxExemptionMetadata');
18168
+ const formArray = this.get('taxExemptionMetaFields');
17898
18169
  // clean up
17899
18170
  formArray.clear();
17900
- // show all tax exemption metadata fields
17901
- currentTaxExemption.metadata.forEach((metadata) => {
17902
- // use property sale tax exemption metadata value if it exists
17903
- const metadataValue = this.propertySale.taxExemption ?
17904
- this.propertySale.taxExemptionMetadata
17905
- .find((saleMetadata) => saleMetadata.metadata.id === metadata.id).value :
18171
+ // show all tax exemption meta fields
18172
+ currentTaxExemption.metaFields.forEach((metaField) => {
18173
+ // use property sale tax exemption meta field value if it exists
18174
+ const metaFieldValue = this.propertySale.taxExemption ?
18175
+ this.propertySale.taxExemptionMetaFields
18176
+ .find((saleMetaField) => saleMetaField.metaField.id === metaField.id).value :
17906
18177
  null;
17907
18178
  const validators = [
17908
18179
  // claim percent is optional
17909
- metadata.id !== TaxExemptionMetadataEnum.CLAIM_PERCENT && Validators.required,
18180
+ metaField.id !== TaxExemptionMetaFieldEnum.CLAIM_PERCENT && Validators.required,
17910
18181
  // ppr days can't be more than ownership days
17911
- metadata.id === TaxExemptionMetadataEnum.PPR_DAYS && Validators.max(this.property.getOwnershipDuration(this.propertySale))
18182
+ metaField.id === TaxExemptionMetaFieldEnum.PPR_DAYS && Validators.max(this.property.getOwnershipDuration(this.propertySale))
17912
18183
  ].filter(Boolean);
17913
18184
  formArray.push(new UntypedFormGroup({
17914
- metadata: new UntypedFormControl(metadata),
17915
- value: new UntypedFormControl(metadataValue, validators)
18185
+ metaField: new UntypedFormControl(metaField),
18186
+ value: new UntypedFormControl(metaFieldValue, validators)
17916
18187
  }));
17917
18188
  });
17918
18189
  }
@@ -18610,6 +18881,268 @@ var FormValidationsEnum;
18610
18881
  FormValidationsEnum["FILE_ACCEPTED_TYPES"] = "Accepted file type: .doc .jpg .png .pdf .tiff .bmp .excel .csv";
18611
18882
  })(FormValidationsEnum || (FormValidationsEnum = {}));
18612
18883
 
18884
+ class AllocationRuleConditionForm extends AbstractForm {
18885
+ constructor(condition = plainToClass(AllocationRuleCondition, {})) {
18886
+ super({
18887
+ field: new UntypedFormControl(condition.field, Validators.required),
18888
+ comparisonOperator: new UntypedFormControl(condition.comparisonOperator, Validators.required),
18889
+ value: new UntypedFormControl(condition.value, Validators.required)
18890
+ }, condition);
18891
+ }
18892
+ }
18893
+
18894
+ class AllocationRuleTransactionMetaFieldForm extends AbstractForm {
18895
+ constructor(metaField = plainToClass(AllocationRuleTransactionMetaField, {})) {
18896
+ super({
18897
+ value: new UntypedFormControl(metaField.value)
18898
+ }, metaField);
18899
+ }
18900
+ }
18901
+
18902
+ /**
18903
+ * @TODO Alex: extend transaction form(s) when transaction forms refactored
18904
+ */
18905
+ class AllocationRuleTransactionForm extends AbstractForm {
18906
+ constructor(transaction,
18907
+ // Flag to enable transaction GST field
18908
+ isGST) {
18909
+ super({
18910
+ amount: new UntypedFormControl(null),
18911
+ tax: new UntypedFormControl(transaction.tax || 0, Validators.required),
18912
+ claimPercent: new UntypedFormControl(transaction.claimPercent || 100, [Validators.required, Validators.min(0), Validators.max(100)]),
18913
+ chartAccounts: new UntypedFormControl(transaction.chartAccounts, Validators.required),
18914
+ isGST: new UntypedFormControl({ value: transaction.isGST || false, disabled: !isGST }),
18915
+ loan: new UntypedFormControl(transaction.loan),
18916
+ incomeSource: new UntypedFormControl(transaction.incomeSource, conditionalValidator(() => { var _a; return (_a = transaction.chartAccounts) === null || _a === void 0 ? void 0 : _a.isWorkIncome(); }, Validators.required)),
18917
+ metaFields: new UntypedFormArray((transaction.metaFields || []).map((metaField) => new AllocationRuleTransactionMetaFieldForm(metaField))),
18918
+ business: new UntypedFormControl(transaction.business, Validators.required),
18919
+ property: new UntypedFormControl(transaction.property, Validators.required),
18920
+ // Show null as default value for new transaction to avoid preselecting of not allowed tank types
18921
+ tankType: new UntypedFormControl(transaction.id ? transaction.tankType : null, Validators.required),
18922
+ childTransactions: new UntypedFormArray((transaction.childTransactions || []).map((childTransaction) => new UntypedFormGroup({
18923
+ chartAccounts: new UntypedFormControl(childTransaction.chartAccounts, Validators.required),
18924
+ amount: new UntypedFormControl(childTransaction.amount, Validators.required)
18925
+ })))
18926
+ }, transaction);
18927
+ this.listenEvents();
18928
+ }
18929
+ /**
18930
+ * @TODO Alex: move to abstract form, universal method getArray(arrayName)
18931
+ */
18932
+ get metaFieldsArray() {
18933
+ return this.get('metaFields');
18934
+ }
18935
+ get childTransactionsArray() {
18936
+ return this.get('childTransactions');
18937
+ }
18938
+ addChildTransactionForm() {
18939
+ this.childTransactionsArray.push(new UntypedFormGroup({
18940
+ chartAccounts: new UntypedFormControl(null, Validators.required),
18941
+ amount: new UntypedFormControl(null, Validators.required)
18942
+ }));
18943
+ }
18944
+ submit() {
18945
+ const data = {
18946
+ metaFields: this.metaFieldsArray.controls.map((metaFieldForm) => metaFieldForm.submit())
18947
+ };
18948
+ return super.submit(data);
18949
+ }
18950
+ listenEvents() {
18951
+ this.listenChartAccountsChanges();
18952
+ this.listenTankTypeChanges();
18953
+ this.listenIncomeSourceChanges();
18954
+ this.listenPropertyChanges();
18955
+ }
18956
+ listenChartAccountsChanges() {
18957
+ this.get('chartAccounts').valueChanges.subscribe((chartAccounts) => {
18958
+ this.get('incomeSource').removeValidators(Validators.required);
18959
+ if (!chartAccounts) {
18960
+ return;
18961
+ }
18962
+ this.updateClaimPercent();
18963
+ // User have to select income source for work income
18964
+ if (chartAccounts.isWorkIncome()) {
18965
+ this.get('incomeSource').setValidators(Validators.required);
18966
+ }
18967
+ // Rebuild meta fields
18968
+ this.metaFieldsArray.clear();
18969
+ chartAccounts.metaFields.forEach((chartAccountsMetaField) => {
18970
+ this.metaFieldsArray.push(new AllocationRuleTransactionMetaFieldForm(plainToClass(AllocationRuleTransactionMetaField, { chartAccountsMetaField })));
18971
+ });
18972
+ });
18973
+ }
18974
+ /**
18975
+ * Child transaction allowance depends on tank type.
18976
+ * Also chart accounts are different, so we just reset child transactions when tank type changed
18977
+ */
18978
+ listenTankTypeChanges() {
18979
+ this.get('tankType').valueChanges.subscribe(() => {
18980
+ this.childTransactionsArray.reset();
18981
+ });
18982
+ }
18983
+ /**
18984
+ * Set tax automatically when salary income source selected
18985
+ */
18986
+ listenIncomeSourceChanges() {
18987
+ this.get('incomeSource').valueChanges.subscribe((incomeSource) => {
18988
+ if (!incomeSource) {
18989
+ this.get('tax').setValue(0);
18990
+ return;
18991
+ }
18992
+ // prefill salary tax with its income source forecast
18993
+ if (incomeSource instanceof IncomeSource && incomeSource.isSalaryIncome() && !this.get('tax').value) {
18994
+ this.get('tax').setValue(incomeSource.salaryForecasts[0].taxWithheld);
18995
+ }
18996
+ });
18997
+ }
18998
+ listenPropertyChanges() {
18999
+ this.get('property').valueChanges.subscribe(() => {
19000
+ this.updateClaimPercent();
19001
+ });
19002
+ }
19003
+ /**
19004
+ * Update claim percent value and state depends on business logic
19005
+ */
19006
+ updateClaimPercent() {
19007
+ const claimPercentControl = this.get('claimPercent');
19008
+ // claim percent is changeable only for work and sole expenses except vehicle and personal
19009
+ claimPercentControl.disable();
19010
+ if (!this.currentValue.chartAccounts) {
19011
+ return;
19012
+ }
19013
+ if (this.currentValue.chartAccounts.isClaimPercentEditable()) {
19014
+ claimPercentControl.enable();
19015
+ }
19016
+ claimPercentControl.setValue(this.currentValue.calculateClaimPercent());
19017
+ }
19018
+ }
19019
+
19020
+ class AllocationRuleForm extends AbstractForm {
19021
+ constructor(
19022
+ // rule is required because we have to keep bank account relation
19023
+ rule,
19024
+ // Flag to enable transaction GST field
19025
+ isGST) {
19026
+ var _a, _b;
19027
+ super({
19028
+ type: new UntypedFormControl(rule.type, Validators.required),
19029
+ name: new UntypedFormControl(rule.name, Validators.required),
19030
+ conditionOperator: new UntypedFormControl(rule.conditionOperator, Validators.required),
19031
+ conditions: new UntypedFormArray((rule.conditions || [plainToClass(AllocationRuleCondition, {})])
19032
+ .map((condition) => new AllocationRuleConditionForm(condition))),
19033
+ transaction: new AllocationRuleTransactionForm(rule.transaction || plainToClass(AllocationRuleTransaction, {}), isGST),
19034
+ transferBankAccount: new UntypedFormControl(rule.transferBankAccount, Validators.required),
19035
+ autoAllocate: new UntypedFormControl(rule.autoAllocate || false, Validators.required)
19036
+ }, rule);
19037
+ this.isGST = isGST;
19038
+ this.listenEvents();
19039
+ this.setupFieldsByType(rule.type);
19040
+ this.setupFieldsByTankType((_a = rule.transaction) === null || _a === void 0 ? void 0 : _a.tankType);
19041
+ this.updateChartAccountsCategories();
19042
+ if (!((_b = this.transactionFormGroup.get('chartAccounts').value) === null || _b === void 0 ? void 0 : _b.isClaimPercentEditable())) {
19043
+ this.transactionFormGroup.get('claimPercent').disable();
19044
+ }
19045
+ }
19046
+ get conditionsArray() {
19047
+ return this.get('conditions');
19048
+ }
19049
+ get childTransactionsArray() {
19050
+ return this.transactionFormGroup.get('childTransactions');
19051
+ }
19052
+ get transactionFormGroup() {
19053
+ return this.get('transaction');
19054
+ }
19055
+ addConditionForm() {
19056
+ this.conditionsArray.push(new AllocationRuleConditionForm());
19057
+ }
19058
+ isTaxFieldHidden() {
19059
+ const chartAccounts = this.transactionFormGroup.get('chartAccounts').value;
19060
+ return !chartAccounts || !chartAccounts.isTaxable();
19061
+ }
19062
+ /**
19063
+ * TODO Alex: disable sole tank in form control when income selected
19064
+ */
19065
+ isTransactionFieldsHidden() {
19066
+ return this.transactionFormGroup.get('tankType').value === null || this.currentValue.isSoleIncome();
19067
+ }
19068
+ submit() {
19069
+ const data = {
19070
+ conditions: this.conditionsArray.controls.map((conditionForm) => conditionForm.submit()),
19071
+ transaction: null
19072
+ };
19073
+ if (!this.currentValue.isTransfer()) {
19074
+ data.transaction = this.transactionFormGroup.submit();
19075
+ }
19076
+ return super.submit(data);
19077
+ }
19078
+ listenEvents() {
19079
+ this.listenTankTypeChanges();
19080
+ this.listenTypeChanges();
19081
+ }
19082
+ listenTypeChanges() {
19083
+ this.get('type').valueChanges.subscribe((type) => {
19084
+ this.setupFieldsByType(type);
19085
+ this.updateChartAccountsCategories();
19086
+ // we have different fields for different types
19087
+ this.get('transaction').reset();
19088
+ });
19089
+ }
19090
+ listenTankTypeChanges() {
19091
+ this.transactionFormGroup.get('tankType').valueChanges.subscribe((tankType) => {
19092
+ this.updateChartAccountsCategories();
19093
+ this.setupFieldsByTankType(tankType);
19094
+ });
19095
+ }
19096
+ /**
19097
+ * Update list of chart accounts categories allowed for transaction
19098
+ * Depends on transaction type and tank type
19099
+ */
19100
+ updateChartAccountsCategories() {
19101
+ // We use unique one Chart Accounts for transfer
19102
+ if (this.currentValue.isTransfer()) {
19103
+ this.chartAccountsCategories = null;
19104
+ return;
19105
+ }
19106
+ const excludedCategories = [...CHART_ACCOUNTS_CATEGORIES.depreciation];
19107
+ this.chartAccountsCategories = intersection(CHART_ACCOUNTS_CATEGORIES[this.currentValue.typeLabel], CHART_ACCOUNTS_CATEGORIES[this.currentValue.tankTypeLabel])
19108
+ .filter((category) => !excludedCategories.includes(category));
19109
+ }
19110
+ setupFieldsByType(type) {
19111
+ switch (type) {
19112
+ case AllocationRuleTypeEnum.EXPENSE:
19113
+ case AllocationRuleTypeEnum.INCOME:
19114
+ this.get('transaction').enable({ emitEvent: false });
19115
+ this.get('transferBankAccount').disable({ emitEvent: false });
19116
+ break;
19117
+ case AllocationRuleTypeEnum.TRANSFER:
19118
+ this.get('transaction').disable({ emitEvent: false });
19119
+ this.get('transferBankAccount').enable({ emitEvent: false });
19120
+ return;
19121
+ }
19122
+ }
19123
+ setupFieldsByTankType(tankType) {
19124
+ // First disable tankType-related fields, second enable for selected tank type
19125
+ this.transactionFormGroup.get('property').disable({ emitEvent: false });
19126
+ this.transactionFormGroup.get('business').disable({ emitEvent: false });
19127
+ this.transactionFormGroup.get('isGST').disable({ emitEvent: false });
19128
+ this.transactionFormGroup.get('incomeSource').disable({ emitEvent: false });
19129
+ switch (tankType) {
19130
+ case TankTypeEnum.WORK:
19131
+ this.transactionFormGroup.get('incomeSource').enable({ emitEvent: false });
19132
+ break;
19133
+ case TankTypeEnum.PROPERTY:
19134
+ this.transactionFormGroup.get('property').enable({ emitEvent: false });
19135
+ break;
19136
+ case TankTypeEnum.SOLE:
19137
+ this.transactionFormGroup.get('business').enable({ emitEvent: false });
19138
+ if (this.isGST) {
19139
+ this.transactionFormGroup.get('isGST').enable({ emitEvent: false });
19140
+ }
19141
+ break;
19142
+ }
19143
+ }
19144
+ }
19145
+
18613
19146
  /**
18614
19147
  * @TODO refactor, move specific fields like property in separated forms
18615
19148
  * @TODO remove useless getters
@@ -18772,10 +19305,10 @@ class WorkTransactionForm extends TransactionForm {
18772
19305
  constructor(transaction, registeredForGst, allocations, controls = {}) {
18773
19306
  super(transaction, registeredForGst, allocations, Object.assign(controls, {
18774
19307
  // additional data related to work (like tax instalments)
18775
- metadata: new FormArray((transaction.metadata || []).map((transactionMetadata) => {
19308
+ metaFields: new FormArray((transaction.metaFields || []).map((transactionMetaField) => {
18776
19309
  return new FormGroup({
18777
- value: new FormControl(transactionMetadata.value),
18778
- chartAccountsMetadata: new FormControl(transactionMetadata.chartAccountsMetadata)
19310
+ value: new FormControl(transactionMetaField.value),
19311
+ chartAccountsMetaField: new FormControl(transactionMetaField.chartAccountsMetaField)
18779
19312
  });
18780
19313
  }))
18781
19314
  }));
@@ -18787,20 +19320,20 @@ class WorkTransactionForm extends TransactionForm {
18787
19320
  watchChartAccounts() {
18788
19321
  super.watchChartAccounts();
18789
19322
  this.get('chartAccounts').valueChanges.subscribe((chartAccounts) => {
18790
- this.buildMetadataForm();
19323
+ this.buildMetaFieldsForm();
18791
19324
  });
18792
19325
  }
18793
19326
  /**
18794
19327
  * depends on chartAccounts the form could include different extra fields
18795
19328
  */
18796
- buildMetadataForm() {
19329
+ buildMetaFieldsForm() {
18797
19330
  // Remove all controls in the FormArray before pushing
18798
- this.get('metadata').clear();
18799
- // create form controls for each metadata object from selected chart accounts
18800
- (this.get('chartAccounts').value.metadata).forEach((chartAccountsMetadata) => {
18801
- this.get('metadata').push(new FormGroup({
18802
- value: new FormControl(chartAccountsMetadata.isSharePercentage() ? 100 : 0),
18803
- chartAccountsMetadata: new FormControl(chartAccountsMetadata),
19331
+ this.get('metaFields').clear();
19332
+ // create form controls for each metaField object from selected chart accounts
19333
+ (this.get('chartAccounts').value.metaFields).forEach((chartAccountsMetaField) => {
19334
+ this.get('metaFields').push(new FormGroup({
19335
+ value: new FormControl(chartAccountsMetaField.isSharePercentage() ? 100 : 0),
19336
+ chartAccountsMetaField: new FormControl(chartAccountsMetaField),
18804
19337
  }));
18805
19338
  });
18806
19339
  }
@@ -18890,24 +19423,24 @@ class WorkIncomeForm extends WorkTransactionForm {
18890
19423
  class WorkExpenseForm extends WorkTransactionForm {
18891
19424
  constructor(transaction, registeredForGst, allocations, controls = {}) {
18892
19425
  super(transaction, registeredForGst, allocations, controls);
18893
- // amount set automatically for chartAccounts with hours metadata
18894
- if (transaction.getMetadataFieldValue(ChartAccountsMetadataListEnum.HOURS)) {
19426
+ // amount set automatically for chartAccounts with hours meta field
19427
+ if (transaction.getMetaFieldValue(ChartAccountsMetaFieldListEnum.HOURS)) {
18895
19428
  this.get('amount').disable();
18896
19429
  }
18897
19430
  }
18898
19431
  listenEvents() {
18899
- this.watchChartAccountsMetadata();
19432
+ this.watchChartAccountsMetaFields();
18900
19433
  }
18901
- watchChartAccountsMetadata() {
18902
- this.get('metadata').valueChanges.subscribe((metadata) => {
18903
- const hoursMetadata = new Collection(metadata).findBy('chartAccountsMetadata.id', ChartAccountsMetadataListEnum.HOURS);
18904
- if (!hoursMetadata) {
19434
+ watchChartAccountsMetaFields() {
19435
+ this.get('metaFields').valueChanges.subscribe((metaFields) => {
19436
+ const hoursMetaField = new Collection(metaFields).findBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.HOURS);
19437
+ if (!hoursMetaField) {
18905
19438
  return;
18906
19439
  }
18907
19440
  // for home office hours expense amount is a fixed rate per hour
18908
19441
  this.get('amount').reset();
18909
19442
  this.get('amount').disable();
18910
- this.get('amount').setValue((this.get('chartAccounts').value.getCurrentYearValue().value * +hoursMetadata.value).toFixed(2));
19443
+ this.get('amount').setValue((this.get('chartAccounts').value.getCurrentYearValue().value * +hoursMetaField.value).toFixed(2));
18911
19444
  });
18912
19445
  }
18913
19446
  }
@@ -18953,5 +19486,5 @@ class DepreciationForm extends TransactionBaseForm {
18953
19486
  * Generated bundle index. Do not edit.
18954
19487
  */
18955
19488
 
18956
- export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressForm, AddressService, AddressTypeEnum, AllocationGroup, AllocationGroupCollection, 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, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, 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, HeaderTitleService, 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, PropertySaleTaxExemptionMetadata, PropertySaleTaxExemptionMetadataCollection, 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, TaxExemptionMetadata, TaxExemptionMetadataEnum, 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, TransactionMetadata, 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 };
19489
+ 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, 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 };
18957
19490
  //# sourceMappingURL=taxtank-core.mjs.map