taxtank-core 0.17.10 → 0.17.13

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.
@@ -1,6 +1,8 @@
1
1
  import { Collection } from '../collection';
2
2
  import { Property } from '../../models/property/property';
3
3
  import { PropertyCategory } from '../../models/property/property-category';
4
+ import { DepreciationCollection } from '../depreciation.collection';
5
+ import { TransactionCollection } from '../transaction/transaction.collection';
4
6
  export declare class PropertyCollection extends Collection<Property> {
5
7
  /**
6
8
  * Get new property collection filtered by category id
@@ -32,4 +34,12 @@ export declare class PropertyCollection extends Collection<Property> {
32
34
  * Get list of unique property categories from collection
33
35
  */
34
36
  getCategories(): PropertyCategory[];
37
+ /**
38
+ * Get property with the highest growth percent
39
+ */
40
+ getBestPerformanceGrowthProperty(): Property;
41
+ /**
42
+ * Get property with the lowest tax position
43
+ */
44
+ getBestPerformanceTaxProperty(transactions: TransactionCollection, depreciations: DepreciationCollection): Property;
35
45
  }
@@ -56,7 +56,7 @@ export declare class Depreciation extends DepreciationBase implements Expense, I
56
56
  */
57
57
  getDate(): Date;
58
58
  /**
59
- * @TODO wrong year, use current financial year, check everywhere
59
+ * @TODO Vik: Research a problem with depreciations without current year forecast
60
60
  */
61
61
  get currentYearForecast(): DepreciationForecast;
62
62
  getForecastByYear(year: number): DepreciationForecast;
@@ -67,5 +67,8 @@ export declare class Depreciation extends DepreciationBase implements Expense, I
67
67
  * Create a new transaction from current depreciation
68
68
  */
69
69
  toTransaction(params?: {}): Transaction;
70
+ /**
71
+ * @TODO Michael: remove and check everywhere in reports
72
+ */
70
73
  get claimAmount(): number;
71
74
  }
@@ -9,37 +9,38 @@ export declare enum AppEventTypeEnum {
9
9
  CLIENT_INVITE_ACCEPTED = 7,
10
10
  CLIENT_OPEN_CHAT = 8,
11
11
  CLIENT_TRANSFER_TO_OTHER_EMPLOYEE = 9,
12
- DEPRECIATION_DELETED = 10,
13
- DEPRECIATIONS_CREATED = 11,
14
- INCOME_SOURCES_CREATED = 12,
15
- INCOME_SOURCES_UPDATED = 13,
16
- INCOME_SOURCES_FORECASTS_CREATED = 14,
17
- INCOME_SOURCES_FORECASTS_UPDATED = 15,
18
- LOAN_UPDATED = 16,
19
- LOAN_PAYOUT_UPDATED = 17,
20
- MESSAGE_CREATED = 18,
21
- MESSAGE_FILE_CREATED = 19,
22
- MESSAGE_FILE_DELETED = 20,
23
- NOTIFICATION_ADDED = 21,
24
- PROPERTY_UPDATED_WITH_DOCUMENT = 22,
25
- PROPERTY_DOCUMENT_ADDED = 23,
26
- PROPERTY_MOVEMENT_CREATED = 24,
27
- PROPERTY_MOVEMENT_UPDATED = 25,
28
- PROPERTY_MOVEMENT_DELETED = 26,
29
- PROPERTY_SHARE_UPDATED = 27,
30
- PROPERTY_SUBSCRIPTION_ADDED = 28,
31
- PROPERTY_SUBSCRIPTION_DELETED = 29,
32
- PROPERTY_VALUATION_DOCUMENT_CREATED = 30,
33
- SERVICE_SUBSCRIPTION_UPDATED = 31,
34
- TAX_REVIEW_UPDATED = 32,
35
- TRANSACTION_CREATED = 33,
36
- TRANSACTION_DELETED = 34,
37
- TRANSACTION_UPDATED = 35,
38
- TRANSACTIONS_CREATED = 36,
39
- USER_UPDATED = 37,
40
- VEHICLE_CLAIM_UPDATED = 38,
41
- VEHICLE_CLAIM_CREATED = 39,
42
- VEHICLE_LOGBOOK_CREATED = 40,
43
- VEHICLE_LOGBOOK_UPDATED = 41,
44
- VEHICLE_LOGBOOK_DELETED = 42
12
+ CURRENT_USER_GET_FAILED = 10,
13
+ DEPRECIATION_DELETED = 11,
14
+ DEPRECIATIONS_CREATED = 12,
15
+ INCOME_SOURCES_CREATED = 13,
16
+ INCOME_SOURCES_UPDATED = 14,
17
+ INCOME_SOURCES_FORECASTS_CREATED = 15,
18
+ INCOME_SOURCES_FORECASTS_UPDATED = 16,
19
+ LOAN_UPDATED = 17,
20
+ LOAN_PAYOUT_UPDATED = 18,
21
+ MESSAGE_CREATED = 19,
22
+ MESSAGE_FILE_CREATED = 20,
23
+ MESSAGE_FILE_DELETED = 21,
24
+ NOTIFICATION_ADDED = 22,
25
+ PROPERTY_UPDATED_WITH_DOCUMENT = 23,
26
+ PROPERTY_DOCUMENT_ADDED = 24,
27
+ PROPERTY_MOVEMENT_CREATED = 25,
28
+ PROPERTY_MOVEMENT_UPDATED = 26,
29
+ PROPERTY_MOVEMENT_DELETED = 27,
30
+ PROPERTY_SHARE_UPDATED = 28,
31
+ PROPERTY_SUBSCRIPTION_ADDED = 29,
32
+ PROPERTY_SUBSCRIPTION_DELETED = 30,
33
+ PROPERTY_VALUATION_DOCUMENT_CREATED = 31,
34
+ SERVICE_SUBSCRIPTION_UPDATED = 32,
35
+ TAX_REVIEW_UPDATED = 33,
36
+ TRANSACTION_CREATED = 34,
37
+ TRANSACTION_DELETED = 35,
38
+ TRANSACTION_UPDATED = 36,
39
+ TRANSACTIONS_CREATED = 37,
40
+ USER_UPDATED = 38,
41
+ VEHICLE_CLAIM_UPDATED = 39,
42
+ VEHICLE_CLAIM_CREATED = 40,
43
+ VEHICLE_LOGBOOK_CREATED = 41,
44
+ VEHICLE_LOGBOOK_UPDATED = 42,
45
+ VEHICLE_LOGBOOK_DELETED = 43
45
46
  }
