taxtank-core 0.26.0 → 0.27.2

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 (30) hide show
  1. package/bundles/taxtank-core.umd.js +561 -408
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/models/endpoint/endpoints.const.js +3 -1
  4. package/esm2015/lib/models/event/app-event-type.enum.js +45 -42
  5. package/esm2015/lib/models/sole/sole-business.js +6 -2
  6. package/esm2015/lib/services/http/depreciation/depreciation-receipt/depreciation-receipt.service.js +40 -0
  7. package/esm2015/lib/services/http/depreciation/depreciation.service.js +61 -22
  8. package/esm2015/lib/services/http/depreciation/index.js +4 -0
  9. package/esm2015/lib/services/http/index.js +2 -1
  10. package/esm2015/lib/services/http/receipt/receipt.service.js +76 -0
  11. package/esm2015/lib/services/http/transaction/transaction-receipt/transaction-receipt.service.js +20 -50
  12. package/esm2015/lib/services/http/transaction/transaction.service.js +12 -11
  13. package/esm2015/lib/services/http/user/index.js +5 -0
  14. package/esm2015/lib/services/http/user/users-invite/users-invite.service.js +23 -0
  15. package/esm2015/public-api.js +2 -3
  16. package/fesm2015/taxtank-core.js +438 -304
  17. package/fesm2015/taxtank-core.js.map +1 -1
  18. package/lib/models/event/app-event-type.enum.d.ts +44 -41
  19. package/lib/models/sole/sole-business.d.ts +5 -1
  20. package/lib/services/http/depreciation/depreciation-receipt/depreciation-receipt.service.d.ts +28 -0
  21. package/lib/services/http/depreciation/depreciation.service.d.ts +15 -7
  22. package/lib/services/http/depreciation/index.d.ts +3 -0
  23. package/lib/services/http/index.d.ts +1 -0
  24. package/lib/services/http/receipt/receipt.service.d.ts +62 -0
  25. package/lib/services/http/transaction/transaction-receipt/transaction-receipt.service.d.ts +21 -21
  26. package/lib/services/http/transaction/transaction.service.d.ts +1 -0
  27. package/lib/services/http/user/index.d.ts +4 -0
  28. package/lib/services/http/user/users-invite/users-invite.service.d.ts +13 -0
  29. package/package.json +1 -1
  30. package/public-api.d.ts +1 -2
@@ -4,7 +4,7 @@ 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, combineLatest, of, Observable, forkJoin, from } from 'rxjs';
7
+ import { ReplaySubject, Subject, BehaviorSubject, throwError, combineLatest, forkJoin, of, Observable, from } from 'rxjs';
8
8
  import { map, filter, catchError, take, switchMap, finalize, mergeMap, skip, distinctUntilChanged } from 'rxjs/operators';
9
9
  import { plainToClass, classToPlain, Type, Exclude, Transform, Expose } from 'class-transformer';
10
10
  import { JwtHelperService } from '@auth0/angular-jwt';
@@ -211,47 +211,50 @@ var AppEventTypeEnum;
211
211
  AppEventTypeEnum[AppEventTypeEnum["CURRENT_USER_GET_FAILED"] = 11] = "CURRENT_USER_GET_FAILED";
212
212
  AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 12] = "DEPRECIATION_DELETED";
213
213
  AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 13] = "DEPRECIATIONS_CREATED";
