taxtank-core 0.28.35 → 0.28.36

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 (49) hide show
  1. package/bundles/taxtank-core.umd.js +1333 -1234
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/db/Models/bank/bank.js +1 -1
  4. package/esm2015/lib/interceptors/basiq-token.interceptor.js +1 -1
  5. package/esm2015/lib/models/bank/bank-connection.js +2 -2
  6. package/esm2015/lib/models/bank/bank-external-stats.js +7 -0
  7. package/esm2015/lib/models/bank/bank.js +6 -2
  8. package/esm2015/lib/models/bank/basiq/basiq-config.js +12 -0
  9. package/esm2015/lib/models/bank/basiq/basiq-connections-response.interface.js +2 -0
  10. package/esm2015/lib/models/bank/basiq/basiq-job-response.js +12 -0
  11. package/esm2015/lib/models/bank/basiq/basiq-job-step.js +12 -0
  12. package/esm2015/lib/models/bank/basiq/basiq-job.js +4 -0
  13. package/esm2015/lib/models/bank/basiq/basiq-token-response.interface.js +2 -0
  14. package/esm2015/lib/models/bank/basiq/basiq-token.js +13 -0
  15. package/esm2015/lib/models/bank/basiq/index.js +8 -0
  16. package/esm2015/lib/models/bank/index.js +14 -0
  17. package/esm2015/lib/models/event/app-event-type.enum.js +58 -57
  18. package/esm2015/lib/models/index.js +2 -1
  19. package/esm2015/lib/services/http/bank/basiq/basiq-token.service.js +2 -2
  20. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +51 -5
  21. package/esm2015/lib/services/http/user/user.service.js +8 -2
  22. package/esm2015/public-api.js +2 -15
  23. package/fesm2015/taxtank-core.js +850 -766
  24. package/fesm2015/taxtank-core.js.map +1 -1
  25. package/lib/db/Models/bank/bank.d.ts +4 -5
  26. package/lib/models/bank/bank-connection.d.ts +1 -1
  27. package/lib/models/bank/bank-external-stats.d.ts +11 -0
  28. package/lib/models/bank/bank.d.ts +2 -0
  29. package/lib/models/bank/{basiq-config.d.ts → basiq/basiq-config.d.ts} +0 -0
  30. package/lib/{services/http → models}/bank/basiq/basiq-connections-response.interface.d.ts +0 -0
  31. package/lib/models/bank/basiq/basiq-job-response.d.ts +5 -0
  32. package/lib/models/bank/basiq/basiq-job-step.d.ts +7 -0
  33. package/lib/models/bank/basiq/basiq-job.d.ts +3 -0
  34. package/lib/{services/http → models}/bank/basiq/basiq-token-response.interface.d.ts +0 -0
  35. package/lib/models/bank/{basiq-token.d.ts → basiq/basiq-token.d.ts} +0 -0
  36. package/lib/models/bank/basiq/index.d.ts +7 -0
  37. package/lib/models/bank/index.d.ts +13 -0
  38. package/lib/models/event/app-event-type.enum.d.ts +57 -56
  39. package/lib/models/index.d.ts +1 -0
  40. package/lib/services/http/bank/basiq/basiq-token.service.d.ts +1 -1
  41. package/lib/services/http/bank/basiq/basiq.service.d.ts +17 -3
  42. package/package.json +1 -1
  43. package/public-api.d.ts +1 -14
  44. package/esm2015/lib/models/bank/basiq-config.js +0 -12
  45. package/esm2015/lib/models/bank/basiq-job.js +0 -4
  46. package/esm2015/lib/models/bank/basiq-token.js +0 -13
  47. package/esm2015/lib/services/http/bank/basiq/basiq-connections-response.interface.js +0 -2
  48. package/esm2015/lib/services/http/bank/basiq/basiq-token-response.interface.js +0 -2
  49. package/lib/models/bank/basiq-job.d.ts +0 -3
@@ -4,21 +4,21 @@ 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';
7
- import { ReplaySubject, Subject, BehaviorSubject, throwError, Observable, combineLatest, forkJoin, of, from } from 'rxjs';
7
+ import { ReplaySubject, Subject, BehaviorSubject, throwError, Observable, of, combineLatest, forkJoin, from } from 'rxjs';
8
8
  import { map, filter, catchError, take, switchMap, finalize, mergeMap, skip, distinctUntilChanged } from 'rxjs/operators';
9
- import { plainToClass, classToPlain, Type, Exclude, Transform, Expose } from 'class-transformer';
9
+ import { plainToClass, classToPlain, Type, Transform, Expose, Exclude } from 'class-transformer';
10
10
  import { JwtHelperService } from '@auth0/angular-jwt';
11
- import { __decorate, __awaiter } from 'tslib';
12
11
  import get from 'lodash/get';
13
- import last from 'lodash/last';
14
12
  import flatten from 'lodash/flatten';
15
13
  import hasIn from 'lodash/hasIn';
16
14
  import first from 'lodash/first';
17
- import * as moment$1 from 'moment';
18
- import { DateRange, extendMoment } from 'moment-range';
15
+ import last from 'lodash/last';
19
16
  import uniqBy from 'lodash/uniqBy';
20
17
  import concat from 'lodash/concat';
21
18
  import { throwError as throwError$1 } from 'rxjs/internal/observable/throwError';
19
+ import { __decorate, __awaiter } from 'tslib';
20
+ import * as moment$1 from 'moment';
21
+ import { DateRange, extendMoment } from 'moment-range';
22
22
  import cloneDeep$1 from 'lodash/cloneDeep';
23
23
  import { EventSourcePolyfill } from 'event-source-polyfill/src/eventsource.min.js';
24
24
  import compact from 'lodash/compact';
@@ -207,62 +207,63 @@ var AppEventTypeEnum;
207
207
  AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONSENT_UPDATED"] = 5] = "BASIQ_CONSENT_UPDATED";
208
208
  AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONNECTION_UPDATED"] = 6] = "BASIQ_CONNECTION_UPDATED";
209
209
  AppEventTypeEnum[AppEventTypeEnum["BASIQ_JOB_CREATED"] = 7] = "BASIQ_JOB_CREATED";
210
- AppEventTypeEnum[AppEventTypeEnum["CLIENT_INVITE_ACCEPTED"] = 8] = "CLIENT_INVITE_ACCEPTED";
211
- AppEventTypeEnum[AppEventTypeEnum["CLIENT_OPEN_CHAT"] = 9] = "CLIENT_OPEN_CHAT";
212
- AppEventTypeEnum[AppEventTypeEnum["CLIENT_TRANSFER_TO_OTHER_EMPLOYEE"] = 10] = "CLIENT_TRANSFER_TO_OTHER_EMPLOYEE";
213
- AppEventTypeEnum[AppEventTypeEnum["CURRENT_USER_GET_FAILED"] = 11] = "CURRENT_USER_GET_FAILED";
214
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 12] = "DEPRECIATION_DELETED";
215
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 13] = "DEPRECIATIONS_CREATED";
216
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_RECEIPT"] = 14] = "DEPRECIATION_UPDATED_WITH_RECEIPT";
217
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT"] = 15] = "DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT";
218
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_CREATED"] = 16] = "DEPRECIATION_RECEIPT_CREATED";
219
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_DELETED"] = 17] = "DEPRECIATION_RECEIPT_DELETED";
220
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 18] = "INCOME_SOURCES_CREATED";
221
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 19] = "INCOME_SOURCES_UPDATED";
222
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 20] = "INCOME_SOURCES_FORECASTS_CREATED";
223
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 21] = "INCOME_SOURCES_FORECASTS_UPDATED";
224
- AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 22] = "LOAN_UPDATED";
225
- AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 23] = "LOAN_PAYOUT_UPDATED";
226
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 24] = "MESSAGE_CREATED";
227
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 25] = "MESSAGE_FILE_CREATED";
228
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 26] = "MESSAGE_FILE_DELETED";
229
- AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 27] = "NOTIFICATION_ADDED";
230
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DEPRECIATION_CALCULATION_UPDATED"] = 28] = "PROPERTY_DEPRECIATION_CALCULATION_UPDATED";
231
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED"] = 29] = "PROPERTY_UPDATED";
232
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 30] = "PROPERTY_UPDATED_WITH_DOCUMENT";
233
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 31] = "PROPERTY_DOCUMENT_ADDED";
234
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 32] = "PROPERTY_MOVEMENT_CREATED";
235
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 33] = "PROPERTY_MOVEMENT_UPDATED";
236
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 34] = "PROPERTY_MOVEMENT_DELETED";
237
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 35] = "PROPERTY_SHARE_UPDATED";
238
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 36] = "PROPERTY_SALE_ADDED";
239
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 37] = "PROPERTY_SALE_DELETED";
240
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 38] = "PROPERTY_SUBSCRIPTION_ADDED";
241
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 39] = "PROPERTY_SUBSCRIPTION_DELETED";
242
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 40] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
243
- AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 41] = "SERVICE_SUBSCRIPTION_UPDATED";
244
- AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 42] = "SOLE_BUSINESS_CREATED";
245
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 43] = "SOLE_DEPRECIATION_METHOD_UPDATED";
246
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 44] = "SOLE_DETAILS_CREATED";
247
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 45] = "SOLE_DETAILS_UPDATED";
248
- AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 46] = "TAX_REVIEW_UPDATED";
249
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 47] = "TRANSACTION_CREATED";
250
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 48] = "TRANSACTION_DELETED";
251
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 49] = "TRANSACTION_UPDATED";
252
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 50] = "TRANSACTION_UPDATED_WITH_RECEIPT";
253
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 51] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
254
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 52] = "TRANSACTION_RECEIPT_CREATED";
255
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 53] = "TRANSACTION_RECEIPT_DELETED";
256
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 54] = "TRANSACTIONS_CREATED";
257
- AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 55] = "USER_UPDATED";
258
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 56] = "VEHICLE_CLAIM_UPDATED";
259
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 57] = "VEHICLE_CLAIM_CREATED";
260
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 58] = "VEHICLE_CLAIM_DETAILS_UPDATED";
261
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 59] = "VEHICLE_CLAIM_DETAILS_CREATED";
262
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 60] = "VEHICLE_LOGBOOK_CREATED";
263
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 61] = "VEHICLE_LOGBOOK_UPDATED";
264
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 62] = "VEHICLE_LOGBOOK_DELETED";
265
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 63] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
210
+ AppEventTypeEnum[AppEventTypeEnum["BASIQ_LOGIN_FINISHED"] = 8] = "BASIQ_LOGIN_FINISHED";
211
+ AppEventTypeEnum[AppEventTypeEnum["CLIENT_INVITE_ACCEPTED"] = 9] = "CLIENT_INVITE_ACCEPTED";
212
+ AppEventTypeEnum[AppEventTypeEnum["CLIENT_OPEN_CHAT"] = 10] = "CLIENT_OPEN_CHAT";
213
+ AppEventTypeEnum[AppEventTypeEnum["CLIENT_TRANSFER_TO_OTHER_EMPLOYEE"] = 11] = "CLIENT_TRANSFER_TO_OTHER_EMPLOYEE";
214
+ AppEventTypeEnum[AppEventTypeEnum["CURRENT_USER_GET_FAILED"] = 12] = "CURRENT_USER_GET_FAILED";
215
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 13] = "DEPRECIATION_DELETED";
216
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 14] = "DEPRECIATIONS_CREATED";
217
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_RECEIPT"] = 15] = "DEPRECIATION_UPDATED_WITH_RECEIPT";
218
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT"] = 16] = "DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT";
219
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_CREATED"] = 17] = "DEPRECIATION_RECEIPT_CREATED";
220
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_DELETED"] = 18] = "DEPRECIATION_RECEIPT_DELETED";
221
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 19] = "INCOME_SOURCES_CREATED";
222
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 20] = "INCOME_SOURCES_UPDATED";
223
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 21] = "INCOME_SOURCES_FORECASTS_CREATED";
224
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 22] = "INCOME_SOURCES_FORECASTS_UPDATED";
225
+ AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 23] = "LOAN_UPDATED";
226
+ AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 24] = "LOAN_PAYOUT_UPDATED";
227
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 25] = "MESSAGE_CREATED";
228
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 26] = "MESSAGE_FILE_CREATED";
229
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 27] = "MESSAGE_FILE_DELETED";
230
+ AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 28] = "NOTIFICATION_ADDED";
231
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DEPRECIATION_CALCULATION_UPDATED"] = 29] = "PROPERTY_DEPRECIATION_CALCULATION_UPDATED";
232
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED"] = 30] = "PROPERTY_UPDATED";
233
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 31] = "PROPERTY_UPDATED_WITH_DOCUMENT";
234
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 32] = "PROPERTY_DOCUMENT_ADDED";
235
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 33] = "PROPERTY_MOVEMENT_CREATED";
236
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 34] = "PROPERTY_MOVEMENT_UPDATED";
237
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 35] = "PROPERTY_MOVEMENT_DELETED";
238
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 36] = "PROPERTY_SHARE_UPDATED";
239
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 37] = "PROPERTY_SALE_ADDED";
240
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 38] = "PROPERTY_SALE_DELETED";
241
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 39] = "PROPERTY_SUBSCRIPTION_ADDED";
242
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 40] = "PROPERTY_SUBSCRIPTION_DELETED";
243
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 41] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
244
+ AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 42] = "SERVICE_SUBSCRIPTION_UPDATED";
245
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 43] = "SOLE_BUSINESS_CREATED";
246
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 44] = "SOLE_DEPRECIATION_METHOD_UPDATED";
247
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 45] = "SOLE_DETAILS_CREATED";
248
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 46] = "SOLE_DETAILS_UPDATED";
249
+ AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 47] = "TAX_REVIEW_UPDATED";
250
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 48] = "TRANSACTION_CREATED";
251
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 49] = "TRANSACTION_DELETED";
252
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 50] = "TRANSACTION_UPDATED";
253
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 51] = "TRANSACTION_UPDATED_WITH_RECEIPT";
254
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 52] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
255
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 53] = "TRANSACTION_RECEIPT_CREATED";
256
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 54] = "TRANSACTION_RECEIPT_DELETED";
257
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 55] = "TRANSACTIONS_CREATED";
258
+ AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 56] = "USER_UPDATED";
259
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 57] = "VEHICLE_CLAIM_UPDATED";
260
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 58] = "VEHICLE_CLAIM_CREATED";
261
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 59] = "VEHICLE_CLAIM_DETAILS_UPDATED";
262
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 60] = "VEHICLE_CLAIM_DETAILS_CREATED";
263
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 61] = "VEHICLE_LOGBOOK_CREATED";
264
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 62] = "VEHICLE_LOGBOOK_UPDATED";
265
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 63] = "VEHICLE_LOGBOOK_DELETED";
266
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 64] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
266
267
  })(AppEventTypeEnum || (AppEventTypeEnum = {}));
