taxtank-core 0.30.127 → 0.30.129

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.
@@ -70,7 +70,10 @@ export declare class BankAccountCollection extends Collection<BankAccount> {
70
70
  * @TODO Alex not efficient, filter bankAccounts by property first
71
71
  */
72
72
  getPropertyBalanceAmount(propertyId: number): number;
73
- getMonthlyRepaymentAmount(propertyId: number): number;
73
+ get propertiesBalanceAmount(): number;
74
+ get propertiesMonthlyRepaymentAmount(): number;
75
+ getPropertyMonthlyRepaymentAmount(propertyId: number): number;
74
76
  getLVR(property: Property): number;
75
77
  getOwn(): this;
78
+ getActiveLoanAccountsByProperties(ids: number[]): BankAccountCollection;
76
79
  }
@@ -32,9 +32,9 @@ export declare class CollectionDictionary<Collection extends BaseCollection<Abst
32
32
  */
33
33
  get(key: string | number): Collection;
34
34
  /**
35
- * Join several collections by ids
35
+ * Join several collections by ids, return collection of uniq models (skip duplicates)
36
36
  */
37
- merge(keys: number[]): Collection;
37
+ merge(keys: number[] | string[]): Collection;
38
38
  /**
39
39
  * Create instance of collection
40
40
  */
@@ -1,8 +1,7 @@
1
1
  import { Collection } from '../collection';
2
- import { Property } from '../../models/property/property';
3
- import { PropertyCategory } from '../../models/property/property-category';
2
+ import { Property, PropertyCategory } from '../../models';
4
3
  import { DepreciationCollection } from '../depreciation.collection';
5
- import { TransactionCollection } from '../transaction/transaction.collection';
4
+ import { TransactionCollection } from '../transaction';
6
5
  export declare class PropertyCollection extends Collection<Property> {
7
6
  /**
8
7
  * Get new property collection filtered by category id
@@ -54,4 +53,5 @@ export declare class PropertyCollection extends Collection<Property> {
54
53
  * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/217677997/Property+Tank+Dashboard
55
54
  */
56
55
  sortByBestPerformance(transactions: TransactionCollection, depreciations: DepreciationCollection): this;
56
+ get netIncome(): number;
57
57
  }
@@ -74,6 +74,7 @@ export declare class BankAccount extends BankAccountBase {
74
74
  * @param propertyId Id of property
75
75
  */
76
76
  getPropertyBalanceAmount(propertyId: number): number;
77
+ getMonthlyRepaymentAmount(propertyId: number): number;
77
78
  /**
78
79
  * Check if bank account is active (has 'active' status or hasn't been paid out/refinanced)
79
80
  */
@@ -1,9 +1,27 @@
1
1
  import { BorrowingReport as BorrowingReportBase } from '../../db/Models/property/borrowing-report';
2
2
  import { User } from '../user';
3
+ import { AnnualClientDetails } from '../client';
4
+ import { IncomeSourceForecast, SalaryForecast } from '../income-source';
5
+ /**
6
+ * Borrowing power report, shows if u can afford new property loan
7
+ * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/4717608961/Borrowing+Power+Report+-+Property+Tank
8
+ */
3
9
  export declare class BorrowingReport extends BorrowingReportBase {
4
10
  user: User;
5
11
  netRentIncome: number;
6
12
  loanRepaymentAmount: number;
7
13
  otherLiabilities: number;
8
14
  livingExpenses: number;
15
+ /**
16
+ * some fields calculated automatically until user filled them manually
17
+ */
18
+ static calculate(salaryForecasts: SalaryForecast[], incomeSourceForecasts: IncomeSourceForecast[], clientDetails?: AnnualClientDetails, report?: BorrowingReport): BorrowingReport;
19
+ /**
20
+ * free money after expenses
21
+ */
22
+ getNetIncomeSurplus(profit: number, repaymentAmount: number): number;
23
+ /**
24
+ * surplus income to cover your debt obligations
25
+ */
26
+ getNetSurplusRatio(profit: number, repaymentAmount: number): number;
9
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.30.127",
3
+ "version": "0.30.129",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/compiler": "^15.1.5",