214
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 14] = "INCOME_SOURCES_CREATED";
215
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 15] = "INCOME_SOURCES_UPDATED";
216
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 16] = "INCOME_SOURCES_FORECASTS_CREATED";
217
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 17] = "INCOME_SOURCES_FORECASTS_UPDATED";
218
- AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 18] = "LOAN_UPDATED";
219
- AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 19] = "LOAN_PAYOUT_UPDATED";
220
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 20] = "MESSAGE_CREATED";
221
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 21] = "MESSAGE_FILE_CREATED";
222
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 22] = "MESSAGE_FILE_DELETED";
223
- AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 23] = "NOTIFICATION_ADDED";
224
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 24] = "PROPERTY_UPDATED_WITH_DOCUMENT";
225
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 25] = "PROPERTY_DOCUMENT_ADDED";
226
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 26] = "PROPERTY_MOVEMENT_CREATED";
227
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 27] = "PROPERTY_MOVEMENT_UPDATED";
228
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 28] = "PROPERTY_MOVEMENT_DELETED";
229
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 29] = "PROPERTY_SHARE_UPDATED";
230
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 30] = "PROPERTY_SALE_ADDED";
231
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 31] = "PROPERTY_SALE_DELETED";
232
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 32] = "PROPERTY_SUBSCRIPTION_ADDED";
233
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 33] = "PROPERTY_SUBSCRIPTION_DELETED";
234
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 34] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
235
- AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 35] = "SERVICE_SUBSCRIPTION_UPDATED";
236
- AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 36] = "TAX_REVIEW_UPDATED";
237
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 37] = "TRANSACTION_CREATED";
238
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 38] = "TRANSACTION_DELETED";
239
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 39] = "TRANSACTION_UPDATED";
240
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED_WITH_NEW_RECEIPT"] = 40] = "TRANSACTION_CREATED_WITH_NEW_RECEIPT";
241
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_NEW_RECEIPT"] = 41] = "TRANSACTION_UPDATED_WITH_NEW_RECEIPT";
242
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 42] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
243
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 43] = "TRANSACTION_RECEIPT_CREATED";
244
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 44] = "TRANSACTION_RECEIPT_DELETED";
245
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 45] = "TRANSACTIONS_CREATED";
246
- AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 46] = "USER_UPDATED";
247
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 47] = "VEHICLE_CLAIM_UPDATED";
248
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 48] = "VEHICLE_CLAIM_CREATED";
249
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 49] = "VEHICLE_CLAIM_DETAILS_UPDATED";
250
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 50] = "VEHICLE_CLAIM_DETAILS_CREATED";
251
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 51] = "VEHICLE_LOGBOOK_CREATED";
252
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 52] = "VEHICLE_LOGBOOK_UPDATED";
253
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 53] = "VEHICLE_LOGBOOK_DELETED";
254
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 54] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
214
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_RECEIPT"] = 14] = "DEPRECIATION_UPDATED_WITH_RECEIPT";
215
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT"] = 15] = "DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT";
216
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_CREATED"] = 16] = "DEPRECIATION_RECEIPT_CREATED";
217
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_DELETED"] = 17] = "DEPRECIATION_RECEIPT_DELETED";
218
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 18] = "INCOME_SOURCES_CREATED";
219
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 19] = "INCOME_SOURCES_UPDATED";
220
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 20] = "INCOME_SOURCES_FORECASTS_CREATED";
221
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 21] = "INCOME_SOURCES_FORECASTS_UPDATED";
222
+ AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 22] = "LOAN_UPDATED";
223
+ AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 23] = "LOAN_PAYOUT_UPDATED";
224
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 24] = "MESSAGE_CREATED";
225
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 25] = "MESSAGE_FILE_CREATED";
226
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 26] = "MESSAGE_FILE_DELETED";
227
+ AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 27] = "NOTIFICATION_ADDED";
228
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 28] = "PROPERTY_UPDATED_WITH_DOCUMENT";
229
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 29] = "PROPERTY_DOCUMENT_ADDED";
230
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 30] = "PROPERTY_MOVEMENT_CREATED";
231
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 31] = "PROPERTY_MOVEMENT_UPDATED";
232
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 32] = "PROPERTY_MOVEMENT_DELETED";
233
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 33] = "PROPERTY_SHARE_UPDATED";
234
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 34] = "PROPERTY_SALE_ADDED";
235
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 35] = "PROPERTY_SALE_DELETED";
236
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 36] = "PROPERTY_SUBSCRIPTION_ADDED";
237
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 37] = "PROPERTY_SUBSCRIPTION_DELETED";
238
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 38] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
239
+ AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 39] = "SERVICE_SUBSCRIPTION_UPDATED";
240
+ AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 40] = "TAX_REVIEW_UPDATED";
241
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 41] = "TRANSACTION_CREATED";
242
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 42] = "TRANSACTION_DELETED";
243
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 43] = "TRANSACTION_UPDATED";
244
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 44] = "TRANSACTION_UPDATED_WITH_RECEIPT";
245
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 45] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
246
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 46] = "TRANSACTION_RECEIPT_CREATED";
247
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 47] = "TRANSACTION_RECEIPT_DELETED";
248
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 48] = "TRANSACTIONS_CREATED";
249
+ AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 49] = "USER_UPDATED";
250
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 50] = "VEHICLE_CLAIM_UPDATED";
251
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 51] = "VEHICLE_CLAIM_CREATED";
252
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 52] = "VEHICLE_CLAIM_DETAILS_UPDATED";
253
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 53] = "VEHICLE_CLAIM_DETAILS_CREATED";
254
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 54] = "VEHICLE_LOGBOOK_CREATED";
255
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 55] = "VEHICLE_LOGBOOK_UPDATED";
256
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 56] = "VEHICLE_LOGBOOK_DELETED";
257
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 57] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
255
258
  })(AppEventTypeEnum || (AppEventTypeEnum = {}));
256
259
 
257
260
  class EventDispatcherService {
@@ -601,6 +604,8 @@ const ENDPOINTS = {
601
604
  DEPRECIATIONS_GET: new Endpoint('GET', '\\/depreciations'),
602
605
  DEPRECIATIONS_POST: new Endpoint('POST', '\\/depreciations'),
603
606
  DEPRECIATIONS_PUT: new Endpoint('PUT', '\\/depreciations\\/\\d+'),
607
+ DEPRECIATION_RECEIPTS_POST: new Endpoint('POST', '\\/depreciations\\/\\d+\\/receipts'),
608
+ DEPRECIATION_RECEIPTS_DELETE: new Endpoint('DELETE', '\\/depreciations\\/\\d+\\/receipts\\/\\d+'),
604
609
  EMPLOYEES_GET: new Endpoint('GET', '\\/employees'),
605
610
  EMPLOYEES_INVITES_GET: new Endpoint('GET', '\\/employees\\/\\invites'),
606
611
  EMPLOYEES_INVITES_DELETE: new Endpoint('DELETE', '\\/employees\\/\\invites\\/\\d+'),
@@ -2447,6 +2452,65 @@ __decorate([
2447
2452
  Type(() => SoleInvoiceTemplate)
2448
2453
  ], SoleInvoice.prototype, "template", void 0);
2449
2454
 
2455
+ /**
2456
+ * Class contains traveled kilometers and work usage percent in 12 weeks date range
2457
+ * @TODO Vik: Best period: move this and related logic to backend
2458
+ */
2459
+ class LogbookPeriod {
2460
+ isEndOfYear() {
2461
+ return this.to === new FinancialYear().endDate;
2462
+ }
2463
+ getWorkUsageByClaim(claim) {
2464
+ const claimKilometers = this.logbooks.getByVehicleClaim(claim).getClaimableLogbooks().kilometers;
2465
+ return Math.round(this.workUsage * (claimKilometers / this.kilometers));
2466
+ }
2467
+ }
2468
+ __decorate([
2469
+ Type(() => Date)
2470
+ ], LogbookPeriod.prototype, "from", void 0);
2471
+ __decorate([
2472
+ Type(() => Date)
2473
+ ], LogbookPeriod.prototype, "to", void 0);
2474
+
2475
+ class Vehicle$1 extends AbstractModel {
2476
+ }
2477
+
2478
+ class VehicleLogbook$1 extends AbstractModel {
2479
+ }
2480
+
2481
+ class VehicleLogbook extends VehicleLogbook$1 {
2482
+ get kilometers() {
2483
+ return this.odometerEnd - this.odometerStart;
2484
+ }
2485
+ get tankType() {
2486
+ return this.isSoleTank() ? TankTypeEnum.SOLE : TankTypeEnum.WORK;
2487
+ }
2488
+ isWorkTank() {
2489
+ return !this.business;
2490
+ }
2491
+ isSoleTank() {
2492
+ return !!this.business;
2493
+ }
2494
+ }
2495
+ /**
2496
+ * 12 weeks in milliseconds
2497
+ * "To work out your business-use percentage, you need to keep a logbook and the odometer readings for the logbook period.
2498
+ * The logbook period is a minimum continuous period of 12 weeks." © Nicole Kelly
2499
+ */
2500
+ VehicleLogbook.periodDuration = 7257600000;
2501
+ __decorate([
2502
+ Type(() => Date)
2503
+ ], VehicleLogbook.prototype, "date", void 0);
2504
+ __decorate([
2505
+ Type(() => SoleBusiness)
2506
+ ], VehicleLogbook.prototype, "business", void 0);
2507
+
2508
+ class Vehicle extends Vehicle$1 {
2509
+ }
2510
+ __decorate([
2511
+ Type(() => VehicleLogbook)
2512
+ ], Vehicle.prototype, "logbook", void 0);
2513
+
2450
2514
  class VehicleClaim$1 extends AbstractModel {
2451
2515
  }
2452
2516
 
@@ -3359,6 +3423,10 @@ class SoleBusiness extends SoleBusiness$1 {
3359
3423
  return this.logo;
3360
3424
  }
3361
3425
  }
3426
+ /**
3427
+ * Maximum number of businesses that a person can have, according to the ATO
3428
+ */
3429
+ SoleBusiness.businessesLimit = 6;
3362
3430
  __decorate([
3363
3431
  Type(() => User)
3364
3432
  ], SoleBusiness.prototype, "user", void 0);
@@ -4652,65 +4720,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
4652
4720
  }]