267
268
 
268
269
  class EventDispatcherService {
@@ -1145,122 +1146,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
1145
1146
  args: ['environment']
1146
1147
  }] }, { type: ToastService }]; } });
1147
1148
 
1148
- class AbstractModel {
1149
- hasValue(value, path = 'id') {
1150
- return get(path) === value;
1151
- }
1152
- }
1153
-
1154
- class BankAccount$1 extends AbstractModel {
1155
- }
1156
-
1157
- var BankAccountTypeEnum;
1158
- (function (BankAccountTypeEnum) {
1159
- BankAccountTypeEnum[BankAccountTypeEnum["TRANSACTION"] = 1] = "TRANSACTION";
1160
- BankAccountTypeEnum[BankAccountTypeEnum["SAVINGS"] = 2] = "SAVINGS";
1161
- BankAccountTypeEnum[BankAccountTypeEnum["CREDIT_CARD"] = 3] = "CREDIT_CARD";
1162
- // @TODO Alex: should be removed by backend (TT-2107)
1163
- // MORTGAGE = 4,
1164
- BankAccountTypeEnum[BankAccountTypeEnum["LOAN"] = 5] = "LOAN";
1165
- BankAccountTypeEnum[BankAccountTypeEnum["INVESTMENT"] = 6] = "INVESTMENT";
1166
- BankAccountTypeEnum[BankAccountTypeEnum["TERM_DEPOSIT"] = 7] = "TERM_DEPOSIT";
1167
- BankAccountTypeEnum[BankAccountTypeEnum["OFFSET"] = 10] = "OFFSET";
1168
- })(BankAccountTypeEnum || (BankAccountTypeEnum = {}));
1169
-
1170
- var BankAccountStatusEnum;
1171
- (function (BankAccountStatusEnum) {
1172
- BankAccountStatusEnum[BankAccountStatusEnum["INACTIVE"] = 0] = "INACTIVE";
1173
- BankAccountStatusEnum[BankAccountStatusEnum["ACTIVE"] = 1] = "ACTIVE";
1174
- })(BankAccountStatusEnum || (BankAccountStatusEnum = {}));
1175
-
1176
- class Loan$1 extends AbstractModel {
1177
- }
1178
-
1179
- var LoanVehicleTypeEnum;
1180
- (function (LoanVehicleTypeEnum) {
1181
- LoanVehicleTypeEnum[LoanVehicleTypeEnum["AUTO_LOAN"] = 6] = "AUTO_LOAN";
1182
- LoanVehicleTypeEnum[LoanVehicleTypeEnum["CHATTEL_MORTGAGE"] = 9] = "CHATTEL_MORTGAGE";
1183
- LoanVehicleTypeEnum[LoanVehicleTypeEnum["COMMERCIAL_HIRE_PURCHASE"] = 10] = "COMMERCIAL_HIRE_PURCHASE";
1184
- })(LoanVehicleTypeEnum || (LoanVehicleTypeEnum = {}));
1185
-
1186
- // @Todo no base model from backend list
1187
- /**
1188
- * Loan payment class
1189
- */
1190
- class LoanPayment extends AbstractModel {
1191
- }
1192
- __decorate([
1193
- Type(() => Date)
1194
- ], LoanPayment.prototype, "date", void 0);
1195
-
1196
- class LoanPayout$1 extends AbstractModel {
1197
- }
1198
-
1199
- var LoanPayoutTypeEnum;
1200
- (function (LoanPayoutTypeEnum) {
1201
- LoanPayoutTypeEnum[LoanPayoutTypeEnum["REFINANCE"] = 1] = "REFINANCE";
1202
- LoanPayoutTypeEnum[LoanPayoutTypeEnum["PAYOUT"] = 2] = "PAYOUT";
1203
- })(LoanPayoutTypeEnum || (LoanPayoutTypeEnum = {}));
1204
-
1205
- class LoanPayout extends LoanPayout$1 {
1206
- /**
1207
- * Check if payout type is refinance
1208
- */
1209
- isRefinance() {
1210
- return this.type === LoanPayoutTypeEnum.REFINANCE;
1211
- }
1212
- }
1213
-
1214
- class FinancialYear {
1215
- constructor(date) {
1216
- this.yearStartDate = '-07-01';
1217
- this.yearEndDate = '-06-30';
1218
- if (date) {
1219
- this.year = date instanceof Date ? FinancialYear.toFinYear(date) : date;
1220
- }
1221
- else {
1222
- this.year = +localStorage.getItem('financialYear') || FinancialYear.toFinYear(new Date());
1223
- }
1224
- this.setStartDate(this.year);
1225
- this.setEndDate(this.year);
1226
- }
1227
- includes(date) {
1228
- return this.year === new FinancialYear(date).year;
1229
- }
1230
- static toFinYear(date) {
1231
- return date.getFullYear() + (date.getMonth() >= this.startMonthIndex ? 1 : 0);
1232
- }
1233
- get prevFinYear() {
1234
- return new FinancialYear(new Date(`${new Date().getFullYear() - 1}${this.yearStartDate}`));
1235
- }
1236
- /**
1237
- * Get date by desired month
1238
- */
1239
- getMonthDate(monthIndex) {
1240
- if (monthIndex >= FinancialYear.startMonthIndex) {
1241
- return new Date(`${this.year - 1}-${monthIndex + 1}-01`);
1242
- }
1243
- return new Date(`${this.year}-${monthIndex + 1}-01`);
1244
- }
1245
- setStartDate(year) {
1246
- this.startDate = new Date(`${year - 1}${this.yearStartDate}`);
1247
- }
1248
- setEndDate(year) {
1249
- this.endDate = new Date(`${year}${this.yearEndDate}`);
1250
- }
1251
- getPastMonths() {
1252
- const months = [];
1253
- const now = new Date();
1254
- const endDate = this.endDate < now ? this.endDate : now;
1255
- for (const d = this.startDate; d <= endDate; d.setMonth(d.getMonth() + 1)) {
1256
- months.push(d.getMonth());
1257
- }
1258
- return months;
1259
- }
1260
- }
1261
- FinancialYear.weeksInYear = 52;
1262
- FinancialYear.startMonthIndex = 6;
1263
-
1264
1149
  /**
1265
1150
  * List of collections grouped by passed property
1266
1151
  */
@@ -1484,105 +1369,512 @@ class Collection {
1484
1369
  }
1485
1370
  }
1486
1371
 
1487
- class ExportDataTable {
1488
- }
1489
-
1490
- class ExportableCollection extends Collection {
1491
- getExportFooter(type) {
1492
- return [];
1493
- }
1494
- ;
1495
- export(type) {
1496
- return plainToClass(ExportDataTable, {
1497
- header: this.getExportHeader(type),
1498
- body: this.getExportBody(type),
1499
- footer: [this.getExportFooter(type)]
1500
- });
1501
- }
1502
- }
1372
+ var BankAccountTypeEnum;
1373
+ (function (BankAccountTypeEnum) {
1374
+ BankAccountTypeEnum[BankAccountTypeEnum["TRANSACTION"] = 1] = "TRANSACTION";
1375
+ BankAccountTypeEnum[BankAccountTypeEnum["SAVINGS"] = 2] = "SAVINGS";
1376
+ BankAccountTypeEnum[BankAccountTypeEnum["CREDIT_CARD"] = 3] = "CREDIT_CARD";
1377
+ // @TODO Alex: should be removed by backend (TT-2107)
1378
+ // MORTGAGE = 4,
1379
+ BankAccountTypeEnum[BankAccountTypeEnum["LOAN"] = 5] = "LOAN";
1380
+ BankAccountTypeEnum[BankAccountTypeEnum["INVESTMENT"] = 6] = "INVESTMENT";
1381
+ BankAccountTypeEnum[BankAccountTypeEnum["TERM_DEPOSIT"] = 7] = "TERM_DEPOSIT";
1382
+ BankAccountTypeEnum[BankAccountTypeEnum["OFFSET"] = 10] = "OFFSET";
1383
+ })(BankAccountTypeEnum || (BankAccountTypeEnum = {}));
1503
1384
 
1504
- /**
1505
- * export table column
1506
- */
1507
- class ExportCell {
1508
- }
1385
+ const TYPE_LOAN = [
1386
+ BankAccountTypeEnum.CREDIT_CARD,
1387
+ BankAccountTypeEnum.LOAN
1388
+ ];
1509
1389
 
1510
1390
  /**
1511
- * type of export table column value
1391
+ * Collection of bank accounts.
1512
1392
  */