@@ -59,4 +59,8 @@ export declare class PropertyEquityChartData {
59
59
  * Check if loan balance is 0 and set it as null (to not to draw point on the chart)
60
60
  */
61
61
  private checkZeroLoanBalance;
62
+ /**
63
+ * Check if market value is 0 and set it as null (to not to draw point on the chart)
64
+ */
65
+ private checkZeroMarketValue;
62
66
  }
@@ -12,6 +12,8 @@ import { User } from '../user/user';
12
12
  import { TaxExemptionEnum } from '../../db/Enums/property/property-sale/tax-exemption.enum';
13
13
  import { PropertySale } from './property-sale/property-sale';
14
14
  import { unitOfTime } from 'moment';
15
+ import { TransactionCollection } from '../../collections/transaction/transaction.collection';
16
+ import { DepreciationCollection } from '../../collections/depreciation.collection';
15
17
  /**
16
18
  * propertySale docs - https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/4209508353/Property+Sold+button
17
19
  */
@@ -84,4 +86,5 @@ export declare class Property extends PropertyBase implements Photoable, Documen
84
86
  * ownership duration from purchase till sale
85
87
  */
86
88
  getOwnershipDuration(sale: PropertySale, unitOfTime?: unitOfTime.Diff): number;
89
+ getTaxPosition(transactions: TransactionCollection, depreciations: DepreciationCollection): number;
87
90
  }
@@ -1,13 +1,24 @@
1
1
  import { BehaviorSubject } from 'rxjs';
2
2
  import { HttpClient } from '@angular/common/http';
3
3
  import { JwtService } from './jwt.service';
4
+ import { IEventListener } from "../../interfaces/event-listener.interface";
5
+ import { EventDispatcherService } from "../event/event-dispatcher.service";
4
6
  import * as i0 from "@angular/core";
5
- export declare class AuthService {
7
+ export declare class AuthService implements IEventListener {
6
8
  private http;
7
9
  private jwtService;
10
+ private eventDispatcherService;
8
11
  private environment;
9
12
  isLoggedInSubject: BehaviorSubject<boolean>;
10
- constructor(http: HttpClient, jwtService: JwtService, environment: any);
13
+ constructor(http: HttpClient, jwtService: JwtService, eventDispatcherService: EventDispatcherService, environment: any);
14
+ /**
15
+ * Listen to Event Dispatcher events
16
+ */
17
+ listenEvents(): void;
18
+ /**
19
+ * User logout if failed current user get
20
+ */
21
+ listenUserGetFailed(): void;
11
22
  setAuth(response: any): void;
12
23
  login(username: string, password: string): import("rxjs").Observable<any>;
13
24
  refresh(refreshToken: string): import("rxjs").Observable<any>;
@@ -22,12 +22,6 @@ export declare class DepreciationService extends RestService<DepreciationBase, D
22
22
  */
23
23
  listenEvents(): void;
24
24
  getOpenBalance(depreciation: Depreciation): Observable<number>;
25
- /**
26
- * @TODO wrong place, move to collection model
27
- */
28
- calculateSummaryAmount(depreciationList: Depreciation[]): number;
29
- calculateBorrowingExpenses(depreciationList: Depreciation[]): Observable<number>;
30
- calculateDepreciations(depreciationList: Depreciation[]): Observable<number>;
31
25
  /**
32
26
  * Upload depreciation receipt
33
27
  * @param depreciation for which will be uploaded receipt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.17.10",
3
+ "version": "0.17.13",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",