4653
4721
  }] });
4654
4722
 
4655
- /**
4656
- * Class contains traveled kilometers and work usage percent in 12 weeks date range
4657
- * @TODO Vik: Best period: move this and related logic to backend
4658
- */
4659
- class LogbookPeriod {
4660
- isEndOfYear() {
4661
- return this.to === new FinancialYear().endDate;
4662
- }
4663
- getWorkUsageByClaim(claim) {
4664
- const claimKilometers = this.logbooks.getByVehicleClaim(claim).getClaimableLogbooks().kilometers;
4665
- return Math.round(this.workUsage * (claimKilometers / this.kilometers));
4666
- }
4667
- }
4668
- __decorate([
4669
- Type(() => Date)
4670
- ], LogbookPeriod.prototype, "from", void 0);
4671
- __decorate([
4672
- Type(() => Date)
4673
- ], LogbookPeriod.prototype, "to", void 0);
4674
-
4675
- class Vehicle$1 extends AbstractModel {
4676
- }
4677
-
4678
- class VehicleLogbook$1 extends AbstractModel {
4679
- }
4680
-
4681
- class VehicleLogbook extends VehicleLogbook$1 {
4682
- get kilometers() {
4683
- return this.odometerEnd - this.odometerStart;
4684
- }
4685
- get tankType() {
4686
- return this.isSoleTank() ? TankTypeEnum.SOLE : TankTypeEnum.WORK;
4687
- }
4688
- isWorkTank() {
4689
- return !this.business;
4690
- }
4691
- isSoleTank() {
4692
- return !!this.business;
4693
- }
4694
- }
4695
- /**
4696
- * 12 weeks in milliseconds
4697
- * "To work out your business-use percentage, you need to keep a logbook and the odometer readings for the logbook period.
4698
- * The logbook period is a minimum continuous period of 12 weeks." © Nicole Kelly
4699
- */
4700
- VehicleLogbook.periodDuration = 7257600000;
4701
- __decorate([
4702
- Type(() => Date)
4703
- ], VehicleLogbook.prototype, "date", void 0);
4704
- __decorate([
4705
- Type(() => SoleBusiness)
4706
- ], VehicleLogbook.prototype, "business", void 0);
4707
-
4708
- class Vehicle extends Vehicle$1 {
4709
- }
4710
- __decorate([
4711
- Type(() => VehicleLogbook)
4712
- ], Vehicle.prototype, "logbook", void 0);
4713
-
4714
4723
  class VehicleClaimCollection extends Collection {
4715
4724
  /**
4716
4725
  * Get remaining kilometers limit. Total limit ({@link VehicleClaim.totalKmsLimit}) - claimed kilometers from other vehicle claims
@@ -9037,6 +9046,123 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
9037
9046
  }]
9038
9047
  }] });
9039
9048
 
9049
+ /**
9050
+ * Service that works with Occupations
9051
+ */
9052
+ class OccupationService {
9053
+ constructor(http, environment) {
9054
+ this.http = http;
9055
+ this.environment = environment;
9056
+ this.occupationsSubject = new ReplaySubject(1);
9057
+ }
9058
+ /**
9059
+ * Get list of occupations
9060
+ */
9061
+ getOccupations() {
9062
+ if (!this._occupations) {
9063
+ this.http.get(`${this.environment.apiV2}/occupations`)
9064
+ .pipe(map((response) => {
9065
+ return response.map((item) => plainToClass(Occupation, item));
9066
+ }))
9067
+ .subscribe((occupations) => {
9068
+ this._occupations = occupations;
9069
+ this.occupationsSubject.next(occupations);
9070
+ });
9071
+ }
9072
+ return this.occupationsSubject.asObservable();
9073
+ }
9074
+ }
9075
+ OccupationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OccupationService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
9076
+ OccupationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OccupationService, providedIn: 'root' });
9077
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OccupationService, decorators: [{
9078
+ type: Injectable,
9079
+ args: [{
9080
+ providedIn: 'root'
9081
+ }]
9082
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
9083
+ type: Inject,
9084
+ args: ['environment']
9085
+ }] }]; } });
9086
+
9087
+ class UserEventSettingService extends RestService {
9088
+ constructor() {
9089
+ super(...arguments);
9090
+ this.modelClass = UserEventSetting;
9091
+ this.url = 'user-event-settings';
9092
+ this.isHydra = true;
9093
+ }
9094
+ /**
9095
+ * Send batch to add/updated settings
9096
+ */
9097
+ saveBatch(settings) {
9098
+ // batch with post/put requests based on setting id
9099
+ const batch = settings.map((setting) => {
9100
+ setting.isUpdating = true;
9101
+ if (setting.id) {
9102
+ return this.http.put(`${this.environment.apiV2}/${this.url}/${setting.id}`, classToPlain(setting));
9103
+ }
9104
+ return this.http.post(`${this.environment.apiV2}/${this.url}`, classToPlain(setting));
9105
+ });
9106
+ return forkJoin(batch).pipe(map((eventSettings) => {
9107
+ eventSettings.forEach((eventSetting) => {
9108
+ // get setting from cache by saved setting id
9109
+ const cachedSetting = this.cache.find((setting) => setting.id === eventSetting.id);
9110
+ if (cachedSetting) {
9111
+ replace(this.cache, eventSetting);
9112
+ }
9113
+ else {
9114
+ this.cache.push(plainToClass(UserEventSetting, eventSetting));
9115
+ }
9116
+ });
9117
+ this.updateCache();
9118
+ }));
9119
+ }
9120
+ }
9121
+ UserEventSettingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventSettingService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
9122
+ UserEventSettingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventSettingService, providedIn: 'root' });
9123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventSettingService, decorators: [{
9124
+ type: Injectable,
9125
+ args: [{
9126
+ providedIn: 'root'
9127
+ }]
9128
+ }] });
9129
+
9130
+ class UserEventTypeService extends RestService {
9131
+ constructor() {
9132
+ super(...arguments);
9133
+ this.modelClass = UserEventType;
9134
+ this.url = 'user-event-types';
9135
+ this.isHydra = true;
9136
+ }
9137
+ }
9138
+ UserEventTypeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventTypeService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
9139
+ UserEventTypeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventTypeService, providedIn: 'root' });
9140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventTypeService, decorators: [{
9141
+ type: Injectable,
9142
+ args: [{
9143
+ providedIn: 'root'
9144
+ }]
9145
+ }] });
9146
+
9147
+ /**
9148
+ * Service to work with invitations for unregistered users
9149
+ */
9150
+ class UsersInviteService extends RestService {
9151
+ constructor() {
9152
+ super(...arguments);
9153
+ this.modelClass = RegistrationInvite;
9154
+ this.url = 'users/invite';
9155
+ }
9156
+ }
9157
+ UsersInviteService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UsersInviteService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
9158
+ UsersInviteService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UsersInviteService, providedIn: 'root' });
9159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UsersInviteService, decorators: [{
9160
+ type: Injectable,
9161
+ args: [{
9162
+ providedIn: 'root'
9163
+ }]
9164
+ }] });
9165
+
9040
9166
  /**
9041
9167
  * Service for logbook best period calculation
9042
9168
  * @TODO Vik: improve structure for such cases (TT-2043)
@@ -9611,57 +9737,94 @@ function enumToList(data) {
9611
9737
  return list;
9612
9738
  }
9613
9739
 
9614
- class TransactionReceiptService {
9615
- constructor(http, eventDispatcherService, environment) {
9740
+ /**
9741
+ * Abstract service class to work with transactions-like receipt files (transactions, depreciations, e.t.c.)
9742
+ * @Todo TT-2191 refactor service when receipts API will be updated
9743
+ */
9744
+ class ReceiptService {
9745
+ constructor(http, eventDispatcherService, environment, toastService) {
9616
9746
  this.http = http;
9617
9747
  this.eventDispatcherService = eventDispatcherService;
9618
9748
  this.environment = environment;
9619
- this.url = 'receipts';
9620
- this.listenEvents();
9749
+ this.toastService = toastService;
9750
+ }
9751
+ listenEvents() {
9752
+ this.listenParentWithReceiptUpdated();
9753
+ this.listenParentWithoutReceiptUpdated();
9621
9754
  }
9622
9755
  /**
9623
- * Transaction instance is necessary to take the ID and the receipt file from it.
9756
+ * Entity is necessary to take the ID and the receipt file from it.
9624
9757
  */
9625
- add(transaction) {
9758
+ add(receiptEntity) {
9626
9759
  const formData = new FormData();
9627
- formData.append('file', transaction.file);
9628
- this.http.post(`${this.environment.apiV2}/transactions/${transaction.id}/${this.url}`, formData)
9629
- .subscribe((receiptResponse) => {
9630
- this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.TRANSACTION_RECEIPT_CREATED, plainToClass(TransactionReceipt, receiptResponse)));
9631
- });
9760
+ formData.append('file', receiptEntity.file);
9761
+ return this.http.post(`${this.environment.apiV2}/${this.entityType}/${receiptEntity.id}/receipts`, formData)
9762
+ .pipe(map((receipt) => {
9763
+ const uploadedReceipt = this.createModelInstance(receipt);
9764
+ this.eventDispatcherService.dispatch(new AppEvent(this.receiptCreatedEvent, uploadedReceipt));
9765
+ return uploadedReceipt;
9766
+ }));
9767
+ }
9768
+ delete(receiptEntity) {
9769
+ return this.http.delete(`${this.environment.apiV2}/${this.entityType}/${receiptEntity.id}/receipts/${receiptEntity.receipt.id}`)
9770
+ .pipe(map(() => {
9771
+ this.eventDispatcherService.dispatch(new AppEvent(this.receiptDeletedEvent, receiptEntity));
9772
+ }));
9632
9773
  }