1513
- var ExportCellTypeEnum;
1514
- (function (ExportCellTypeEnum) {
1515
- ExportCellTypeEnum[ExportCellTypeEnum["STRING"] = 0] = "STRING";
1516
- ExportCellTypeEnum[ExportCellTypeEnum["CURRENCY"] = 1] = "CURRENCY";
1517
- ExportCellTypeEnum[ExportCellTypeEnum["DATE"] = 2] = "DATE";
1518
- })(ExportCellTypeEnum || (ExportCellTypeEnum = {}));
1519
-
1520
- class LoanPaymentCollection extends ExportableCollection {
1521
- getExportHeader() {
1522
- return [
1523
- 'Pmt No.',
1524
- 'Date',
1525
- 'Payment Due',
1526
- 'Interest Accrued',
1527
- 'Principal Paid',
1528
- 'Principal Balance',
1529
- 'Payout'
1530
- ];
1531
- }
1532
- getExportBody() {
1533
- return this.items.map((payment) => {
1534
- return [
1535
- plainToClass(ExportCell, { value: payment.number, type: ExportCellTypeEnum.STRING }),
1536
- plainToClass(ExportCell, { value: payment.date, type: ExportCellTypeEnum.DATE }),
1537
- plainToClass(ExportCell, { value: payment.paymentDue, type: ExportCellTypeEnum.CURRENCY }),
1538
- plainToClass(ExportCell, { value: payment.interestAccrued, type: ExportCellTypeEnum.CURRENCY }),
1539
- plainToClass(ExportCell, { value: payment.principalPaid, type: ExportCellTypeEnum.CURRENCY }),
1540
- plainToClass(ExportCell, { value: payment.principalBalance, type: ExportCellTypeEnum.CURRENCY }),
1541
- plainToClass(ExportCell, { value: payment.payout, type: ExportCellTypeEnum.CURRENCY }),
1542
- ];
1543
- });
1544
- }
1545
- get paymentDue() {
1546
- return this.sumBy('paymentDue');
1547
- }
1548
- getByFinYear(finYear = new FinancialYear()) {
1549
- return this.filter((payment) => {
1550
- return new Date(payment.date) >= finYear.startDate &&
1551
- new Date(payment.date) <= finYear.endDate;
1393
+ class BankAccountCollection extends Collection {
1394
+ /**
1395
+ * get list of bank accounts with passed types
1396
+ */
1397
+ getByType(types, isExclude = false) {
1398
+ // get types always as array (if only one passed)
1399
+ const typesArray = concat(types);
1400
+ return this.items.filter((bankAccount) => {
1401
+ if (isExclude) {
1402
+ return !typesArray.includes(bankAccount.type);
1403
+ }
1404
+ return typesArray.includes(bankAccount.type);
1552
1405
  });
1553
1406
  }
1554
- getForCurrentYear() {
1555
- return this.getByFinYear(new FinancialYear());
1556
- }
1557
- }
1558
-
1559
- class Loan extends Loan$1 {
1560
1407
  /**
1561
- * Check if loan type is related to LoanVehicleTypeEnum
1408
+ * get amount of initial loans
1562
1409
  */
1563
- isVehicle() {
1564
- return !this.bankAccount && this.type in LoanVehicleTypeEnum;
1410
+ getInitialLoanAmount() {
1411
+ return this.getByType(TYPE_LOAN)
1412
+ .reduce((sum, bankAccount) => {
1413
+ return sum += bankAccount.balances.length ? bankAccount.getOpeningBalance() : 0;
1414
+ }, 0);
1565
1415
  }
1566
1416
  /**
1567
- * Get the last payment for passed financial year
1568
- * @param year financial year for filter
1417
+ * get amount of current loans
1569
1418
  */
1570
- getLastPaymentByYear(year) {
1571
- const finYear = new FinancialYear(new Date(year.toString()));
1572
- return last(this.payments.filter((payment) => payment.date > finYear.startDate && payment.date < finYear.endDate));
1419
+ getCurrentLoanAmount() {
1420
+ return this.getByType(TYPE_LOAN)
1421
+ .reduce((sum, bankAccount) => {
1422
+ return sum += bankAccount.currentBalance;
1423
+ }, 0);
1573
1424
  }
1574
1425
  /**
1575
- * The size of loan interest
1576
- * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/212369955/Loans+vehicle+loans
1577
- * @TODO Vik/Nicole: need to update documentation. Derek gave the right formulas to Mikhail
1426
+ * get collection filtered by property id
1578
1427
  */
1579
- getInterest() {
1580
- return new LoanPaymentCollection(this.payments).paymentDue - this.amount;
1428
+ getByPropertyId(id) {
1429
+ return new BankAccountCollection(this.items.filter((bankAccount) => {
1430
+ return bankAccount.bankAccountProperties.find((bankAccountProperty) => {
1431
+ return bankAccountProperty.property.id === id;
1432
+ });
1433
+ }));
1581
1434
  }
1582
1435
  /**
1583
- * The last payment size
1584
- * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/212369955/Loans+vehicle+loans
1585
- * @TODO Vik/Nicole: need to update documentation. Derek gave the right formulas to Mikhail
1436
+ * get collection filtered by properties ids
1437
+ */
1438
+ getByPropertiesIds(ids) {
1439
+ return new BankAccountCollection(this.items.filter((bankAccount) => {
1440
+ return bankAccount.bankAccountProperties.find((bankAccountProperty) => {
1441
+ return ids.includes(bankAccountProperty.property.id);
1442
+ });
1443
+ }));
1444
+ }
1445
+ /**
1446
+ * get collection of active bank accounts
1447
+ */
1448
+ getActiveBankAccounts() {
1449
+ return new BankAccountCollection(this.items.filter((bankAccount) => {
1450
+ return bankAccount.isActive();
1451
+ }));
1452
+ }
1453
+ /**
1454
+ * get reduction of loan (reduction of principle) percentage
1455
+ */
1456
+ getPrincipleReductionPercent() {
1457
+ const initialLoans = this.getInitialLoanAmount();
1458
+ const currentLoans = this.getCurrentLoanAmount();
1459
+ if (!initialLoans) {
1460
+ return 0;
1461
+ }
1462
+ return (initialLoans - currentLoans) / initialLoans * 100;
1463
+ }
1464
+ /**
1465
+ * Get collection of loan bank accounts
1466
+ */
1467
+ getLoanAccounts() {
1468
+ return new BankAccountCollection(this.getByType(TYPE_LOAN));
1469
+ }
1470
+ getSavingsAccounts() {
1471
+ return new BankAccountCollection(this.getByType(TYPE_LOAN, true));
1472
+ }
1473
+ getOpeningBalance() {
1474
+ return this.items.reduce((sum, bankAccount) => sum + bankAccount.getOpeningBalance(), 0);
1475
+ }
1476
+ get currentBalance() {
1477
+ return this.sumBy('currentBalance');
1478
+ }
1479
+ /**
1480
+ * Get Collection of bank accounts with property tank type
1481
+ */
1482
+ getPropertyBankAccounts() {
1483
+ return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.isPropertyTank()));
1484
+ }
1485
+ /**
1486
+ * Get Collection of bank accounts with work tank type
1487
+ */
1488
+ getWorkBankAccounts() {
1489
+ return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.isWorkTank()));
1490
+ }
1491
+ /**
1492
+ * Get Collection of bank accounts by tank type
1493
+ */
1494
+ getByTankType(tankType) {
1495
+ return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.tankType === tankType));
1496
+ }
1497
+ /**
1498
+ * Get list of all bank account properties
1499
+ */
1500
+ getBankAccountPropertiesList() {
1501
+ return flatten(this.items.map((bankAccount) => {
1502
+ return bankAccount.bankAccountProperties;
1503
+ }));
1504
+ }
1505
+ /**
1506
+ * Get lis of unique properties from all bank accounts properties
1507
+ */
1508
+ getProperties() {
1509
+ return uniqBy(this.getBankAccountPropertiesList().map((bankAccountProperty) => {
1510
+ return bankAccountProperty.property;
1511
+ }), 'id');
1512
+ }
1513
+ getPropertyBalanceAmount(propertyId) {
1514
+ return this.items.reduce((sum, bankAccount) => {
1515
+ return sum + bankAccount.getPropertyBalanceAmount(propertyId);
1516
+ }, 0);
1517
+ }
1518
+ }
1519
+
1520
+ var UserEventTypeTypeEnum;
1521
+ (function (UserEventTypeTypeEnum) {
1522
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTERED"] = 1000] = "REGISTERED";
1523
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PASSWORD_RESET_REQUEST"] = 1001] = "PASSWORD_RESET_REQUEST";
1524
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["APP_FEATURES"] = 1010] = "APP_FEATURES";
1525
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
1526
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
1527
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
1528
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
1529
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_PAYMENT_FAILED"] = 2006] = "SUBSCRIPTION_PAYMENT_FAILED";
1530
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
1531
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
1532
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
1533
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
1534
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
1535
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
1536
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
1537
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
1538
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
1539
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
1540
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
1541
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
1542
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
1543
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_SUBSCRIBED"] = 2028] = "OWNER_SUBSCRIBED";
1544
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_UNSUBSCRIBED"] = 2029] = "OWNER_UNSUBSCRIBED";
1545
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
1546
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
1547
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
1548
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
1549
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
1550
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
1551
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_EMAIL_CONFIRMED"] = 2050] = "CLIENT_EMAIL_CONFIRMED";
1552
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
1553
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_TO_REGISTER"] = 3000] = "FIRM_INVITE_TO_REGISTER";
1554
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE"] = 3001] = "FIRM_INVITE";
1555
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_ACCEPTED"] = 3002] = "CLIENT_INVITE_ACCEPTED";
1556
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REJECTED"] = 3003] = "CLIENT_INVITE_REJECTED";
1557
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REGISTERED"] = 3004] = "CLIENT_INVITE_REGISTERED";
1558
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_NEW_CLIENT"] = 3005] = "FIRM_NEW_CLIENT";
1559
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_LOST_CLIENT"] = 3006] = "FIRM_LOST_CLIENT";
1560
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE"] = 3010] = "EMPLOYEE_INVITE";
1561
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_LOST_CLIENT"] = 3011] = "EMPLOYEE_LOST_CLIENT";
1562
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_NEW_CLIENT"] = 3012] = "EMPLOYEE_NEW_CLIENT";
1563
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE_ACCEPTED"] = 3013] = "EMPLOYEE_INVITE_ACCEPTED";
1564
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_EMAIL_CONFIRMED"] = 3020] = "EMPLOYEE_EMAIL_CONFIRMED";
1565
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_RECEIVED"] = 3030] = "TAX_REVIEW_RECEIVED";
1566
+ })(UserEventTypeTypeEnum || (UserEventTypeTypeEnum = {}));
1567
+
1568
+ /**
1569
+ * any event happened in the app, which needs to be handled somehow (distributed to other part of the app)
1570
+ */
1571
+ class AppEvent {
1572
+ constructor(type, payload) {
1573
+ this.type = type;
1574
+ this.payload = payload;
1575
+ }
1576
+ }
1577
+
1578
+ /**
1579
+ * Class describe configuration options for basiq connect control
1580
+ * https://www.npmjs.com/package/@basiq/basiq-connect-control
1581
+ */
1582
+ class BasiqConfig {
1583
+ constructor(options) {
1584
+ // ID of the DOM element to which Basiq Connect Control will be rendered;
1585
+ this.containerId = 'basiq-control';
1586
+ Object.assign(this, options);
1587
+ }
1588
+ }
1589
+
1590
+ class AbstractModel {
1591
+ hasValue(value, path = 'id') {
1592
+ return get(path) === value;
1593
+ }
1594
+ }
1595
+
1596
+ class BasiqJob$1 extends AbstractModel {
1597
+ }
1598
+
1599
+ class BasiqJob extends BasiqJob$1 {
1600
+ }
1601
+
1602
+ class BasiqJobStep {
1603
+ isVerifyCredentials() {
1604
+ return this.title === 'verify-credentials';
1605
+ }
1606
+ isInProgress() {
1607
+ return this.status === 'in-progress';
1608
+ }
1609
+ isSuccess() {
1610
+ return this.status === 'success';
1611
+ }
1612
+ }
1613
+
1614
+ class BasiqJobResponse {
1615
+ getVerifyCredentialsStep() {
1616
+ return this.steps.find((step) => step.isVerifyCredentials());
1617
+ }
1618
+ }
1619
+ __decorate([
1620
+ Type(() => BasiqJobStep)
1621
+ ], BasiqJobResponse.prototype, "steps", void 0);
1622
+
1623
+ /**
1624
+ * access token, needed to access basiq connect ui (https://github.com/basiqio/basiq-connect-ui)
1625
+ */
1626
+ class BasiqToken {
1627
+ constructor(value, expiresAt) {
1628
+ this.value = value;
1629
+ this.expiresAt = expiresAt;
1630
+ }
1631
+ isExpired() {
1632
+ return this.expiresAt < new Date();
1633
+ }
1634
+ }
1635
+
1636
+ class Bank$1 extends AbstractModel {
1637
+ }
1638
+
1639
+ var BankPopularEnum;
1640
+ (function (BankPopularEnum) {
1641
+ BankPopularEnum["BANKWEST"] = "Bank of Western Australia trading as BankWest";
1642
+ BankPopularEnum["ANZ"] = "Australia and New Zealand Banking Group Limited";
1643
+ BankPopularEnum["CBA"] = "Commonwealth Bank Australia";
1644
+ BankPopularEnum["WESTPAC"] = "Westpac Banking Corporation";
1645
+ BankPopularEnum["BENDIGO"] = "Bendigo and Adelaide Bank Limited";
1646
+ BankPopularEnum["ING_DIRECT"] = "ING Bank (Australia) Limited (trading as ING Direct)";
1647
+ BankPopularEnum["ST_GEORGE"] = "St. George Bank (a subsidiary of Westpac)";
1648
+ BankPopularEnum["SUNCORP"] = "Suncorp-Metway Limited";
1649
+ BankPopularEnum["CITIBANK"] = "Citibank";
1650
+ BankPopularEnum["BOQ"] = "Bank of Queensland Limited";
1651
+ })(BankPopularEnum || (BankPopularEnum = {}));
1652
+
1653
+ /**
1654
+ * Bank subclass, average bank response time for some operations in milliseconds
1655
+ * Used for basiq banks functionality to improve bank login UI/UX (loading progress)
1656
+ */
1657
+ class BankExternalStats {
1658
+ }
1659
+
1660
+ class Bank extends Bank$1 {
1661
+ getPhotoPlaceholder() {
1662
+ return this.name[0] + this.name[1];
1663
+ }
1664
+ getPhoto() {
1665
+ if (!this.logo) {
1666
+ return null;
1667
+ }
1668
+ return this.logo.includes('http') ? `${this.logo}` : `${localStorage.getItem('api_uri')}/${this.logo}`;
1669
+ }
1670
+ }
1671
+ __decorate([
1672
+ Transform(({ value }) => value ? value.replace(' ', '%20') : null)
1673
+ ], Bank.prototype, "logo", void 0);
1674
+ __decorate([
1675
+ Transform(({ obj }) => Object.values(BankPopularEnum).includes(obj.name)),
1676
+ Expose()
1677
+ ], Bank.prototype, "isPopular", void 0);
1678
+ __decorate([
1679
+ Type(() => BankExternalStats)
1680
+ ], Bank.prototype, "externalStats", void 0);
1681
+
1682
+ class BankAccount$1 extends AbstractModel {
1683
+ }
1684
+
1685
+ var BankAccountStatusEnum;
1686
+ (function (BankAccountStatusEnum) {
1687
+ BankAccountStatusEnum[BankAccountStatusEnum["INACTIVE"] = 0] = "INACTIVE";
1688
+ BankAccountStatusEnum[BankAccountStatusEnum["ACTIVE"] = 1] = "ACTIVE";
1689
+ })(BankAccountStatusEnum || (BankAccountStatusEnum = {}));
1690
+
1691
+ class Loan$1 extends AbstractModel {
1692
+ }
1693
+
1694
+ var LoanVehicleTypeEnum;
1695
+ (function (LoanVehicleTypeEnum) {
1696
+ LoanVehicleTypeEnum[LoanVehicleTypeEnum["AUTO_LOAN"] = 6] = "AUTO_LOAN";
1697
+ LoanVehicleTypeEnum[LoanVehicleTypeEnum["CHATTEL_MORTGAGE"] = 9] = "CHATTEL_MORTGAGE";
1698
+ LoanVehicleTypeEnum[LoanVehicleTypeEnum["COMMERCIAL_HIRE_PURCHASE"] = 10] = "COMMERCIAL_HIRE_PURCHASE";
1699
+ })(LoanVehicleTypeEnum || (LoanVehicleTypeEnum = {}));
1700
+
1701
+ // @Todo no base model from backend list
1702
+ /**
1703
+ * Loan payment class
1704
+ */
1705
+ class LoanPayment extends AbstractModel {
1706
+ }
1707
+ __decorate([
1708
+ Type(() => Date)
1709
+ ], LoanPayment.prototype, "date", void 0);
1710
+
1711
+ class LoanPayout$1 extends AbstractModel {
1712
+ }
1713
+
1714
+ var LoanPayoutTypeEnum;
1715
+ (function (LoanPayoutTypeEnum) {
1716
+ LoanPayoutTypeEnum[LoanPayoutTypeEnum["REFINANCE"] = 1] = "REFINANCE";
1717
+ LoanPayoutTypeEnum[LoanPayoutTypeEnum["PAYOUT"] = 2] = "PAYOUT";
1718
+ })(LoanPayoutTypeEnum || (LoanPayoutTypeEnum = {}));
1719
+
1720
+ class LoanPayout extends LoanPayout$1 {
1721
+ /**
1722
+ * Check if payout type is refinance
1723
+ */
1724
+ isRefinance() {
1725
+ return this.type === LoanPayoutTypeEnum.REFINANCE;
1726
+ }
1727
+ }
1728
+
1729
+ class FinancialYear {
1730
+ constructor(date) {
1731
+ this.yearStartDate = '-07-01';
1732
+ this.yearEndDate = '-06-30';
1733
+ if (date) {
1734
+ this.year = date instanceof Date ? FinancialYear.toFinYear(date) : date;
1735
+ }
1736
+ else {
1737
+ this.year = +localStorage.getItem('financialYear') || FinancialYear.toFinYear(new Date());
1738
+ }
1739
+ this.setStartDate(this.year);
1740
+ this.setEndDate(this.year);
1741
+ }
1742
+ includes(date) {
1743
+ return this.year === new FinancialYear(date).year;
1744
+ }
1745
+ static toFinYear(date) {
1746
+ return date.getFullYear() + (date.getMonth() >= this.startMonthIndex ? 1 : 0);
1747
+ }
1748
+ get prevFinYear() {
1749
+ return new FinancialYear(new Date(`${new Date().getFullYear() - 1}${this.yearStartDate}`));
1750
+ }
1751
+ /**
1752
+ * Get date by desired month
1753
+ */
1754
+ getMonthDate(monthIndex) {
1755
+ if (monthIndex >= FinancialYear.startMonthIndex) {
1756
+ return new Date(`${this.year - 1}-${monthIndex + 1}-01`);
1757
+ }
1758
+ return new Date(`${this.year}-${monthIndex + 1}-01`);
1759
+ }
1760
+ setStartDate(year) {
1761
+ this.startDate = new Date(`${year - 1}${this.yearStartDate}`);
1762
+ }
1763
+ setEndDate(year) {
1764
+ this.endDate = new Date(`${year}${this.yearEndDate}`);
1765
+ }
1766
+ getPastMonths() {
1767
+ const months = [];
1768
+ const now = new Date();
1769
+ const endDate = this.endDate < now ? this.endDate : now;
1770
+ for (const d = this.startDate; d <= endDate; d.setMonth(d.getMonth() + 1)) {
1771
+ months.push(d.getMonth());
1772
+ }
1773
+ return months;
1774
+ }
1775
+ }
1776
+ FinancialYear.weeksInYear = 52;
1777
+ FinancialYear.startMonthIndex = 6;
1778
+
1779
+ class ExportDataTable {
1780
+ }
1781
+
1782
+ class ExportableCollection extends Collection {
1783
+ getExportFooter(type) {
1784
+ return [];
1785
+ }
1786
+ ;
1787
+ export(type) {
1788
+ return plainToClass(ExportDataTable, {
1789
+ header: this.getExportHeader(type),
1790
+ body: this.getExportBody(type),
1791
+ footer: [this.getExportFooter(type)]
1792
+ });
1793
+ }
1794
+ }
1795
+
1796
+ /**
1797
+ * export table column
1798
+ */
1799
+ class ExportCell {
1800
+ }
1801
+
1802
+ /**
1803
+ * type of export table column value
1804
+ */
1805
+ var ExportCellTypeEnum;
1806
+ (function (ExportCellTypeEnum) {
1807
+ ExportCellTypeEnum[ExportCellTypeEnum["STRING"] = 0] = "STRING";
1808
+ ExportCellTypeEnum[ExportCellTypeEnum["CURRENCY"] = 1] = "CURRENCY";
1809
+ ExportCellTypeEnum[ExportCellTypeEnum["DATE"] = 2] = "DATE";
1810
+ })(ExportCellTypeEnum || (ExportCellTypeEnum = {}));
1811
+
1812
+ class LoanPaymentCollection extends ExportableCollection {
1813
+ getExportHeader() {
1814
+ return [
1815
+ 'Pmt No.',
1816
+ 'Date',
1817
+ 'Payment Due',
1818
+ 'Interest Accrued',
1819
+ 'Principal Paid',
1820
+ 'Principal Balance',
1821
+ 'Payout'
1822
+ ];
1823
+ }
1824
+ getExportBody() {
1825
+ return this.items.map((payment) => {
1826
+ return [
1827
+ plainToClass(ExportCell, { value: payment.number, type: ExportCellTypeEnum.STRING }),
1828
+ plainToClass(ExportCell, { value: payment.date, type: ExportCellTypeEnum.DATE }),
1829
+ plainToClass(ExportCell, { value: payment.paymentDue, type: ExportCellTypeEnum.CURRENCY }),
1830
+ plainToClass(ExportCell, { value: payment.interestAccrued, type: ExportCellTypeEnum.CURRENCY }),
1831
+ plainToClass(ExportCell, { value: payment.principalPaid, type: ExportCellTypeEnum.CURRENCY }),
1832
+ plainToClass(ExportCell, { value: payment.principalBalance, type: ExportCellTypeEnum.CURRENCY }),
1833
+ plainToClass(ExportCell, { value: payment.payout, type: ExportCellTypeEnum.CURRENCY }),
1834
+ ];
1835
+ });
1836
+ }
1837
+ get paymentDue() {
1838
+ return this.sumBy('paymentDue');
1839
+ }
1840
+ getByFinYear(finYear = new FinancialYear()) {
1841
+ return this.filter((payment) => {
1842
+ return new Date(payment.date) >= finYear.startDate &&
1843
+ new Date(payment.date) <= finYear.endDate;
1844
+ });
1845
+ }
1846
+ getForCurrentYear() {
1847
+ return this.getByFinYear(new FinancialYear());
1848
+ }
1849
+ }
1850
+
1851
+ class Loan extends Loan$1 {
1852
+ /**
1853
+ * Check if loan type is related to LoanVehicleTypeEnum
1854
+ */
1855
+ isVehicle() {
1856
+ return !this.bankAccount && this.type in LoanVehicleTypeEnum;
1857
+ }
1858
+ /**
1859
+ * Get the last payment for passed financial year
1860
+ * @param year financial year for filter
1861
+ */
1862
+ getLastPaymentByYear(year) {
1863
+ const finYear = new FinancialYear(new Date(year.toString()));
1864
+ return last(this.payments.filter((payment) => payment.date > finYear.startDate && payment.date < finYear.endDate));
1865
+ }
1866
+ /**
1867
+ * The size of loan interest
1868
+ * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/212369955/Loans+vehicle+loans
1869
+ * @TODO Vik/Nicole: need to update documentation. Derek gave the right formulas to Mikhail
1870
+ */
1871
+ getInterest() {
1872
+ return new LoanPaymentCollection(this.payments).paymentDue - this.amount;
1873
+ }
1874
+ /**
1875
+ * The last payment size
1876
+ * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/212369955/Loans+vehicle+loans
1877
+ * @TODO Vik/Nicole: need to update documentation. Derek gave the right formulas to Mikhail
1586
1878
  */
1587
1879
  getBalloonPayment() {
1588
1880
  const lastPaymentDueAmount = new LoanPaymentCollection(this.payments).last.paymentDue;
@@ -4328,48 +4620,6 @@ __decorate([
4328
4620
  class BankConnection$1 extends AbstractModel {
4329
4621
  }
4330
4622
 
4331
- class BasiqJob$1 extends AbstractModel {
4332
- }
4333
-
4334
- class BasiqJob extends BasiqJob$1 {
4335
- }
4336
-
4337
- class Bank$1 extends AbstractModel {
4338
- }
4339
-
4340
- var BankPopularEnum;
4341
- (function (BankPopularEnum) {
4342
- BankPopularEnum["BANKWEST"] = "Bank of Western Australia trading as BankWest";
4343
- BankPopularEnum["ANZ"] = "Australia and New Zealand Banking Group Limited";
4344
- BankPopularEnum["CBA"] = "Commonwealth Bank Australia";
4345
- BankPopularEnum["WESTPAC"] = "Westpac Banking Corporation";
4346
- BankPopularEnum["BENDIGO"] = "Bendigo and Adelaide Bank Limited";
4347
- BankPopularEnum["ING_DIRECT"] = "ING Bank (Australia) Limited (trading as ING Direct)";
4348
- BankPopularEnum["ST_GEORGE"] = "St. George Bank (a subsidiary of Westpac)";
4349
- BankPopularEnum["SUNCORP"] = "Suncorp-Metway Limited";
4350
- BankPopularEnum["CITIBANK"] = "Citibank";
4351
- BankPopularEnum["BOQ"] = "Bank of Queensland Limited";
4352
- })(BankPopularEnum || (BankPopularEnum = {}));
4353
-
4354
- class Bank extends Bank$1 {
4355
- getPhotoPlaceholder() {
4356
- return this.name[0] + this.name[1];
4357
- }
4358
- getPhoto() {
4359
- if (!this.logo) {
4360
- return null;
4361
- }
4362
- return this.logo.includes('http') ? `${this.logo}` : `${localStorage.getItem('api_uri')}/${this.logo}`;
4363
- }
4364
- }
4365
- __decorate([
4366
- Transform(({ value }) => value ? value.replace(' ', '%20') : null)
4367
- ], Bank.prototype, "logo", void 0);
4368
- __decorate([
4369
- Transform(({ obj }) => Object.values(BankPopularEnum).includes(obj.name)),
4370
- Expose()
4371
- ], Bank.prototype, "isPopular", void 0);
4372
-
4373
4623
  var BankConnectionStatusEnum;
4374
4624
  (function (BankConnectionStatusEnum) {
4375
4625
  BankConnectionStatusEnum[BankConnectionStatusEnum["PENDING"] = 1] = "PENDING";
@@ -4554,198 +4804,250 @@ __decorate([
4554
4804
  Transform(({ value }) => value === 4 ? BankAccountTypeEnum.LOAN : value)
4555
4805
  ], BankAccount.prototype, "type", void 0);
4556
4806
 
4557
- const TYPE_LOAN = [
4558
- BankAccountTypeEnum.CREDIT_CARD,
4559
- BankAccountTypeEnum.LOAN
4560
- ];
4561
-
4562
4807
  /**
4563
- * Collection of bank accounts.
4808
+ * bank account collection UI class with frontend specific data
4564
4809
  */
4565
- class BankAccountCollection extends Collection {
4566
- /**
4567
- * get list of bank accounts with passed types
4568
- */
4569
- getByType(types, isExclude = false) {
4570
- // get types always as array (if only one passed)
4571
- const typesArray = concat(types);
4572
- return this.items.filter((bankAccount) => {
4573
- if (isExclude) {
4574
- return !typesArray.includes(bankAccount.type);
4575
- }
4576
- return typesArray.includes(bankAccount.type);
4577
- });
4578
- }
4579
- /**
4580
- * get amount of initial loans
4581
- */
4582
- getInitialLoanAmount() {
4583
- return this.getByType(TYPE_LOAN)
4584
- .reduce((sum, bankAccount) => {
4585
- return sum += bankAccount.balances.length ? bankAccount.getOpeningBalance() : 0;
4586
- }, 0);
4810
+ class BankAccountChartData {
4811
+ constructor(bankAccounts) {
4812
+ this.bankAccounts = bankAccounts;
4587
4813
  }
4588
4814
  /**
4589
- * get amount of current loans
4815
+ * set value of pie chart data
4590
4816
  */
4591
- getCurrentLoanAmount() {
4592
- return this.getByType(TYPE_LOAN)
4593
- .reduce((sum, bankAccount) => {
4594
- return sum += bankAccount.currentBalance;
4595
- }, 0);
4817
+ getBalancePieChartData() {
4818
+ return this.bankAccounts.map((bankAccount) => {
4819
+ return {
4820
+ name: bankAccount.accountName,
4821
+ data: Math.abs(bankAccount.currentBalance)
4822
+ };
4823
+ });
4596
4824
  }
4597
4825
  /**
4598
- * get collection filtered by property id
4826
+ * set value of bar chart data
4599
4827
  */
4600
- getByPropertyId(id) {
4601
- return new BankAccountCollection(this.items.filter((bankAccount) => {
4602
- return bankAccount.bankAccountProperties.find((bankAccountProperty) => {
4603
- return bankAccountProperty.property.id === id;
4604
- });
4605
- }));
4828
+ getBalanceBarChartData() {
4829
+ return [{
4830
+ name: 'Balance',
4831
+ data: this.bankAccounts.map((bankAccount) => {
4832
+ return {
4833
+ label: bankAccount.accountName,
4834
+ value: bankAccount.currentBalance
4835
+ };
4836
+ })
4837
+ }];
4606
4838
  }
4607
- /**
4608
- * get collection filtered by properties ids
4609
- */
4610
- getByPropertiesIds(ids) {
4611
- return new BankAccountCollection(this.items.filter((bankAccount) => {
4612
- return bankAccount.bankAccountProperties.find((bankAccountProperty) => {
4613
- return ids.includes(bankAccountProperty.property.id);
4614
- });
4615
- }));
4839
+ }
4840
+
4841
+ /**
4842
+ * Const which contains array of bank account types
4843
+ */
4844
+ const BANK_ACCOUNT_TYPES = [
4845
+ { key: BankAccountTypeEnum.CREDIT_CARD, value: 'Credit Card Accounts' },
4846
+ { key: BankAccountTypeEnum.TERM_DEPOSIT, value: 'Deposit Accounts' },
4847
+ { key: BankAccountTypeEnum.INVESTMENT, value: 'Investment Accounts' },
4848
+ { key: BankAccountTypeEnum.LOAN, value: 'Loan Accounts' },
4849
+ { key: BankAccountTypeEnum.OFFSET, value: 'Offset' },
4850
+ { key: BankAccountTypeEnum.SAVINGS, value: 'Savings Accounts' },
4851
+ { key: BankAccountTypeEnum.TRANSACTION, value: 'Transaction Accounts' },
4852
+ ];
4853
+
4854
+ /**
4855
+ * Login data object for basiq banks
4856
+ */
4857
+ class BankLoginData {
4858
+ }
4859
+
4860
+ /**
4861
+ * enum with months indexes.
4862
+ * item value match with js Date month index from 0 to 11
4863
+ * Order of items match with financial year months order
4864
+ */
4865
+ var MonthNumberEnum;
4866
+ (function (MonthNumberEnum) {
4867
+ MonthNumberEnum[MonthNumberEnum["JULY"] = 6] = "JULY";
4868
+ MonthNumberEnum[MonthNumberEnum["AUGUST"] = 7] = "AUGUST";
4869
+ MonthNumberEnum[MonthNumberEnum["SEPTEMBER"] = 8] = "SEPTEMBER";
4870
+ MonthNumberEnum[MonthNumberEnum["OCTOBER"] = 9] = "OCTOBER";
4871
+ MonthNumberEnum[MonthNumberEnum["NOVEMBER"] = 10] = "NOVEMBER";
4872
+ MonthNumberEnum[MonthNumberEnum["DECEMBER"] = 11] = "DECEMBER";
4873
+ MonthNumberEnum[MonthNumberEnum["JANUARY"] = 0] = "JANUARY";
4874
+ MonthNumberEnum[MonthNumberEnum["FEBRUARY"] = 1] = "FEBRUARY";
4875
+ MonthNumberEnum[MonthNumberEnum["MARCH"] = 2] = "MARCH";
4876
+ MonthNumberEnum[MonthNumberEnum["APRIL"] = 3] = "APRIL";
4877
+ MonthNumberEnum[MonthNumberEnum["MAY"] = 4] = "MAY";
4878
+ MonthNumberEnum[MonthNumberEnum["JUNE"] = 5] = "JUNE";
4879
+ })(MonthNumberEnum || (MonthNumberEnum = {}));
4880
+
4881
+ /**
4882
+ * @TODO move to pipe/translation
4883
+ * enum with months short names.
4884
+ * Order of items match with financial year months order
4885
+ */
4886
+ var MonthNameShortEnum;
4887
+ (function (MonthNameShortEnum) {
4888
+ MonthNameShortEnum["JULY"] = "Jul";
4889
+ MonthNameShortEnum["AUGUST"] = "Aug";
4890
+ MonthNameShortEnum["SEPTEMBER"] = "Sep";
4891
+ MonthNameShortEnum["OCTOBER"] = "Oct";
4892
+ MonthNameShortEnum["NOVEMBER"] = "Nov";
4893
+ MonthNameShortEnum["DECEMBER"] = "Dec";
4894
+ MonthNameShortEnum["JANUARY"] = "Jan";
4895
+ MonthNameShortEnum["FEBRUARY"] = "Feb";
4896
+ MonthNameShortEnum["MARCH"] = "Mar";
4897
+ MonthNameShortEnum["APRIL"] = "Apr";
4898
+ MonthNameShortEnum["MAY"] = "May";
4899
+ MonthNameShortEnum["JUNE"] = "Jun";
4900
+ })(MonthNameShortEnum || (MonthNameShortEnum = {}));
4901
+
4902
+ /**
4903
+ * bank transactions collection UI class with frontend specific data
4904
+ */
4905
+ class BankTransactionChartData {
4906
+ constructor(bankTransactions) {
4907
+ this.bankTransactions = bankTransactions;
4616
4908
  }
4617
4909
  /**
4618
- * get collection of active bank accounts
4910
+ * get value of bar chart data
4619
4911
  */
4620
- getActiveBankAccounts() {
4621
- return new BankAccountCollection(this.items.filter((bankAccount) => {
4622
- return bankAccount.isActive();
4623
- }));
4912
+ getCashInOutBarChartData(months) {
4913
+ const chartData = this.calculateCashInOutBarChartData();
4914
+ if (!months) {
4915
+ return chartData;
4916
+ }
4917
+ return this.filterChartDataByMonths(months, chartData);
4624
4918
  }
4625
4919
  /**
4626
- * get reduction of loan (reduction of principle) percentage
4920
+ * get value of line chart data
4627
4921
  */
4628
- getPrincipleReductionPercent() {
4629
- const initialLoans = this.getInitialLoanAmount();
4630
- const currentLoans = this.getCurrentLoanAmount();
4631
- if (!initialLoans) {
4632
- return 0;
4922
+ getBalanceLineChartData(months) {
4923
+ const chartData = this.calculateBalanceLineChartData();
4924
+ if (!months) {
4925
+ return chartData;
4633
4926
  }
4634
- return (initialLoans - currentLoans) / initialLoans * 100;
4927
+ return this.filterChartDataByMonths(months, chartData);
4635
4928
  }
4636
4929
  /**
4637
- * Get collection of loan bank accounts
4930
+ * set bar chart data
4638
4931
  */
4639
- getLoanAccounts() {
4640
- return new BankAccountCollection(this.getByType(TYPE_LOAN));
4641
- }
4642
- getSavingsAccounts() {
4643
- return new BankAccountCollection(this.getByType(TYPE_LOAN, true));
4644
- }
4645
- getOpeningBalance() {
4646
- return this.items.reduce((sum, bankAccount) => sum + bankAccount.getOpeningBalance(), 0);
4647
- }
4648
- get currentBalance() {
4649
- return this.sumBy('currentBalance');
4932
+ calculateCashInOutBarChartData() {
4933
+ const chartData = [{
4934
+ name: 'Cash In',
4935
+ data: []
4936
+ }, {
4937
+ name: 'Cash Out',
4938
+ data: []
4939
+ }];
4940
+ for (const key in MonthNameShortEnum) {
4941
+ if (MonthNameShortEnum.hasOwnProperty(key)) {
4942
+ const bankTransactionsForMonth = this.bankTransactions.filter((bankTransaction) => {
4943
+ return +bankTransaction.date.getMonth() === +MonthNumberEnum[key];
4944
+ });
4945
+ const cashInForMonth = bankTransactionsForMonth
4946
+ .filter((bankTransaction) => bankTransaction.isCredit())
4947
+ .reduce((sum, bankTransaction) => sum += bankTransaction.allocatedAmount, 0);
4948
+ const cashOutForMonth = bankTransactionsForMonth
4949
+ .filter((bankTransaction) => bankTransaction.isDebit())
4950
+ .reduce((sum, bankTransaction) => sum += bankTransaction.allocatedAmount, 0);
4951
+ chartData[0].data.push({
4952
+ label: MonthNameShortEnum[key],
4953
+ value: cashInForMonth
4954
+ });
4955
+ chartData[1].data.push({
4956
+ label: MonthNameShortEnum[key],
4957
+ value: cashOutForMonth
4958
+ });
4959
+ }
4960
+ }
4961
+ return chartData;
4650
4962
  }
4651
4963
  /**
4652
- * Get Collection of bank accounts with property tank type
4964
+ * set line chart data
4653
4965
  */
4654
- getPropertyBankAccounts() {
4655
- return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.isPropertyTank()));
4966
+ calculateBalanceLineChartData() {
4967
+ const chartData = [{
4968
+ name: 'Balance',
4969
+ data: []
4970
+ }];
4971
+ for (const key in MonthNameShortEnum) {
4972
+ if (MonthNameShortEnum.hasOwnProperty(key)) {
4973
+ const bankTransactionsForMonth = this.bankTransactions.filter((bankTransaction) => {
4974
+ return +bankTransaction.date.getMonth() === +MonthNumberEnum[key];
4975
+ });
4976
+ const balanceForMonth = bankTransactionsForMonth.reduce((sum, bankTransaction) => {
4977
+ if (bankTransaction.isCredit()) {
4978
+ return sum += bankTransaction.allocatedAmount;
4979
+ }
4980
+ else {
4981
+ return sum -= bankTransaction.allocatedAmount;
4982
+ }
4983
+ }, 0);
4984
+ chartData[0].data.push({
4985
+ label: MonthNameShortEnum[key],
4986
+ value: balanceForMonth
4987
+ });
4988
+ }
4989
+ }
4990
+ return chartData;
4656
4991
  }
4657
4992
  /**
4658
- * Get Collection of bank accounts with work tank type
4993
+ * filter chart data for passed months
4659
4994
  */
4660
- getWorkBankAccounts() {
4661
- return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.isWorkTank()));
4995
+ filterChartDataByMonths(months, chartData) {
4996
+ const monthsNames = months.map((month) => MonthNumberEnum[month]).map((key) => MonthNameShortEnum[key]);
4997
+ const filteredChartData = cloneDeep$1(chartData);
4998
+ filteredChartData.forEach((chartDataItem) => {
4999
+ chartDataItem.data = chartDataItem.data.filter((serie) => monthsNames.includes(serie.label));
5000
+ });
5001
+ return filteredChartData;
4662
5002
  }
4663
- /**
4664
- * Get Collection of bank accounts by tank type
4665
- */
4666
- getByTankType(tankType) {
4667
- return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.tankType === tankType));
5003
+ }
5004
+
5005
+ var BankTransactionSummaryFieldsEnum;
5006
+ (function (BankTransactionSummaryFieldsEnum) {
5007
+ BankTransactionSummaryFieldsEnum["AMOUNT"] = "amount";
5008
+ BankTransactionSummaryFieldsEnum["ALLOCATED_AMOUNT"] = "allocatedAmount";
5009
+ })(BankTransactionSummaryFieldsEnum || (BankTransactionSummaryFieldsEnum = {}));
5010
+
5011
+ class Document$1 extends AbstractModel {
5012
+ }
5013
+
5014
+ /**
5015
+ * Enum with document types which used to API url prefix
5016
+ */
5017
+ var DocumentApiUrlPrefixEnum;
5018
+ (function (DocumentApiUrlPrefixEnum) {
5019
+ DocumentApiUrlPrefixEnum["FOLDERS"] = "folders";
5020
+ DocumentApiUrlPrefixEnum["PROPERTIES"] = "properties";
5021
+ })(DocumentApiUrlPrefixEnum || (DocumentApiUrlPrefixEnum = {}));
5022
+
5023
+ class Document extends Document$1 {
5024
+ constructor() {
5025
+ super(...arguments);
5026
+ this.type = AssetTypeEnum.DOCUMENTS;
5027
+ this.entityType = AssetEntityTypeEnum.FOLDERS;
4668
5028
  }
4669
5029
  /**
4670
- * Get list of all bank account properties
5030
+ * Get folder as document parent entity
4671
5031
  */
4672
- getBankAccountPropertiesList() {
4673
- return flatten(this.items.map((bankAccount) => {
4674
- return bankAccount.bankAccountProperties;
4675
- }));
5032
+ getEntity() {
5033
+ return this.folder;
4676
5034
  }
4677
5035
  /**
4678
- * Get lis of unique properties from all bank accounts properties
5036
+ * Get API url prefix
4679
5037
  */
4680
- getProperties() {
4681
- return uniqBy(this.getBankAccountPropertiesList().map((bankAccountProperty) => {
4682
- return bankAccountProperty.property;
4683
- }), 'id');
4684
- }
4685
- getPropertyBalanceAmount(propertyId) {
4686
- return this.items.reduce((sum, bankAccount) => {
4687
- return sum + bankAccount.getPropertyBalanceAmount(propertyId);
4688
- }, 0);
5038
+ getApiUrlPrefix() {
5039
+ return DocumentApiUrlPrefixEnum.FOLDERS;
4689
5040
  }
4690
5041
  }
4691
5042
 
4692
- var UserEventTypeTypeEnum;
4693
- (function (UserEventTypeTypeEnum) {
4694
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTERED"] = 1000] = "REGISTERED";
4695
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PASSWORD_RESET_REQUEST"] = 1001] = "PASSWORD_RESET_REQUEST";
4696
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["APP_FEATURES"] = 1010] = "APP_FEATURES";
4697
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
4698
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
4699
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
4700
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
4701
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_PAYMENT_FAILED"] = 2006] = "SUBSCRIPTION_PAYMENT_FAILED";
4702
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
4703
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
4704
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
4705
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
4706
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
4707
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
4708
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
4709
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
4710
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
4711
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
4712
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
4713
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
4714
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
4715
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_SUBSCRIBED"] = 2028] = "OWNER_SUBSCRIBED";
4716
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_UNSUBSCRIBED"] = 2029] = "OWNER_UNSUBSCRIBED";
4717
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
4718
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
4719
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
4720
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
4721
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
4722
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
4723
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_EMAIL_CONFIRMED"] = 2050] = "CLIENT_EMAIL_CONFIRMED";
4724
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
4725
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_TO_REGISTER"] = 3000] = "FIRM_INVITE_TO_REGISTER";
4726
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE"] = 3001] = "FIRM_INVITE";
4727
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_ACCEPTED"] = 3002] = "CLIENT_INVITE_ACCEPTED";
4728
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REJECTED"] = 3003] = "CLIENT_INVITE_REJECTED";
4729
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REGISTERED"] = 3004] = "CLIENT_INVITE_REGISTERED";
4730
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_NEW_CLIENT"] = 3005] = "FIRM_NEW_CLIENT";
4731
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_LOST_CLIENT"] = 3006] = "FIRM_LOST_CLIENT";
4732
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE"] = 3010] = "EMPLOYEE_INVITE";
4733
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_LOST_CLIENT"] = 3011] = "EMPLOYEE_LOST_CLIENT";
4734
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_NEW_CLIENT"] = 3012] = "EMPLOYEE_NEW_CLIENT";
4735
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE_ACCEPTED"] = 3013] = "EMPLOYEE_INVITE_ACCEPTED";
4736
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_EMAIL_CONFIRMED"] = 3020] = "EMPLOYEE_EMAIL_CONFIRMED";
4737
- UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_RECEIVED"] = 3030] = "TAX_REVIEW_RECEIVED";
4738
- })(UserEventTypeTypeEnum || (UserEventTypeTypeEnum = {}));
5043
+ class DocumentFolder$1 extends AbstractModel {
5044
+ }
4739
5045
 
4740
- /**
4741
- * any event happened in the app, which needs to be handled somehow (distributed to other part of the app)
4742
- */
4743
- class AppEvent {
4744
- constructor(type, payload) {
4745
- this.type = type;
4746
- this.payload = payload;
4747
- }
5046
+ class DocumentFolder extends DocumentFolder$1 {
4748
5047
  }
5048
+ __decorate([
5049
+ Type(() => Document)
5050
+ ], DocumentFolder.prototype, "documents", void 0);
4749
5051
 
4750
5052
  /**
4751
5053
  * BankConnection means user account at specific bank (usually each user has only one at the same bank)
@@ -4837,6 +5139,7 @@ class BasiqService extends RestService {
4837
5139
  */
4838
5140
  listenEvents() {
4839
5141
  this.listenNotifications();
5142
+ this.listenJobs();
4840
5143
  }
4841
5144
  /**
4842
5145
  * Create a new Bank connection based on Basiq job.
@@ -4848,6 +5151,7 @@ class BasiqService extends RestService {
4848
5151
  // Send login data to basiq API to create a basiq job
4849
5152
  return this.http.post(`${BasiqService.basiqApiUrl}/users/${userId}/connections`, loginData)
4850
5153
  .pipe(mergeMap((response) => {
5154
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.BASIQ_JOB_CREATED, response.id));
4851
5155
  // Create bank connection based on basiq job
4852
5156
  return this.bankConnectionService.add(plainToClass(BankConnection, { basiqJob: { externalId: response.id } }));
4853
5157
  }), catchError((error) => {
@@ -4868,8 +5172,12 @@ class BasiqService extends RestService {
4868
5172
  // Send login data and connection id to basiq API to create a basiq job
4869
5173
  return this.http.post(`${BasiqService.basiqApiUrl}/users/${userId}/connections`, Object.assign(data, { id: connection.externalId }))
4870
5174
  .pipe(mergeMap((response) => {
5175
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.BASIQ_JOB_CREATED, response.id));
4871
5176
  // Create bank connection based on basiq job
4872
- return this.bankConnectionService.add(plainToClass(BankConnection, { id: connection.id, basiqJob: { externalId: response.id } }));
5177
+ return this.bankConnectionService.add(plainToClass(BankConnection, {
5178
+ id: connection.id,
5179
+ basiqJob: { externalId: response.id }
5180
+ }));
4873
5181
  }), catchError((error) => {
4874
5182
  // Show error when user provided wrong login data
4875
5183
  if (error.status === 401) {
@@ -4892,6 +5200,34 @@ class BasiqService extends RestService {
4892
5200
  return bankAccounts.removeBy('accountId', savedAccounts.mapBy('accountId'));
4893
5201
  }));
4894
5202
  }
5203
+ /**
5204
+ * Get status of credentials verifying. Expected statuses: 'in-progress', 'failed' or 'success'
5205
+ * We send this request by interval until basiq return success or failed
5206
+ * @TODO Alex (TT-2431): check logic and try to remove subscribe, use pipes instead
5207
+ * @TODO Alex (TT-2431): implement some limit and handle (message or something) if basiq stuck
5208
+ * @TODO Alex (TT-2431): check logic and handle case when user cancelled loading
5209
+ */
5210
+ checkBankCredentials(jobId) {
5211
+ this.http.get(`${BasiqService.basiqApiUrl}/jobs/${jobId}`)
5212
+ .pipe(
5213
+ // unsubscribe after each request to avoid wrong requests (example: user cancelled too long login and login to another bank, then we will send 2 different requests)
5214
+ take(1),
5215
+ // get verify-credentials step from basiq job
5216
+ map((response) => plainToClass(BasiqJobResponse, response).getVerifyCredentialsStep()),
5217
+ // check credentials status again if not finished
5218
+ filter((step) => {
5219
+ if (!step.isInProgress()) {
5220
+ return true;
5221
+ }
5222
+ setTimeout(() => {
5223
+ this.checkBankCredentials(jobId);
5224
+ }, BasiqService.bankCredintialsCheckInterval);
5225
+ return false;
5226
+ }))
5227
+ .subscribe((step) => {
5228
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.BASIQ_LOGIN_FINISHED, step.isSuccess()));
5229
+ });
5230
+ }
4895
5231
  /**
4896
5232
  * listen to notifications to update basiq accounts list
4897
5233
  */
@@ -4902,8 +5238,20 @@ class BasiqService extends RestService {
4902
5238
  }
4903
5239
  });
4904
5240
  }
5241
+ /**
5242
+ * Listen Basiq job created to check its verify credentials status
5243
+ */
5244
+ listenJobs() {
5245
+ this.eventDispatcherService.on(AppEventTypeEnum.BASIQ_JOB_CREATED).subscribe((jobId) => {
5246
+ this.checkBankCredentials(jobId);
5247
+ });
5248
+ }
4905
5249
  }
4906
5250
  BasiqService.basiqApiUrl = 'https://au-api.basiq.io';
5251
+ /**
5252
+ * Basiq does not provide a hook, so we have to check job status manually every x seconds
5253
+ */
5254
+ BasiqService.bankCredintialsCheckInterval = 3000;
4907
5255
  BasiqService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }, { token: BankConnectionService }], target: i0.ɵɵFactoryTarget.Injectable });
4908
5256
  BasiqService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqService, providedIn: 'root' });
4909
5257
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqService, decorators: [{
@@ -4916,19 +5264,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
4916
5264
  args: ['environment']
4917
5265
  }] }, { type: ToastService }, { type: BankConnectionService }]; } });