9633
9774
  /**
9634
- * Transaction instance is necessary to take the ID and the receipt ID from it.
9775
+ * Parent entity was updated with attached receipt
9635
9776
  */
9636
- delete(transaction) {
9637
- this.http.delete(`${this.environment.apiV2}/transactions/${transaction.id}/${this.url}/${transaction.receipt.id}`)
9638
- .subscribe(() => {
9639
- this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.TRANSACTION_RECEIPT_DELETED, transaction));
9640
- });
9641
- }
9642
- listenEvents() {
9643
- this.listenTransactionWithReceiptUpdated();
9644
- this.listenTransactionWithoutReceiptUpdated();
9645
- }
9646
- listenTransactionWithReceiptUpdated() {
9647
- this.eventDispatcherService.on([
9648
- AppEventTypeEnum.TRANSACTION_CREATED_WITH_NEW_RECEIPT,
9649
- AppEventTypeEnum.TRANSACTION_UPDATED_WITH_NEW_RECEIPT
9650
- ]).subscribe((transaction) => {
9651
- this.add(transaction);
9777
+ listenParentWithReceiptUpdated() {
9778
+ this.eventDispatcherService.on(this.entityUpdatedWithReceiptEvent)
9779
+ .subscribe((receiptEntity) => {
9780
+ this.add(receiptEntity).subscribe();
9652
9781
  });
9653
9782
  }
9654
9783
  /**
9655
- * Case when transaction was updated, but receipt was removed
9784
+ * Parent entity was updated, but receipt was removed
9656
9785
  */
9657
- listenTransactionWithoutReceiptUpdated() {
9658
- this.eventDispatcherService.on(AppEventTypeEnum.TRANSACTION_UPDATED_WITH_DELETED_RECEIPT)
9659
- .subscribe((transaction) => {
9660
- this.delete(transaction);
9786
+ listenParentWithoutReceiptUpdated() {
9787
+ this.eventDispatcherService.on(this.entityUpdatedWithDeletedReceiptEvent)
9788
+ .subscribe((receiptEntity) => {
9789
+ this.delete(receiptEntity).subscribe();
9661
9790
  });
9662
9791
  }
9792
+ createModelInstance(data) {
9793
+ return plainToClass(this.modelClass, data);
9794
+ }
9663
9795
  }
9664
- TransactionReceiptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TransactionReceiptService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
9796
+ ReceiptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ReceiptService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
9797
+ ReceiptService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ReceiptService, providedIn: 'root' });
9798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ReceiptService, decorators: [{
9799
+ type: Injectable,
9800
+ args: [{
9801
+ providedIn: 'root'
9802
+ }]
9803
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
9804
+ type: Inject,
9805
+ args: ['environment']
9806
+ }] }, { type: ToastService }]; } });
9807
+
9808
+ /**
9809
+ * @Todo TT-2191 refactor service when receipts API will be updated
9810
+ */
9811
+ class TransactionReceiptService extends ReceiptService {
9812
+ constructor(http, eventDispatcherService, environment, toastService) {
9813
+ super(http, eventDispatcherService, environment, toastService);
9814
+ this.http = http;
9815
+ this.eventDispatcherService = eventDispatcherService;
9816
+ this.environment = environment;
9817
+ this.toastService = toastService;
9818
+ this.modelClass = TransactionReceipt;
9819
+ this.entityType = AssetEntityTypeEnum.TRANSACTIONS;
9820
+ this.receiptCreatedEvent = AppEventTypeEnum.TRANSACTION_RECEIPT_CREATED;
9821
+ this.receiptDeletedEvent = AppEventTypeEnum.TRANSACTION_RECEIPT_DELETED;
9822
+ this.entityUpdatedWithReceiptEvent = AppEventTypeEnum.TRANSACTION_UPDATED_WITH_RECEIPT;
9823
+ this.entityUpdatedWithDeletedReceiptEvent = AppEventTypeEnum.TRANSACTION_UPDATED_WITH_DELETED_RECEIPT;
9824
+ this.listenEvents();
9825
+ }
9826
+ }
9827
+ TransactionReceiptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TransactionReceiptService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
9665
9828
  TransactionReceiptService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TransactionReceiptService, providedIn: 'root' });
9666
9829
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TransactionReceiptService, decorators: [{
9667
9830
  type: Injectable,
@@ -9671,7 +9834,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
9671
9834
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
9672
9835
  type: Inject,
9673
9836
  args: ['environment']
9674
- }] }]; } });
9837
+ }] }, { type: ToastService }]; } });
9675
9838
 
9676
9839
  /**
9677
9840
  * Service for transactions business logic
@@ -9788,10 +9951,10 @@ class TransactionService extends RestService {
9788
9951
  transactions.forEach((transaction, index) => {
9789
9952
  // @TODO backend: need to upload file in the same backend endpoint with transaction add/update
9790
9953
  // check if passed receipt and upload file
9791
- if (transaction.file && (transaction.file instanceof File)) {
9954
+ if (transaction.file) {
9792
9955
  transaction.id = response[index].id;
9793
9956
  addedTransactions[index].file = transaction.file;
9794
- this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.TRANSACTION_CREATED_WITH_NEW_RECEIPT, addedTransactions[index]));
9957
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.TRANSACTION_UPDATED_WITH_RECEIPT, addedTransactions[index]));
9795
9958
  }
9796
9959
  // @TODO Viktor: implement API for saving of nested transactions
9797
9960
  // add child transactions if exist
@@ -9824,9 +9987,9 @@ class TransactionService extends RestService {
9824
9987
  const updatedTransaction = plainToClass(Transaction, response);
9825
9988
  // @TODO need to upload file in the same backend endpoint with transaction add/update
9826
9989
  // check if passed new receipt and upload file
9827
- if (transaction.file && (transaction.file instanceof File)) {
9990
+ if (transaction.file) {
9828
9991
  updatedTransaction.file = transaction.file;
9829
- this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.TRANSACTION_UPDATED_WITH_NEW_RECEIPT, updatedTransaction));
9992
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.TRANSACTION_UPDATED_WITH_RECEIPT, updatedTransaction));
9830
9993
  // receipt file was removed from form - we should delete receipt from transaction
9831
9994
  }
9832
9995
  else if (!transaction.file && transaction.receipt) {
@@ -9850,8 +10013,7 @@ class TransactionService extends RestService {
9850
10013
  this.addBatch(childTransactionsToAdd).subscribe();
9851
10014
  }
9852
10015
  }
9853
- replace(this.cache, updatedTransaction);
9854
- this.updateCache();
10016
+ this.replaceInCache(updatedTransaction);
9855
10017
  return updatedTransaction;
9856
10018
  }));
9857
10019
  }
@@ -9965,16 +10127,14 @@ class TransactionService extends RestService {
9965
10127
  // we don't need to keep file after save
9966
10128
  transactionToUpdate.file = null;
9967
10129
  transactionToUpdate.receipt = transactionReceipt;
9968
- replace(this.cache, transactionToUpdate);
9969
- this.updateCache();
10130
+ this.replaceInCache(transactionToUpdate);
9970
10131
  });
9971
10132
  }
9972
10133
  listenReceiptDeleted() {
9973
10134
  this.eventDispatcherService.on(AppEventTypeEnum.TRANSACTION_RECEIPT_DELETED).subscribe((transaction) => {
9974
10135
  const transactionToUpdate = this.find(transaction.id);
9975
10136
  transactionToUpdate.receipt = null;
9976
- replace(this.cache, transactionToUpdate);
9977
- this.updateCache();
10137
+ this.replaceInCache(transactionToUpdate);
9978
10138
  });
9979
10139
  }
9980
10140
  listenVehicleClaimChanges() {
@@ -9987,6 +10147,10 @@ class TransactionService extends RestService {
9987
10147
  this.resetCache();
9988
10148
  });
9989
10149
  }
10150
+ replaceInCache(transactionToReplace) {
10151
+ replace(this.cache, transactionToReplace);
10152
+ this.updateCache();
10153
+ }
9990
10154
  }
9991
10155
  TransactionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TransactionService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }, { token: TransactionReceiptService }], target: i0.ɵɵFactoryTarget.Injectable });
9992
10156
  TransactionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TransactionService, providedIn: 'root' });
@@ -11076,62 +11240,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
11076
11240
  }] }]; } });
11077
11241
 
11078
11242
  /**
11079
- * Service for work with DepreciationCapitalProjects
11243
+ * @Todo TT-2191 refactor service when receipts API will be updated
11080
11244
  */