4918
5266
 
4919
- /**
4920
- * access token, needed to access basiq connect ui (https://github.com/basiqio/basiq-connect-ui)
4921
- */
4922
- class BasiqToken {
4923
- constructor(value, expiresAt) {
4924
- this.value = value;
4925
- this.expiresAt = expiresAt;
4926
- }
4927
- isExpired() {
4928
- return this.expiresAt < new Date();
4929
- }
4930
- }
4931
-
4932
5267
  class BasiqTokenService {
4933
5268
  constructor(http, environment) {
4934
5269
  this.http = http;
@@ -5170,6 +5505,12 @@ class UserService {
5170
5505
  * Create basiq (if not exist yet) to provide access to basiq api
5171
5506
  */
5172
5507
  createBasiq() {
5508
+ var _a;
5509
+ // no need to create basiqId if already exist
5510
+ // @TODO Alex (TT-2431): move this check to component or separated method
5511
+ if ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.basiqId) {
5512
+ return of(this.cache.basiqId);
5513
+ }
5173
5514
  return this.http.post(`${this.environment.apiV2}/basiq/user`, {})
5174
5515
  .pipe(map((basiqId) => {
5175
5516
  this.cache = plainToClass(User, Object.assign(this.cache, { basiqId }));
@@ -5301,85 +5642,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
5301
5642
  },
5302
5643
  {
5303
5644
  provide: HTTP_INTERCEPTORS,
5304
- useClass: BasiqClientIdInterceptor,
5305
- multi: true
5306
- }
5307
- ]
5308
- }]
5309
- }] });
5310
-
5311
- class TtCoreModule {
5312
- static forRoot(environment) {
5313
- localStorage.setItem('api_uri', environment['api_uri']);
5314
- return {
5315
- ngModule: TtCoreModule,
5316
- providers: [
5317
- {
5318
- provide: 'environment',
5319
- useValue: environment
5320
- }
5321
- ]
5322
- };
5323
- }
5324
- }
5325
- TtCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5326
- TtCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, imports: [CommonModule,
5327
- InterceptorsModule] });
5328
- TtCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, imports: [[
5329
- CommonModule,
5330
- InterceptorsModule
5331
- ]] });
5332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, decorators: [{
5333
- type: NgModule,
5334
- args: [{
5335
- declarations: [],
5336
- imports: [
5337
- CommonModule,
5338
- InterceptorsModule
5339
- ]
5340
- }]
5341
- }] });
5342
-
5343
- class Document$1 extends AbstractModel {
5344
- }
5345
-
5346
- /**
5347
- * Enum with document types which used to API url prefix
5348
- */
5349
- var DocumentApiUrlPrefixEnum;
5350
- (function (DocumentApiUrlPrefixEnum) {
5351
- DocumentApiUrlPrefixEnum["FOLDERS"] = "folders";
5352
- DocumentApiUrlPrefixEnum["PROPERTIES"] = "properties";
5353
- })(DocumentApiUrlPrefixEnum || (DocumentApiUrlPrefixEnum = {}));
5354
-
5355
- class Document extends Document$1 {
5356
- constructor() {
5357
- super(...arguments);
5358
- this.type = AssetTypeEnum.DOCUMENTS;
5359
- this.entityType = AssetEntityTypeEnum.FOLDERS;
5360
- }
5361
- /**
5362
- * Get folder as document parent entity
5363
- */
5364
- getEntity() {
5365
- return this.folder;
5366
- }
5367
- /**
5368
- * Get API url prefix
5369
- */
5370
- getApiUrlPrefix() {
5371
- return DocumentApiUrlPrefixEnum.FOLDERS;
5372
- }
5373
- }
5374
-
5375
- class DocumentFolder$1 extends AbstractModel {
5376
- }
5645
+ useClass: BasiqClientIdInterceptor,
5646
+ multi: true
5647
+ }
5648
+ ]
5649
+ }]
5650
+ }] });
5377
5651
 