11081
- class DepreciationCapitalProjectService {
11082
- constructor(http, environment) {
11245
+ class DepreciationReceiptService extends ReceiptService {
11246
+ constructor(http, eventDispatcherService, environment, toastService) {
11247
+ super(http, eventDispatcherService, environment, toastService);
11083
11248
  this.http = http;
11249
+ this.eventDispatcherService = eventDispatcherService;
11084
11250
  this.environment = environment;
11085
- this.cacheSubject = new ReplaySubject(1);
11086
- }
11087
- get(propertyId) {
11088
- this.cacheSubject.next([]);
11089
- this.http.get(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects`)
11090
- .subscribe((capitalProjectsBase) => {
11091
- this.cache = capitalProjectsBase.map((capitalProjectBase) => {
11092
- return plainToClass(DepreciationCapitalProject, capitalProjectBase);
11093
- });
11094
- this.cacheSubject.next(this.cache);
11095
- });
11096
- return this.cacheSubject.asObservable();
11097
- }
11098
- add(capitalProject, propertyId) {
11099
- return this.http.post(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects`, capitalProject)
11100
- .pipe(map((capitalProjectBase) => {
11101
- this.cache.push(plainToClass(DepreciationCapitalProject, capitalProjectBase));
11102
- this.cacheSubject.next(this.cache);
11103
- }));
11104
- }
11105
- update(capitalProject, propertyId) {
11106
- return this.http.put(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects/${capitalProject.id}`, capitalProject)
11107
- .pipe(map((capitalProjectBase) => {
11108
- replace(this.cache, plainToClass(DepreciationCapitalProject, capitalProjectBase));
11109
- this.cacheSubject.next(this.cache);
11110
- }));
11111
- }
11112
- delete(capitalProject, propertyId) {
11113
- return this.http.delete(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects/${capitalProject.id}`)
11114
- .pipe(map(() => {
11115
- this.cache = this.cache.filter((item) => capitalProject.id !== item.id);
11116
- this.cacheSubject.next(this.cache);
11117
- }));
11251
+ this.toastService = toastService;
11252
+ this.modelClass = DepreciationReceipt;
11253
+ this.entityType = AssetEntityTypeEnum.DEPRECIATIONS;
11254
+ this.receiptCreatedEvent = AppEventTypeEnum.DEPRECIATION_RECEIPT_CREATED;
11255
+ this.receiptDeletedEvent = AppEventTypeEnum.DEPRECIATION_RECEIPT_DELETED;
11256
+ this.entityUpdatedWithDeletedReceiptEvent = AppEventTypeEnum.DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT;
11257
+ this.entityUpdatedWithReceiptEvent = AppEventTypeEnum.DEPRECIATION_UPDATED_WITH_RECEIPT;
11258
+ this.listenEvents();
11118
11259
  }
11119
11260
  }
11120
- DepreciationCapitalProjectService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationCapitalProjectService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
11121
- DepreciationCapitalProjectService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationCapitalProjectService, providedIn: 'root' });
11122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationCapitalProjectService, decorators: [{
11261
+ DepreciationReceiptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationReceiptService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
11262
+ DepreciationReceiptService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationReceiptService, providedIn: 'root' });
11263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationReceiptService, decorators: [{
11123
11264
  type: Injectable,
11124
11265
  args: [{
11125
11266
  providedIn: 'root'
11126
11267
  }]
11127
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
11268
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
11128
11269
  type: Inject,
11129
11270
  args: ['environment']
11130
- }] }]; } });
11271
+ }] }, { type: ToastService }]; } });
11131
11272
 
11132
11273
  class DepreciationService extends RestService {
11133
- constructor() {
11134
- super(...arguments);
11274
+ constructor(http, eventDispatcherService, environment, toastService, depreciationReceiptService) {
11275
+ super(http, eventDispatcherService, environment, toastService);
11276
+ this.http = http;
11277
+ this.eventDispatcherService = eventDispatcherService;
11278
+ this.environment = environment;
11279
+ this.toastService = toastService;
11280
+ this.depreciationReceiptService = depreciationReceiptService;
11135
11281
  this.modelClass = Depreciation;
11136
11282
  this.url = 'depreciations';
11137
11283
  }
@@ -11152,15 +11298,41 @@ class DepreciationService extends RestService {
11152
11298
  */
11153
11299
  addBatch(depreciations) {
11154
11300
  return super.addBatch(depreciations).pipe(map((newDepreciations) => {
11301
+ depreciations.forEach((depreciation, index) => {
11302
+ // @TODO backend: need to upload file in the same backend endpoint with depreciation add/update
11303
+ // check if passed receipt and upload file
11304
+ if (depreciation.file && (depreciation.file instanceof File)) {
11305
+ depreciation.id = newDepreciations[index].id;
11306
+ newDepreciations[index].file = depreciation.file;
11307
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.DEPRECIATION_UPDATED_WITH_RECEIPT, newDepreciations[index]));
11308
+ }
11309
+ });
11155
11310
  this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.DEPRECIATIONS_CREATED, newDepreciations));
11156
11311
  return newDepreciations;
11157
11312
  }));
11158
11313
  }
11314
+ update(depreciation) {
11315
+ return super.update(depreciation).pipe(map((updatedDepreciation) => {
11316
+ // @TODO need to upload file in the same backend endpoint with depreciation add/update
11317
+ // check if passed new receipt and upload file
11318
+ if (depreciation.file && (depreciation.file instanceof File)) {
11319
+ updatedDepreciation.file = depreciation.file;
11320
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.DEPRECIATION_UPDATED_WITH_RECEIPT, updatedDepreciation));
11321
+ // receipt file was removed from form - we should delete receipt from transaction
11322
+ }
11323
+ else if (!depreciation.file && depreciation.receipt) {
11324
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT, updatedDepreciation));
11325
+ }
11326
+ return updatedDepreciation;
11327
+ }));
11328
+ }
11159
11329
  /**
11160
11330
  * Listen to Depreciations events
11161
11331
  */
11162
11332
  listenEvents() {
11163
11333
  this.listenToUpdatedLoan();
11334
+ this.listenReceiptAdded();
11335
+ this.listenReceiptDeleted();
11164
11336
  this.listenVehicleClaimChanges();
11165
11337
  this.listenToUpdatedBankAccount();
11166
11338
  }
@@ -11170,21 +11342,20 @@ class DepreciationService extends RestService {
11170
11342
  return response || 0;
11171
11343
  }));
11172
11344
  }