5378
- class DocumentFolder extends DocumentFolder$1 {
5652
+ class TtCoreModule {
5653
+ static forRoot(environment) {
5654
+ localStorage.setItem('api_uri', environment['api_uri']);
5655
+ return {
5656
+ ngModule: TtCoreModule,
5657
+ providers: [
5658
+ {
5659
+ provide: 'environment',
5660
+ useValue: environment
5661
+ }
5662
+ ]
5663
+ };
5664
+ }
5379
5665
  }
5380
- __decorate([
5381
- Type(() => Document)
5382
- ], DocumentFolder.prototype, "documents", void 0);
5666
+ TtCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5667
+ TtCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, imports: [CommonModule,
5668
+ InterceptorsModule] });
5669
+ TtCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, imports: [[
5670
+ CommonModule,
5671
+ InterceptorsModule
5672
+ ]] });
5673
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TtCoreModule, decorators: [{
5674
+ type: NgModule,
5675
+ args: [{
5676
+ declarations: [],
5677
+ imports: [
5678
+ CommonModule,
5679
+ InterceptorsModule
5680
+ ]
5681
+ }]
5682
+ }] });
5383
5683
 
5384
5684
  class VehicleClaimCollection extends Collection {
5385
5685
  /**
@@ -7495,222 +7795,6 @@ class Badge extends AbstractModel {
7495
7795
  }
7496
7796
  }
7497
7797
 
7498
- /**
7499
- * bank account collection UI class with frontend specific data
7500
- */
7501
- class BankAccountChartData {
7502
- constructor(bankAccounts) {
7503
- this.bankAccounts = bankAccounts;
7504
- }
7505
- /**
7506
- * set value of pie chart data
7507
- */
7508
- getBalancePieChartData() {
7509
- return this.bankAccounts.map((bankAccount) => {
7510
- return {
7511
- name: bankAccount.accountName,
7512
- data: Math.abs(bankAccount.currentBalance)
7513
- };
7514
- });
7515
- }
7516
- /**
7517
- * set value of bar chart data
7518
- */
7519
- getBalanceBarChartData() {
7520
- return [{
7521
- name: 'Balance',
7522
- data: this.bankAccounts.map((bankAccount) => {
7523
- return {
7524
- label: bankAccount.accountName,
7525
- value: bankAccount.currentBalance
7526
- };
7527
- })
7528
- }];
7529
- }
7530
- }
7531
-
7532
- /**
7533
- * Const which contains array of bank account types
7534
- */
7535
- const BANK_ACCOUNT_TYPES = [
7536
- { key: BankAccountTypeEnum.CREDIT_CARD, value: 'Credit Card Accounts' },
7537
- { key: BankAccountTypeEnum.TERM_DEPOSIT, value: 'Deposit Accounts' },
7538
- { key: BankAccountTypeEnum.INVESTMENT, value: 'Investment Accounts' },
7539
- { key: BankAccountTypeEnum.LOAN, value: 'Loan Accounts' },
7540
- { key: BankAccountTypeEnum.OFFSET, value: 'Offset' },
7541
- { key: BankAccountTypeEnum.SAVINGS, value: 'Savings Accounts' },
7542
- { key: BankAccountTypeEnum.TRANSACTION, value: 'Transaction Accounts' },
7543
- ];
7544
-
7545
- /**
7546
- * Login data object for basiq banks
7547
- */
7548
- class BankLoginData {
7549
- }
7550
-
7551
- /**
7552
- * enum with months indexes.
7553
- * item value match with js Date month index from 0 to 11
7554
- * Order of items match with financial year months order
7555
- */
7556
- var MonthNumberEnum;
7557
- (function (MonthNumberEnum) {
7558
- MonthNumberEnum[MonthNumberEnum["JULY"] = 6] = "JULY";
7559
- MonthNumberEnum[MonthNumberEnum["AUGUST"] = 7] = "AUGUST";
7560
- MonthNumberEnum[MonthNumberEnum["SEPTEMBER"] = 8] = "SEPTEMBER";
7561
- MonthNumberEnum[MonthNumberEnum["OCTOBER"] = 9] = "OCTOBER";
7562
- MonthNumberEnum[MonthNumberEnum["NOVEMBER"] = 10] = "NOVEMBER";
7563
- MonthNumberEnum[MonthNumberEnum["DECEMBER"] = 11] = "DECEMBER";
7564
- MonthNumberEnum[MonthNumberEnum["JANUARY"] = 0] = "JANUARY";
7565
- MonthNumberEnum[MonthNumberEnum["FEBRUARY"] = 1] = "FEBRUARY";
7566
- MonthNumberEnum[MonthNumberEnum["MARCH"] = 2] = "MARCH";
7567
- MonthNumberEnum[MonthNumberEnum["APRIL"] = 3] = "APRIL";
7568
- MonthNumberEnum[MonthNumberEnum["MAY"] = 4] = "MAY";
7569
- MonthNumberEnum[MonthNumberEnum["JUNE"] = 5] = "JUNE";
7570
- })(MonthNumberEnum || (MonthNumberEnum = {}));
7571
-
7572
- /**
7573
- * @TODO move to pipe/translation
7574
- * enum with months short names.
7575
- * Order of items match with financial year months order
7576
- */
7577
- var MonthNameShortEnum;
7578
- (function (MonthNameShortEnum) {
7579
- MonthNameShortEnum["JULY"] = "Jul";
7580
- MonthNameShortEnum["AUGUST"] = "Aug";
7581
- MonthNameShortEnum["SEPTEMBER"] = "Sep";
7582
- MonthNameShortEnum["OCTOBER"] = "Oct";
7583
- MonthNameShortEnum["NOVEMBER"] = "Nov";
7584
- MonthNameShortEnum["DECEMBER"] = "Dec";
7585
- MonthNameShortEnum["JANUARY"] = "Jan";
7586
- MonthNameShortEnum["FEBRUARY"] = "Feb";
7587
- MonthNameShortEnum["MARCH"] = "Mar";
7588
- MonthNameShortEnum["APRIL"] = "Apr";
7589
- MonthNameShortEnum["MAY"] = "May";
7590
- MonthNameShortEnum["JUNE"] = "Jun";
7591
- })(MonthNameShortEnum || (MonthNameShortEnum = {}));
7592
-
7593
- /**
7594
- * bank transactions collection UI class with frontend specific data
7595
- */
7596
- class BankTransactionChartData {
7597
- constructor(bankTransactions) {
7598
- this.bankTransactions = bankTransactions;
7599
- }
7600
- /**
7601
- * get value of bar chart data
7602
- */
7603
- getCashInOutBarChartData(months) {
7604
- const chartData = this.calculateCashInOutBarChartData();
7605
- if (!months) {
7606
- return chartData;
7607
- }
7608
- return this.filterChartDataByMonths(months, chartData);
7609
- }
7610
- /**
7611
- * get value of line chart data
7612
- */
7613
- getBalanceLineChartData(months) {
7614
- const chartData = this.calculateBalanceLineChartData();
7615
- if (!months) {
7616
- return chartData;
7617
- }
7618
- return this.filterChartDataByMonths(months, chartData);
7619
- }
7620
- /**
7621
- * set bar chart data
7622
- */
7623
- calculateCashInOutBarChartData() {
7624
- const chartData = [{
7625
- name: 'Cash In',
7626
- data: []
7627
- }, {
7628
- name: 'Cash Out',
7629
- data: []
7630
- }];
7631
- for (const key in MonthNameShortEnum) {
7632
- if (MonthNameShortEnum.hasOwnProperty(key)) {
7633
- const bankTransactionsForMonth = this.bankTransactions.filter((bankTransaction) => {
7634
- return +bankTransaction.date.getMonth() === +MonthNumberEnum[key];
7635
- });
7636
- const cashInForMonth = bankTransactionsForMonth
7637
- .filter((bankTransaction) => bankTransaction.isCredit())
7638
- .reduce((sum, bankTransaction) => sum += bankTransaction.allocatedAmount, 0);
7639
- const cashOutForMonth = bankTransactionsForMonth
7640
- .filter((bankTransaction) => bankTransaction.isDebit())
7641
- .reduce((sum, bankTransaction) => sum += bankTransaction.allocatedAmount, 0);
7642
- chartData[0].data.push({
7643
- label: MonthNameShortEnum[key],
7644
- value: cashInForMonth
7645
- });
7646
- chartData[1].data.push({
7647
- label: MonthNameShortEnum[key],
7648
- value: cashOutForMonth
7649
- });
7650
- }
7651
- }
7652
- return chartData;
7653
- }
7654
- /**
7655
- * set line chart data
7656
- */
7657
- calculateBalanceLineChartData() {
7658
- const chartData = [{
7659
- name: 'Balance',
7660
- data: []
7661
- }];
7662
- for (const key in MonthNameShortEnum) {
7663
- if (MonthNameShortEnum.hasOwnProperty(key)) {
7664
- const bankTransactionsForMonth = this.bankTransactions.filter((bankTransaction) => {
7665
- return +bankTransaction.date.getMonth() === +MonthNumberEnum[key];
7666
- });
7667
- const balanceForMonth = bankTransactionsForMonth.reduce((sum, bankTransaction) => {
7668
- if (bankTransaction.isCredit()) {
7669
- return sum += bankTransaction.allocatedAmount;
7670
- }
7671
- else {
7672
- return sum -= bankTransaction.allocatedAmount;
7673
- }
7674
- }, 0);
7675
- chartData[0].data.push({
7676
- label: MonthNameShortEnum[key],
7677
- value: balanceForMonth
7678
- });
7679
- }
7680
- }
7681
- return chartData;
7682
- }
7683
- /**
7684
- * filter chart data for passed months
7685
- */
7686
- filterChartDataByMonths(months, chartData) {
7687
- const monthsNames = months.map((month) => MonthNumberEnum[month]).map((key) => MonthNameShortEnum[key]);
7688
- const filteredChartData = cloneDeep$1(chartData);
7689
- filteredChartData.forEach((chartDataItem) => {
7690
- chartDataItem.data = chartDataItem.data.filter((serie) => monthsNames.includes(serie.label));
7691
- });
7692
- return filteredChartData;
7693
- }
7694
- }
7695
-
7696
- var BankTransactionSummaryFieldsEnum;
7697
- (function (BankTransactionSummaryFieldsEnum) {
7698
- BankTransactionSummaryFieldsEnum["AMOUNT"] = "amount";
7699
- BankTransactionSummaryFieldsEnum["ALLOCATED_AMOUNT"] = "allocatedAmount";
7700
- })(BankTransactionSummaryFieldsEnum || (BankTransactionSummaryFieldsEnum = {}));
7701
-
7702
- /**
7703
- * Class describe configuration options for basiq connect control
7704
- * https://www.npmjs.com/package/@basiq/basiq-connect-control
7705
- */
7706
- class BasiqConfig {
7707
- constructor(options) {
7708
- // ID of the DOM element to which Basiq Connect Control will be rendered;
7709
- this.containerId = 'basiq-control';
7710
- Object.assign(this, options);
7711
- }
7712
- }
7713
-
7714
7798
  class BorrowingExpense$1 extends AbstractModel {
7715
7799
  }
7716
7800
 
@@ -16219,5 +16303,5 @@ VehicleLogbookForm.maxDescriptionLength = 60;
16219
16303
  * Generated bundle index. Do not edit.
16220
16304
  */
16221
16305
 
16222
- export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressService, AddressTypeEnum, AlphabetColorsEnum, AppEvent, AppEventTypeEnum, 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, BankLoginData, BankLoginForm, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasiqConfig, BasiqJob, BasiqService, BasiqToken, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsListEnum, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, 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, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationLvpAssetTypeEnum, 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, FinancialYear, Firm, FirmService, FirmTypeEnum, HeaderTitleService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, InterceptorsModule, IntercomService, InviteStatusEnum, JwtService, KompassifyService, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookBestPeriodService, LogbookPeriod, LoginForm, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, MyTaxBusinessOrLosses, MyTaxBusinessOrLossesForm, MyTaxCgt, MyTaxCgtForm, MyTaxDeductions, MyTaxDeductionsForm, MyTaxDividends, MyTaxDividendsForm, MyTaxEmployeeShareSchemes, MyTaxEmployeeShareSchemesForm, 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, PdfOrientationEnum, PdfSettings, Phone, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementCollection, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciation, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleCostBase, PropertySaleCostBaseForm, PropertySaleCostSaleForm, PropertySaleExemptionsForm, PropertySaleService, PropertySaleTaxExemptionMetadata, PropertySaleTaxExemptionMetadataCollection, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, RewardfulService, SUBSCRIPTION_DESCRIPTION, SUBSCRIPTION_TITLE, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentStatusEnum, ServicePrice, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductIdEnum, ServiceProductStatusEnum, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, ShareFilterOptionsEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessLossForm, SoleBusinessLossOffsetRule, SoleBusinessLossOffsetRuleService, SoleBusinessLossReport, SoleBusinessLossService, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceCollection, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStatusesEnum, SoleInvoiceTaxTypeEnum, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SoleInvoiceTemplateTaxTypeEnum, SpareDocumentSpareTypeEnum, SseService, SubscriptionService, SubscriptionTypeEnum, 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, TransactionBaseCollection, TransactionCalculationService, TransactionCategoryEnum, TransactionCollection, TransactionMetadata, TransactionOperationEnum, TransactionReceipt, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, TutorialVideoService, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, 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, XlsxService, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, minDateValidator, passwordMatchValidator, passwordValidator, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate };
16306
+ export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressService, AddressTypeEnum, AlphabetColorsEnum, AppEvent, AppEventTypeEnum, 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, BasiqConfig, BasiqJob, BasiqJobResponse, BasiqJobStep, BasiqService, BasiqToken, BasiqTokenService, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsListEnum, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, 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, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationLvpAssetTypeEnum, 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, FinancialYear, Firm, FirmService, FirmTypeEnum, HeaderTitleService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, InterceptorsModule, IntercomService, InviteStatusEnum, JwtService, KompassifyService, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookBestPeriodService, LogbookPeriod, LoginForm, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, MyTaxBusinessOrLosses, MyTaxBusinessOrLossesForm, MyTaxCgt, MyTaxCgtForm, MyTaxDeductions, MyTaxDeductionsForm, MyTaxDividends, MyTaxDividendsForm, MyTaxEmployeeShareSchemes, MyTaxEmployeeShareSchemesForm, 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, PdfOrientationEnum, PdfSettings, Phone, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementCollection, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciation, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleCostBase, PropertySaleCostBaseForm, PropertySaleCostSaleForm, PropertySaleExemptionsForm, PropertySaleService, PropertySaleTaxExemptionMetadata, PropertySaleTaxExemptionMetadataCollection, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, RewardfulService, SUBSCRIPTION_DESCRIPTION, SUBSCRIPTION_TITLE, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentStatusEnum, ServicePrice, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductIdEnum, ServiceProductStatusEnum, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, ShareFilterOptionsEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessLossForm, SoleBusinessLossOffsetRule, SoleBusinessLossOffsetRuleService, SoleBusinessLossReport, SoleBusinessLossService, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceCollection, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStatusesEnum, SoleInvoiceTaxTypeEnum, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SoleInvoiceTemplateTaxTypeEnum, SpareDocumentSpareTypeEnum, SseService, SubscriptionService, SubscriptionTypeEnum, 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, TransactionBaseCollection, TransactionCalculationService, TransactionCategoryEnum, TransactionCollection, TransactionMetadata, TransactionOperationEnum, TransactionReceipt, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, TutorialVideoService, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, 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, XlsxService, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, minDateValidator, passwordMatchValidator, passwordValidator, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate };
16223
16307
  //# sourceMappingURL=taxtank-core.js.map