11173
- /**
11174
- * Upload depreciation receipt
11175
- * @param depreciation for which will be uploaded receipt
11176
- */
11177
- uploadReceipt(depreciation) {
11178
- const formData = new FormData();
11179
- formData.append('file', depreciation.file);
11180
- depreciation.receipt = null;
11181
- this.http.post(`${this.environment.apiV2}/${this.url}/${depreciation.id}/receipts`, formData)
11182
- .subscribe((receiptResponse) => {
11345
+ listenReceiptAdded() {
11346
+ this.eventDispatcherService.on(AppEventTypeEnum.DEPRECIATION_RECEIPT_CREATED).subscribe((receipt) => {
11347
+ const depreciationToUpdate = this.find(receipt.depreciation.id);
11183
11348
  // we don't need to keep file after save
11184
- depreciation.file = null;
11185
- depreciation.receipt = plainToClass(DepreciationReceipt, receiptResponse);
11186
- replace(this.cache, depreciation);
11187
- this.cacheSubject.next(this.cache.slice());
11349
+ depreciationToUpdate.file = null;
11350
+ depreciationToUpdate.receipt = receipt;
11351
+ this.replaceInCache(depreciationToUpdate);
11352
+ });
11353
+ }
11354
+ listenReceiptDeleted() {
11355
+ this.eventDispatcherService.on(AppEventTypeEnum.DEPRECIATION_RECEIPT_DELETED).subscribe((depreciation) => {
11356
+ const depreciationToUpdate = this.find(depreciation.id);
11357
+ depreciationToUpdate.receipt = null;
11358
+ this.replaceInCache(depreciationToUpdate);
11188
11359
  });
11189
11360
  }
11190
11361
  /**
@@ -11218,15 +11389,76 @@ class DepreciationService extends RestService {
11218
11389
  this.resetCache();
11219
11390
  });
11220
11391
  }
11392
+ replaceInCache(depreciationToReplace) {
11393
+ replace(this.cache, depreciationToReplace);
11394
+ this.updateCache();
11395
+ }
11221
11396
  }
11222
- DepreciationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
11397
+ DepreciationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }, { token: DepreciationReceiptService }], target: i0.ɵɵFactoryTarget.Injectable });
11223
11398
  DepreciationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationService, providedIn: 'root' });
11224
11399
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationService, decorators: [{
11225
11400
  type: Injectable,
11226
11401
  args: [{
11227
11402
  providedIn: 'root'
11228
11403
  }]
11229
- }] });
11404
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
11405
+ type: Inject,
11406
+ args: ['environment']
11407
+ }] }, { type: ToastService }, { type: DepreciationReceiptService }]; } });
11408
+
11409
+ /**
11410
+ * Service for work with DepreciationCapitalProjects
11411
+ */
11412
+ class DepreciationCapitalProjectService {
11413
+ constructor(http, environment) {
11414
+ this.http = http;
11415
+ this.environment = environment;
11416
+ this.cacheSubject = new ReplaySubject(1);
11417
+ }
11418
+ get(propertyId) {
11419
+ this.cacheSubject.next([]);
11420
+ this.http.get(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects`)
11421
+ .subscribe((capitalProjectsBase) => {
11422
+ this.cache = capitalProjectsBase.map((capitalProjectBase) => {
11423
+ return plainToClass(DepreciationCapitalProject, capitalProjectBase);
11424
+ });
11425
+ this.cacheSubject.next(this.cache);
11426
+ });
11427
+ return this.cacheSubject.asObservable();
11428
+ }
11429
+ add(capitalProject, propertyId) {
11430
+ return this.http.post(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects`, capitalProject)
11431
+ .pipe(map((capitalProjectBase) => {
11432
+ this.cache.push(plainToClass(DepreciationCapitalProject, capitalProjectBase));
11433
+ this.cacheSubject.next(this.cache);
11434
+ }));
11435
+ }
11436
+ update(capitalProject, propertyId) {
11437
+ return this.http.put(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects/${capitalProject.id}`, capitalProject)
11438
+ .pipe(map((capitalProjectBase) => {
11439
+ replace(this.cache, plainToClass(DepreciationCapitalProject, capitalProjectBase));
11440
+ this.cacheSubject.next(this.cache);
11441
+ }));
11442
+ }
11443
+ delete(capitalProject, propertyId) {
11444
+ return this.http.delete(`${this.environment.apiV2}/properties/${propertyId}/depreciation-capital-projects/${capitalProject.id}`)
11445
+ .pipe(map(() => {
11446
+ this.cache = this.cache.filter((item) => capitalProject.id !== item.id);
11447
+ this.cacheSubject.next(this.cache);
11448
+ }));
11449
+ }
11450
+ }
11451
+ DepreciationCapitalProjectService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationCapitalProjectService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
11452
+ DepreciationCapitalProjectService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationCapitalProjectService, providedIn: 'root' });
11453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DepreciationCapitalProjectService, decorators: [{
11454
+ type: Injectable,
11455
+ args: [{
11456
+ providedIn: 'root'
11457
+ }]
11458
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
11459
+ type: Inject,
11460
+ args: ['environment']
11461
+ }] }]; } });
11230
11462
 
11231
11463
  /**
11232
11464
  * Service to handle document-folders and depending documents logic
@@ -13026,44 +13258,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
13026
13258
  }]
13027
13259
  }] });
13028
13260
 
13029
- /**
13030
- * Service that works with Occupations
13031
- */
13032
- class OccupationService {
13033
- constructor(http, environment) {
13034
- this.http = http;
13035
- this.environment = environment;
13036
- this.occupationsSubject = new ReplaySubject(1);
13037
- }
13038
- /**
13039
- * Get list of occupations
13040
- */
13041
- getOccupations() {
13042
- if (!this._occupations) {
13043
- this.http.get(`${this.environment.apiV2}/occupations`)
13044
- .pipe(map((response) => {
13045
- return response.map((item) => plainToClass(Occupation, item));
13046
- }))
13047
- .subscribe((occupations) => {
13048
- this._occupations = occupations;
13049
- this.occupationsSubject.next(occupations);
13050
- });
13051
- }
13052
- return this.occupationsSubject.asObservable();
13053
- }
13054
- }
13055
- OccupationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OccupationService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
13056
- OccupationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OccupationService, providedIn: 'root' });
13057
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OccupationService, decorators: [{
13058
- type: Injectable,
13059
- args: [{
13060
- providedIn: 'root'
13061
- }]
13062
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
13063
- type: Inject,
13064
- args: ['environment']
13065
- }] }]; } });
13066
-
13067
13261
  /**
13068
13262
  * Service to work with user
13069
13263
  */
@@ -13210,66 +13404,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
13210
13404
  args: ['environment']
13211
13405
  }] }]; } });
13212
13406
 
13213
- class UserEventSettingService extends RestService {
13214
- constructor() {
13215
- super(...arguments);
13216
- this.modelClass = UserEventSetting;
13217
- this.url = 'user-event-settings';
13218
- this.isHydra = true;
13219
- }
13220
- /**
13221
- * Send batch to add/updated settings
13222
- */
13223
- saveBatch(settings) {
13224
- // batch with post/put requests based on setting id
13225
- const batch = settings.map((setting) => {
13226
- setting.isUpdating = true;
13227
- if (setting.id) {
13228
- return this.http.put(`${this.environment.apiV2}/${this.url}/${setting.id}`, classToPlain(setting));
13229
- }
13230
- return this.http.post(`${this.environment.apiV2}/${this.url}`, classToPlain(setting));
13231
- });
13232
- return forkJoin(batch).pipe(map((eventSettings) => {
13233
- eventSettings.forEach((eventSetting) => {
13234
- // get setting from cache by saved setting id
13235
- const cachedSetting = this.cache.find((setting) => setting.id === eventSetting.id);
13236
- if (cachedSetting) {
13237
- replace(this.cache, eventSetting);
13238
- }
13239
- else {
13240
- this.cache.push(plainToClass(UserEventSetting, eventSetting));
13241
- }
13242
- });
13243
- this.updateCache();
13244
- }));
13245
- }
13246
- }
13247
- UserEventSettingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventSettingService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
13248
- UserEventSettingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventSettingService, providedIn: 'root' });
13249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventSettingService, decorators: [{
13250
- type: Injectable,
13251
- args: [{
13252
- providedIn: 'root'
13253
- }]
13254
- }] });
13255
-
13256
- class UserEventTypeService extends RestService {
13257
- constructor() {
13258
- super(...arguments);
13259
- this.modelClass = UserEventType;
13260
- this.url = 'user-event-types';
13261
- this.isHydra = true;
13262
- }
13263
- }
13264
- UserEventTypeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventTypeService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
13265
- UserEventTypeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventTypeService, providedIn: 'root' });
13266
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserEventTypeService, decorators: [{
13267
- type: Injectable,
13268
- args: [{
13269
- providedIn: 'root'
13270
- }]
13271
- }] });
13272
-
13273
13407
  /**
13274
13408
  * Service to work with XLSX (generate, download, e.t.c.)
13275
13409
  */
@@ -14703,5 +14837,5 @@ VehicleLogbookForm.maxDescriptionLength = 60;
14703
14837
  * Generated bundle index. Do not edit.
14704
14838
  */
14705
14839
 
14706
- 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, 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, DepreciationReportItem, DepreciationReportItemCollection, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Dictionary, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, 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, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleService, PropertySaleTaxExemptionMetadata, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, 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, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceItem, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, 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, 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, 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 };
14840
+ 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, 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, 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, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleService, PropertySaleTaxExemptionMetadata, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, 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, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceItem, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, 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, 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 };
14707
14841
  //# sourceMappingURL=taxtank-core.js.map