taxtank-core 0.27.7 → 0.28.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.
- package/bundles/taxtank-core.umd.js +412 -245
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/income-source.collection.js +4 -1
- package/esm2015/lib/collections/index.js +2 -1
- package/esm2015/lib/collections/sole/index.js +2 -0
- package/esm2015/lib/collections/sole/sole-invoice.collection.js +13 -0
- package/esm2015/lib/collections/vehicle/vehicle-logbook.collection.js +2 -2
- package/esm2015/lib/db/Models/sole/sole-business-loss.js +1 -1
- package/esm2015/lib/db/Models/sole/sole-business.js +1 -1
- package/esm2015/lib/forms/sole/sole-business.form.js +32 -2
- package/esm2015/lib/forms/sole/sole-details.form.js +3 -2
- package/esm2015/lib/interceptors/basiq-client-id.interceptor.js +31 -0
- package/esm2015/lib/interceptors/basiq-token.interceptor.js +35 -0
- package/esm2015/lib/interceptors/interceptors.module.js +15 -4
- package/esm2015/lib/models/endpoint/endpoints.const.js +2 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +23 -20
- package/esm2015/lib/models/sole/sole-business.js +5 -1
- package/esm2015/lib/models/sole/sole-invoice.js +7 -1
- package/esm2015/lib/models/vehicle/vehicle-logbook.js +4 -4
- package/esm2015/lib/services/http/income-source/income-source.service.js +12 -1
- package/esm2015/lib/services/http/sole/sole-business/sole-business.service.js +10 -1
- package/esm2015/lib/services/http/sole/sole-depreciation-method/sole-depreciation-method.service.js +12 -1
- package/esm2015/lib/services/http/sole/sole-details/sole-details.service.js +10 -4
- package/esm2015/lib/services/http/user/user.service.js +12 -1
- package/esm2015/lib/validators/required-length.validator.js +12 -0
- package/fesm2015/taxtank-core.js +372 -226
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/income-source.collection.d.ts +1 -0
- package/lib/collections/index.d.ts +1 -0
- package/lib/collections/sole/index.d.ts +1 -0
- package/lib/collections/sole/sole-invoice.collection.d.ts +7 -0
- package/lib/db/Models/sole/sole-business-loss.d.ts +2 -3
- package/lib/db/Models/sole/sole-business.d.ts +2 -0
- package/lib/forms/sole/sole-business.form.d.ts +3 -0
- package/lib/interceptors/basiq-client-id.interceptor.d.ts +15 -0
- package/lib/interceptors/{basiq.interceptor.d.ts → basiq-token.interceptor.d.ts} +3 -3
- package/lib/models/event/app-event-type.enum.d.ts +22 -19
- package/lib/models/sole/sole-business.d.ts +2 -0
- package/lib/models/sole/sole-invoice.d.ts +2 -0
- package/lib/models/vehicle/vehicle-logbook.d.ts +2 -2
- package/lib/services/http/income-source/income-source.service.d.ts +7 -1
- package/lib/services/http/sole/sole-business/sole-business.service.d.ts +2 -0
- package/lib/services/http/sole/sole-depreciation-method/sole-depreciation-method.service.d.ts +4 -1
- package/lib/services/http/sole/sole-details/sole-details.service.d.ts +3 -1
- package/lib/services/http/user/user.service.d.ts +4 -0
- package/lib/validators/required-length.validator.d.ts +5 -0
- package/package.json +1 -1
- package/esm2015/lib/interceptors/basiq.interceptor.js +0 -35
package/fesm2015/taxtank-core.js
CHANGED
|
@@ -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, forkJoin,
|
|
7
|
+
import { ReplaySubject, Subject, BehaviorSubject, throwError, Observable, combineLatest, forkJoin, of, 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';
|
|
@@ -20,12 +20,12 @@ import uniqBy from 'lodash/uniqBy';
|
|
|
20
20
|
import concat from 'lodash/concat';
|
|
21
21
|
import { throwError as throwError$1 } from 'rxjs/internal/observable/throwError';
|
|
22
22
|
import cloneDeep$1 from 'lodash/cloneDeep';
|
|
23
|
+
import { EventSourcePolyfill } from 'event-source-polyfill/src/eventsource.min.js';
|
|
23
24
|
import compact from 'lodash/compact';
|
|
24
25
|
import { Validators, FormGroup, FormControl, FormArray } from '@angular/forms';
|
|
25
26
|
import isEqual from 'lodash/isEqual';
|
|
26
27
|
import fromPairs from 'lodash/fromPairs';
|
|
27
28
|
import _ from 'lodash';
|
|
28
|
-
import { EventSourcePolyfill } from 'event-source-polyfill/src/eventsource.min.js';
|
|
29
29
|
import * as i1$2 from '@angular/router';
|
|
30
30
|
import { NavigationEnd } from '@angular/router';
|
|
31
31
|
import clone from 'lodash/clone';
|
|
@@ -238,25 +238,28 @@ var AppEventTypeEnum;
|
|
|
238
238
|
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 38] = "PROPERTY_SUBSCRIPTION_DELETED";
|
|
239
239
|
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 39] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
|
|
240
240
|
AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 40] = "SERVICE_SUBSCRIPTION_UPDATED";
|
|
241
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
242
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
243
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
244
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
245
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
246
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
247
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
248
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
249
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
250
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
251
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
252
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
253
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
254
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
255
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
256
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
257
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
258
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
259
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
241
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 41] = "SOLE_BUSINESS_CREATED";
|
|
242
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 42] = "SOLE_DEPRECIATION_METHOD_UPDATED";
|
|
243
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 43] = "SOLE_DETAILS_CREATED";
|
|
244
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 44] = "SOLE_DETAILS_UPDATED";
|
|
245
|
+
AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 45] = "TAX_REVIEW_UPDATED";
|
|
246
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 46] = "TRANSACTION_CREATED";
|
|
247
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 47] = "TRANSACTION_DELETED";
|
|
248
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 48] = "TRANSACTION_UPDATED";
|
|
249
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 49] = "TRANSACTION_UPDATED_WITH_RECEIPT";
|
|
250
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 50] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
|
|
251
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 51] = "TRANSACTION_RECEIPT_CREATED";
|
|
252
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 52] = "TRANSACTION_RECEIPT_DELETED";
|
|
253
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 53] = "TRANSACTIONS_CREATED";
|
|
254
|
+
AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 54] = "USER_UPDATED";
|
|
255
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 55] = "VEHICLE_CLAIM_UPDATED";
|
|
256
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 56] = "VEHICLE_CLAIM_CREATED";
|
|
257
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 57] = "VEHICLE_CLAIM_DETAILS_UPDATED";
|
|
258
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 58] = "VEHICLE_CLAIM_DETAILS_CREATED";
|
|
259
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 59] = "VEHICLE_LOGBOOK_CREATED";
|
|
260
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 60] = "VEHICLE_LOGBOOK_UPDATED";
|
|
261
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 61] = "VEHICLE_LOGBOOK_DELETED";
|
|
262
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 62] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
|
|
260
263
|
})(AppEventTypeEnum || (AppEventTypeEnum = {}));
|
|
261
264
|
|
|
262
265
|
class EventDispatcherService {
|
|
@@ -683,6 +686,7 @@ const ENDPOINTS = {
|
|
|
683
686
|
SOLE_BUSINESSES_GET: new Endpoint('GET', '\\/sole-businesses'),
|
|
684
687
|
SOLE_BUSINESSES_POST: new Endpoint('POST', '\\/sole-businesses'),
|
|
685
688
|
SOLE_BUSINESSES_PUT: new Endpoint('PUT', '\\/sole-businesses\\/\\d+'),
|
|
689
|
+
BUSINESS_ACTIVITIES_GET: new Endpoint('GET', '\\/sole-business-activities'),
|
|
686
690
|
SOLE_DEPRECIATION_METHODS_GET: new Endpoint('GET', '\\/sole-depreciation-methods'),
|
|
687
691
|
SOLE_DEPRECIATION_METHODS_PUT: new Endpoint('PUT', '\\/sole-depreciation-methods\\/\\d+'),
|
|
688
692
|
SOLE_INVOICES_GET: new Endpoint('GET', '\\/sole-invoices'),
|
|
@@ -2532,6 +2536,12 @@ class SoleInvoice extends SoleInvoice$1 {
|
|
|
2532
2536
|
isPaid() {
|
|
2533
2537
|
return this.status === SoleInvoiceStatusesEnum.PAID;
|
|
2534
2538
|
}
|
|
2539
|
+
isOverdue() {
|
|
2540
|
+
return this.isPending() && this.dateTo < new Date();
|
|
2541
|
+
}
|
|
2542
|
+
isUnpaid() {
|
|
2543
|
+
return this.isPending() && this.dateTo >= new Date();
|
|
2544
|
+
}
|
|
2535
2545
|
}
|
|
2536
2546
|
__decorate([
|
|
2537
2547
|
Type(() => Date)
|
|
@@ -2600,14 +2610,14 @@ class VehicleLogbook extends VehicleLogbook$1 {
|
|
|
2600
2610
|
* Get logbook period date range from logbook date and weeksInPeriod duration
|
|
2601
2611
|
*/
|
|
2602
2612
|
getPeriod() {
|
|
2603
|
-
return moment.rangeFromInterval('
|
|
2613
|
+
return moment.rangeFromInterval('milliseconds', VehicleLogbook.bestPeriodDuration, this.date);
|
|
2604
2614
|
}
|
|
2605
2615
|
}
|
|
2606
2616
|
/**
|
|
2607
|
-
* Logbook period duration in
|
|
2617
|
+
* Logbook period duration in milliseconds.
|
|
2608
2618
|
* https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/211517441/Logbook+Vehicle
|
|
2609
2619
|
*/
|
|
2610
|
-
VehicleLogbook.
|
|
2620
|
+
VehicleLogbook.bestPeriodDuration = 12 * 7 * 24 * 3600 * 1000;
|
|
2611
2621
|
__decorate([
|
|
2612
2622
|
Type(() => Date)
|
|
2613
2623
|
], VehicleLogbook.prototype, "date", void 0);
|
|
@@ -3576,6 +3586,9 @@ __decorate([
|
|
|
3576
3586
|
__decorate([
|
|
3577
3587
|
Type(() => SoleBusinessActivity$1)
|
|
3578
3588
|
], SoleBusiness.prototype, "activity", void 0);
|
|
3589
|
+
__decorate([
|
|
3590
|
+
Type(() => IncomeSource)
|
|
3591
|
+
], SoleBusiness.prototype, "incomeSource", void 0);
|
|
3579
3592
|
|
|
3580
3593
|
class SoleBusinessActivity extends SoleBusinessActivity$1 {
|
|
3581
3594
|
}
|
|
@@ -4722,7 +4735,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
4722
4735
|
/**
|
|
4723
4736
|
* Interceptor which adds user's basiq token to any http request to basiq api
|
|
4724
4737
|
*/
|
|
4725
|
-
class
|
|
4738
|
+
class BasiqTokenInterceptor {
|
|
4726
4739
|
constructor(basiqTokenService) {
|
|
4727
4740
|
this.basiqTokenService = basiqTokenService;
|
|
4728
4741
|
}
|
|
@@ -4743,12 +4756,239 @@ class BasiqInterceptor {
|
|
|
4743
4756
|
});
|
|
4744
4757
|
}
|
|
4745
4758
|
}
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type:
|
|
4759
|
+
BasiqTokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqTokenInterceptor, deps: [{ token: BasiqTokenService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4760
|
+
BasiqTokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqTokenInterceptor });
|
|
4761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqTokenInterceptor, decorators: [{
|
|
4749
4762
|
type: Injectable
|
|
4750
4763
|
}], ctorParameters: function () { return [{ type: BasiqTokenService }]; } });
|
|
4751
4764
|
|
|
4765
|
+
/**
|
|
4766
|
+
* server sent events service
|
|
4767
|
+
* https://symfony.com/doc/current/mercure.html
|
|
4768
|
+
*/
|
|
4769
|
+
class SseService {
|
|
4770
|
+
constructor(zone, jwtService, environment) {
|
|
4771
|
+
this.zone = zone;
|
|
4772
|
+
this.jwtService = jwtService;
|
|
4773
|
+
this.environment = environment;
|
|
4774
|
+
}
|
|
4775
|
+
/**
|
|
4776
|
+
* list to url for server events
|
|
4777
|
+
*/
|
|
4778
|
+
on(topic) {
|
|
4779
|
+
const url = new URL(this.environment.mercureUrl);
|
|
4780
|
+
url.searchParams.append('topic', `${this.environment.apiV2}/users/${this.jwtService.decodeToken().username}/${topic}`);
|
|
4781
|
+
// tslint:disable-next-line:typedef
|
|
4782
|
+
return new Observable((observer) => {
|
|
4783
|
+
const es = new EventSourcePolyfill(url, {
|
|
4784
|
+
headers: {
|
|
4785
|
+
Authorization: 'Bearer ' + this.jwtService.getToken(),
|
|
4786
|
+
}
|
|
4787
|
+
});
|
|
4788
|
+
es.onmessage = (event) => {
|
|
4789
|
+
this.zone.run(() => observer.next(event));
|
|
4790
|
+
};
|
|
4791
|
+
})
|
|
4792
|
+
.pipe(map((messageEvent) => {
|
|
4793
|
+
return JSON.parse(messageEvent.data);
|
|
4794
|
+
}));
|
|
4795
|
+
}
|
|
4796
|
+
}
|
|
4797
|
+
SseService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, deps: [{ token: i0.NgZone }, { token: JwtService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4798
|
+
SseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, providedIn: 'root' });
|
|
4799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, decorators: [{
|
|
4800
|
+
type: Injectable,
|
|
4801
|
+
args: [{
|
|
4802
|
+
providedIn: 'root'
|
|
4803
|
+
}]
|
|
4804
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: JwtService }, { type: undefined, decorators: [{
|
|
4805
|
+
type: Inject,
|
|
4806
|
+
args: ['environment']
|
|
4807
|
+
}] }]; } });
|
|
4808
|
+
|
|
4809
|
+
/**
|
|
4810
|
+
* Service to work with user
|
|
4811
|
+
*/
|
|
4812
|
+
class UserService {
|
|
4813
|
+
constructor(http, jwtService, eventDispatcherService, sseService, environment) {
|
|
4814
|
+
this.http = http;
|
|
4815
|
+
this.jwtService = jwtService;
|
|
4816
|
+
this.eventDispatcherService = eventDispatcherService;
|
|
4817
|
+
this.sseService = sseService;
|
|
4818
|
+
this.environment = environment;
|
|
4819
|
+
this.cacheSubject = new ReplaySubject(1);
|
|
4820
|
+
this.listenEvents();
|
|
4821
|
+
}
|
|
4822
|
+
listenEvents() {
|
|
4823
|
+
this.listenServiceSubscriptionUpdated();
|
|
4824
|
+
}
|
|
4825
|
+
get() {
|
|
4826
|
+
if (!this.cache) {
|
|
4827
|
+
this.fetch().subscribe(() => { }, (error) => {
|
|
4828
|
+
// force logout user (clear localStorage) when get current user return error
|
|
4829
|
+
if (error.status === 500) {
|
|
4830
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.CURRENT_USER_GET_FAILED, null));
|
|
4831
|
+
}
|
|
4832
|
+
});
|
|
4833
|
+
}
|
|
4834
|
+
return this.cacheSubject.asObservable();
|
|
4835
|
+
}
|
|
4836
|
+
/**
|
|
4837
|
+
* Get current user
|
|
4838
|
+
*/
|
|
4839
|
+
fetch() {
|
|
4840
|
+
return this.http.get(`${this.environment.apiV2}/users/current`)
|
|
4841
|
+
.pipe(map((userBase) => {
|
|
4842
|
+
const user = plainToClass(User, userBase);
|
|
4843
|
+
localStorage.setItem('userId', user.id.toString());
|
|
4844
|
+
// @TODO remove
|
|
4845
|
+
localStorage.setItem('financialYear', user.financialYear.toString());
|
|
4846
|
+
this.cache = user;
|
|
4847
|
+
this.cacheSubject.next(this.cache);
|
|
4848
|
+
return user;
|
|
4849
|
+
}));
|
|
4850
|
+
}
|
|
4851
|
+
/**
|
|
4852
|
+
* Register new user
|
|
4853
|
+
*/
|
|
4854
|
+
register(data) {
|
|
4855
|
+
return this.http.post(`${this.environment.apiV2}/users/registration`, data);
|
|
4856
|
+
}
|
|
4857
|
+
/**
|
|
4858
|
+
* Update user
|
|
4859
|
+
*/
|
|
4860
|
+
update(user) {
|
|
4861
|
+
return this.http.put(`${this.environment.apiV2}/users/${user.id}`, user)
|
|
4862
|
+
.pipe(map((userBase) => {
|
|
4863
|
+
this.cache = plainToClass(User, userBase);
|
|
4864
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.USER_UPDATED, null));
|
|
4865
|
+
this.cacheSubject.next(this.cache);
|
|
4866
|
+
}));
|
|
4867
|
+
}
|
|
4868
|
+
/**
|
|
4869
|
+
* Change user password
|
|
4870
|
+
*/
|
|
4871
|
+
changePassword(currentPassword, newPassword) {
|
|
4872
|
+
return this.http.put(`${this.environment.apiV2}/users/password/change`, { currentPassword, newPassword });
|
|
4873
|
+
}
|
|
4874
|
+
/**
|
|
4875
|
+
* Recovery user password
|
|
4876
|
+
*/
|
|
4877
|
+
recoveryPassword(email) {
|
|
4878
|
+
return this.http.put(`${this.environment.apiV2}/users/password/recovery`, { email });
|
|
4879
|
+
}
|
|
4880
|
+
/**
|
|
4881
|
+
* Reset user password
|
|
4882
|
+
*/
|
|
4883
|
+
resetPassword(newPassword, resetToken) {
|
|
4884
|
+
return this.http.put(`${this.environment.apiV2}/users/password/reset`, { newPassword, resetToken });
|
|
4885
|
+
}
|
|
4886
|
+
resendConfirmationEmail(email) {
|
|
4887
|
+
return this.http.post(`${this.environment.apiV2}/users/confirmation/resend`, { email });
|
|
4888
|
+
}
|
|
4889
|
+
/**
|
|
4890
|
+
* Confirm registered user
|
|
4891
|
+
*/
|
|
4892
|
+
confirm(verificationCode) {
|
|
4893
|
+
return this.http.post(`${this.environment.apiV2}/users/confirmation`, { verificationCode });
|
|
4894
|
+
}
|
|
4895
|
+
/**
|
|
4896
|
+
* Search existing user
|
|
4897
|
+
*/
|
|
4898
|
+
search(email) {
|
|
4899
|
+
return this.http.get(`${this.environment.apiV2}/users/search?email=${email}`)
|
|
4900
|
+
.pipe(map((userBase) => {
|
|
4901
|
+
return plainToClass(User, userBase);
|
|
4902
|
+
}));
|
|
4903
|
+
}
|
|
4904
|
+
/**
|
|
4905
|
+
* Finish onboarding process
|
|
4906
|
+
*/
|
|
4907
|
+
finishOnboarding(user) {
|
|
4908
|
+
return this.http.put(`${this.environment.apiV2}/users/status`, user)
|
|
4909
|
+
.pipe(map(() => {
|
|
4910
|
+
this.cache = user;
|
|
4911
|
+
this.cacheSubject.next(this.cache);
|
|
4912
|
+
}));
|
|
4913
|
+
}
|
|
4914
|
+
/**
|
|
4915
|
+
* Update user photo
|
|
4916
|
+
*/
|
|
4917
|
+
updatePhoto(photo) {
|
|
4918
|
+
return this.http.post(`${this.environment.apiV2}/users/photo?_method=PUT`, photo)
|
|
4919
|
+
.pipe(map((photoUrl) => {
|
|
4920
|
+
this.cache = plainToClass(User, Object.assign(this.cache, { photo: photoUrl }));
|
|
4921
|
+
this.cacheSubject.next(this.cache);
|
|
4922
|
+
}));
|
|
4923
|
+
}
|
|
4924
|
+
switchFinancialYear(year) {
|
|
4925
|
+
return this.http.get(`${this.environment.apiV2}/financial-year/switch`, { params: new HttpParams({ fromString: `financialYear=${year}` }) }).pipe(map(() => {
|
|
4926
|
+
localStorage.setItem('financialYear', year.toString());
|
|
4927
|
+
window.location.reload();
|
|
4928
|
+
}));
|
|
4929
|
+
}
|
|
4930
|
+
/**
|
|
4931
|
+
* clear service cache
|
|
4932
|
+
*/
|
|
4933
|
+
resetCache() {
|
|
4934
|
+
this.fetch().subscribe();
|
|
4935
|
+
}
|
|
4936
|
+
/**
|
|
4937
|
+
* Create basiq (if not exist yet) to provide access to basiq api
|
|
4938
|
+
*/
|
|
4939
|
+
createBasiq() {
|
|
4940
|
+
return this.http.post(`${this.environment.apiV2}/basiq/user`, {})
|
|
4941
|
+
.pipe(map((basiqId) => {
|
|
4942
|
+
this.cache = plainToClass(User, Object.assign(this.cache, { basiqId }));
|
|
4943
|
+
this.cacheSubject.next(this.cache);
|
|
4944
|
+
return basiqId;
|
|
4945
|
+
}));
|
|
4946
|
+
}
|
|
4947
|
+
/**
|
|
4948
|
+
* Update cache when user's service subscription is updated
|
|
4949
|
+
*/
|
|
4950
|
+
listenServiceSubscriptionUpdated() {
|
|
4951
|
+
this.eventDispatcherService.on(AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(() => this.resetCache());
|
|
4952
|
+
}
|
|
4953
|
+
}
|
|
4954
|
+
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: JwtService }, { token: EventDispatcherService }, { token: SseService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4955
|
+
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, providedIn: 'root' });
|
|
4956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, decorators: [{
|
|
4957
|
+
type: Injectable,
|
|
4958
|
+
args: [{
|
|
4959
|
+
providedIn: 'root'
|
|
4960
|
+
}]
|
|
4961
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: JwtService }, { type: EventDispatcherService }, { type: SseService }, { type: undefined, decorators: [{
|
|
4962
|
+
type: Inject,
|
|
4963
|
+
args: ['environment']
|
|
4964
|
+
}] }]; } });
|
|
4965
|
+
|
|
4966
|
+
/**
|
|
4967
|
+
* Interceptor which check if client's basiq id exist and request it if not
|
|
4968
|
+
*/
|
|
4969
|
+
class BasiqClientIdInterceptor {
|
|
4970
|
+
constructor(userService) {
|
|
4971
|
+
this.userService = userService;
|
|
4972
|
+
}
|
|
4973
|
+
intercept(request, next) {
|
|
4974
|
+
// Check if 'client id' URL segment contains null instead of id
|
|
4975
|
+
if (!request.url.startsWith(`${BasiqService.basiqApiUrl}/users/null`)) {
|
|
4976
|
+
return next.handle(request);
|
|
4977
|
+
}
|
|
4978
|
+
return this.userService.createBasiq().pipe(mergeMap((basiqClientId) => next.handle(this.addId(request, basiqClientId))));
|
|
4979
|
+
}
|
|
4980
|
+
addId(request, basiqClientId) {
|
|
4981
|
+
return request.clone({
|
|
4982
|
+
url: request.url.replace('null', basiqClientId)
|
|
4983
|
+
});
|
|
4984
|
+
}
|
|
4985
|
+
}
|
|
4986
|
+
BasiqClientIdInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqClientIdInterceptor, deps: [{ token: UserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4987
|
+
BasiqClientIdInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqClientIdInterceptor });
|
|
4988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqClientIdInterceptor, decorators: [{
|
|
4989
|
+
type: Injectable
|
|
4990
|
+
}], ctorParameters: function () { return [{ type: UserService }]; } });
|
|
4991
|
+
|
|
4752
4992
|
class InterceptorsModule {
|
|
4753
4993
|
}
|
|
4754
4994
|
InterceptorsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: InterceptorsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -4782,7 +5022,12 @@ InterceptorsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", vers
|
|
|
4782
5022
|
},
|
|
4783
5023
|
{
|
|
4784
5024
|
provide: HTTP_INTERCEPTORS,
|
|
4785
|
-
useClass:
|
|
5025
|
+
useClass: BasiqTokenInterceptor,
|
|
5026
|
+
multi: true
|
|
5027
|
+
},
|
|
5028
|
+
{
|
|
5029
|
+
provide: HTTP_INTERCEPTORS,
|
|
5030
|
+
useClass: BasiqClientIdInterceptor,
|
|
4786
5031
|
multi: true
|
|
4787
5032
|
}
|
|
4788
5033
|
] });
|
|
@@ -4818,7 +5063,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
4818
5063
|
},
|
|
4819
5064
|
{
|
|
4820
5065
|
provide: HTTP_INTERCEPTORS,
|
|
4821
|
-
useClass:
|
|
5066
|
+
useClass: BasiqTokenInterceptor,
|
|
5067
|
+
multi: true
|
|
5068
|
+
},
|
|
5069
|
+
{
|
|
5070
|
+
provide: HTTP_INTERCEPTORS,
|
|
5071
|
+
useClass: BasiqClientIdInterceptor,
|
|
4822
5072
|
multi: true
|
|
4823
5073
|
}
|
|
4824
5074
|
]
|
|
@@ -4889,7 +5139,7 @@ class VehicleLogbookCollection extends Collection {
|
|
|
4889
5139
|
if (this.items.length < 2) {
|
|
4890
5140
|
return false;
|
|
4891
5141
|
}
|
|
4892
|
-
return VehicleLogbook.
|
|
5142
|
+
return VehicleLogbook.bestPeriodDuration < (this.last.date.getTime() - this.first.date.getTime());
|
|
4893
5143
|
}
|
|
4894
5144
|
/**
|
|
4895
5145
|
* Get collection of non-personal logbooks (work-related, sole-related).
|
|
@@ -4967,6 +5217,18 @@ class VehicleLogbookCollection extends Collection {
|
|
|
4967
5217
|
}
|
|
4968
5218
|
}
|
|
4969
5219
|
|
|
5220
|
+
class SoleInvoiceCollection extends Collection {
|
|
5221
|
+
getOverdue() {
|
|
5222
|
+
return this.filter((invoice) => invoice.isOverdue());
|
|
5223
|
+
}
|
|
5224
|
+
getUnpaid() {
|
|
5225
|
+
return this.filter((invoice) => invoice.isUnpaid());
|
|
5226
|
+
}
|
|
5227
|
+
getPaid() {
|
|
5228
|
+
return this.filter((invoice) => invoice.isPaid());
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
|
|
4970
5232
|
// @TODO Alex move here all collections
|
|
4971
5233
|
|
|
4972
5234
|
class AccountSetupItemCollection extends Collection {
|
|
@@ -5533,6 +5795,9 @@ class IncomeSourceCollection extends Collection {
|
|
|
5533
5795
|
getSalary() {
|
|
5534
5796
|
return this.items.filter((incomeSource) => incomeSource.isSalaryIncome());
|
|
5535
5797
|
}
|
|
5798
|
+
getOther() {
|
|
5799
|
+
return this.items.filter((incomeSource) => incomeSource.isOtherIncome());
|
|
5800
|
+
}
|
|
5536
5801
|
/**
|
|
5537
5802
|
* Get income sources list of forecasts
|
|
5538
5803
|
*/
|
|
@@ -8888,6 +9153,12 @@ class SoleBusinessService extends RestService {
|
|
|
8888
9153
|
this.url = 'sole-businesses';
|
|
8889
9154
|
this.isHydra = true;
|
|
8890
9155
|
}
|
|
9156
|
+
add(soleBusiness) {
|
|
9157
|
+
return super.add(soleBusiness).pipe(map((business) => {
|
|
9158
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.SOLE_BUSINESS_CREATED, business));
|
|
9159
|
+
return business;
|
|
9160
|
+
}));
|
|
9161
|
+
}
|
|
8891
9162
|
}
|
|
8892
9163
|
SoleBusinessService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleBusinessService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
8893
9164
|
SoleBusinessService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleBusinessService, providedIn: 'root' });
|
|
@@ -8943,6 +9214,10 @@ class SoleDepreciationMethodService {
|
|
|
8943
9214
|
this.toastService = toastService;
|
|
8944
9215
|
this.cacheSubject = new ReplaySubject(1);
|
|
8945
9216
|
this.url = 'sole-depreciation-methods';
|
|
9217
|
+
this.listenEvents();
|
|
9218
|
+
}
|
|
9219
|
+
listenEvents() {
|
|
9220
|
+
this.listenSoleDetailsChanges();
|
|
8946
9221
|
}
|
|
8947
9222
|
get() {
|
|
8948
9223
|
if (!this.cache) {
|
|
@@ -8969,6 +9244,13 @@ class SoleDepreciationMethodService {
|
|
|
8969
9244
|
return throwError$1(error);
|
|
8970
9245
|
}));
|
|
8971
9246
|
}
|
|
9247
|
+
listenSoleDetailsChanges() {
|
|
9248
|
+
this.eventDispatcherService.on([AppEventTypeEnum.SOLE_DETAILS_CREATED, AppEventTypeEnum.SOLE_DETAILS_UPDATED])
|
|
9249
|
+
.subscribe(() => {
|
|
9250
|
+
this.cache = null;
|
|
9251
|
+
this.get().subscribe();
|
|
9252
|
+
});
|
|
9253
|
+
}
|
|
8972
9254
|
}
|
|
8973
9255
|
SoleDepreciationMethodService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDepreciationMethodService, deps: [{ token: i1.HttpClient }, { token: 'environment' }, { token: EventDispatcherService }, { token: ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8974
9256
|
SoleDepreciationMethodService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDepreciationMethodService, providedIn: 'root' });
|
|
@@ -8986,9 +9268,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
8986
9268
|
* @TODO TT-1777 Alex: extend from rest service when it refactored
|
|
8987
9269
|
*/
|
|
8988
9270
|
class SoleDetailsService {
|
|
8989
|
-
constructor(http, environment) {
|
|
9271
|
+
constructor(http, environment, eventDispatcherService) {
|
|
8990
9272
|
this.http = http;
|
|
8991
9273
|
this.environment = environment;
|
|
9274
|
+
this.eventDispatcherService = eventDispatcherService;
|
|
8992
9275
|
this.cacheSubject = new ReplaySubject(1);
|
|
8993
9276
|
}
|
|
8994
9277
|
get() {
|
|
@@ -9011,6 +9294,7 @@ class SoleDetailsService {
|
|
|
9011
9294
|
return this.http.post(`${this.environment.apiV2}/sole-details`, soleDetails).pipe(map((soleDetailsBase) => {
|
|
9012
9295
|
this.cache = plainToClass(SoleDetails, soleDetailsBase);
|
|
9013
9296
|
this.cacheSubject.next(this.cache);
|
|
9297
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.SOLE_DETAILS_CREATED, soleDetails));
|
|
9014
9298
|
return this.cache;
|
|
9015
9299
|
}));
|
|
9016
9300
|
}
|
|
@@ -9018,11 +9302,12 @@ class SoleDetailsService {
|
|
|
9018
9302
|
return this.http.put(`${this.environment.apiV2}/sole-details/${soleDetails.id}`, soleDetails).pipe(map((soleDetailsBase) => {
|
|
9019
9303
|
this.cache = plainToClass(SoleDetails, soleDetailsBase);
|
|
9020
9304
|
this.cacheSubject.next(this.cache);
|
|
9305
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.SOLE_DETAILS_UPDATED, soleDetails));
|
|
9021
9306
|
return this.cache;
|
|
9022
9307
|
}));
|
|
9023
9308
|
}
|
|
9024
9309
|
}
|
|
9025
|
-
SoleDetailsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDetailsService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9310
|
+
SoleDetailsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDetailsService, deps: [{ token: i1.HttpClient }, { token: 'environment' }, { token: EventDispatcherService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9026
9311
|
SoleDetailsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDetailsService, providedIn: 'root' });
|
|
9027
9312
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDetailsService, decorators: [{
|
|
9028
9313
|
type: Injectable,
|
|
@@ -9032,7 +9317,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
9032
9317
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
9033
9318
|
type: Inject,
|
|
9034
9319
|
args: ['environment']
|
|
9035
|
-
}] }]; } });
|
|
9320
|
+
}] }, { type: EventDispatcherService }]; } });
|
|
9036
9321
|
|
|
9037
9322
|
class SoleInvoiceService extends RestService {
|
|
9038
9323
|
constructor() {
|
|
@@ -9722,6 +10007,9 @@ class IncomeSourceService extends RestService {
|
|
|
9722
10007
|
this.modelClass = IncomeSource;
|
|
9723
10008
|
this.incomeSourceTypeSubject = new ReplaySubject(1);
|
|
9724
10009
|
}
|
|
10010
|
+
listenEvents() {
|
|
10011
|
+
this.listenSoleBusinessCreated();
|
|
10012
|
+
}
|
|
9725
10013
|
/**
|
|
9726
10014
|
* Get income sources tax calculation
|
|
9727
10015
|
* @param salaryForecast for which tax should be calculated
|
|
@@ -9791,6 +10079,14 @@ class IncomeSourceService extends RestService {
|
|
|
9791
10079
|
}
|
|
9792
10080
|
return this.incomeSourceTypeSubject.asObservable();
|
|
9793
10081
|
}
|
|
10082
|
+
/**
|
|
10083
|
+
* Sole businesses create together with income source
|
|
10084
|
+
*/
|
|
10085
|
+
listenSoleBusinessCreated() {
|
|
10086
|
+
this.eventDispatcherService.on(AppEventTypeEnum.SOLE_BUSINESS_CREATED).subscribe(() => {
|
|
10087
|
+
this.resetCache();
|
|
10088
|
+
});
|
|
10089
|
+
}
|
|
9794
10090
|
}
|
|
9795
10091
|
IncomeSourceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: IncomeSourceService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
9796
10092
|
IncomeSourceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: IncomeSourceService, providedIn: 'root' });
|
|
@@ -11000,50 +11296,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
11000
11296
|
}]
|
|
11001
11297
|
}] });
|
|
11002
11298
|
|
|
11003
|
-
/**
|
|
11004
|
-
* server sent events service
|
|
11005
|
-
* https://symfony.com/doc/current/mercure.html
|
|
11006
|
-
*/
|
|
11007
|
-
class SseService {
|
|
11008
|
-
constructor(zone, jwtService, environment) {
|
|
11009
|
-
this.zone = zone;
|
|
11010
|
-
this.jwtService = jwtService;
|
|
11011
|
-
this.environment = environment;
|
|
11012
|
-
}
|
|
11013
|
-
/**
|
|
11014
|
-
* list to url for server events
|
|
11015
|
-
*/
|
|
11016
|
-
on(topic) {
|
|
11017
|
-
const url = new URL(this.environment.mercureUrl);
|
|
11018
|
-
url.searchParams.append('topic', `${this.environment.apiV2}/users/${this.jwtService.decodeToken().username}/${topic}`);
|
|
11019
|
-
// tslint:disable-next-line:typedef
|
|
11020
|
-
return new Observable((observer) => {
|
|
11021
|
-
const es = new EventSourcePolyfill(url, {
|
|
11022
|
-
headers: {
|
|
11023
|
-
Authorization: 'Bearer ' + this.jwtService.getToken(),
|
|
11024
|
-
}
|
|
11025
|
-
});
|
|
11026
|
-
es.onmessage = (event) => {
|
|
11027
|
-
this.zone.run(() => observer.next(event));
|
|
11028
|
-
};
|
|
11029
|
-
})
|
|
11030
|
-
.pipe(map((messageEvent) => {
|
|
11031
|
-
return JSON.parse(messageEvent.data);
|
|
11032
|
-
}));
|
|
11033
|
-
}
|
|
11034
|
-
}
|
|
11035
|
-
SseService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, deps: [{ token: i0.NgZone }, { token: JwtService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
11036
|
-
SseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, providedIn: 'root' });
|
|
11037
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, decorators: [{
|
|
11038
|
-
type: Injectable,
|
|
11039
|
-
args: [{
|
|
11040
|
-
providedIn: 'root'
|
|
11041
|
-
}]
|
|
11042
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: JwtService }, { type: undefined, decorators: [{
|
|
11043
|
-
type: Inject,
|
|
11044
|
-
args: ['environment']
|
|
11045
|
-
}] }]; } });
|
|
11046
|
-
|
|
11047
11299
|
/**
|
|
11048
11300
|
* Service for work with chats
|
|
11049
11301
|
*/
|
|
@@ -13528,152 +13780,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
13528
13780
|
}]
|
|
13529
13781
|
}] });
|
|
13530
13782
|
|
|
13531
|
-
/**
|
|
13532
|
-
* Service to work with user
|
|
13533
|
-
*/
|
|
13534
|
-
class UserService {
|
|
13535
|
-
constructor(http, jwtService, eventDispatcherService, sseService, environment) {
|
|
13536
|
-
this.http = http;
|
|
13537
|
-
this.jwtService = jwtService;
|
|
13538
|
-
this.eventDispatcherService = eventDispatcherService;
|
|
13539
|
-
this.sseService = sseService;
|
|
13540
|
-
this.environment = environment;
|
|
13541
|
-
this.cacheSubject = new ReplaySubject(1);
|
|
13542
|
-
this.listenEvents();
|
|
13543
|
-
}
|
|
13544
|
-
listenEvents() {
|
|
13545
|
-
this.listenServiceSubscriptionUpdated();
|
|
13546
|
-
}
|
|
13547
|
-
get() {
|
|
13548
|
-
if (!this.cache) {
|
|
13549
|
-
this.fetch().subscribe(() => { }, (error) => {
|
|
13550
|
-
// force logout user (clear localStorage) when get current user return error
|
|
13551
|
-
if (error.status === 500) {
|
|
13552
|
-
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.CURRENT_USER_GET_FAILED, null));
|
|
13553
|
-
}
|
|
13554
|
-
});
|
|
13555
|
-
}
|
|
13556
|
-
return this.cacheSubject.asObservable();
|
|
13557
|
-
}
|
|
13558
|
-
/**
|
|
13559
|
-
* Get current user
|
|
13560
|
-
*/
|
|
13561
|
-
fetch() {
|
|
13562
|
-
return this.http.get(`${this.environment.apiV2}/users/current`)
|
|
13563
|
-
.pipe(map((userBase) => {
|
|
13564
|
-
const user = plainToClass(User, userBase);
|
|
13565
|
-
localStorage.setItem('userId', user.id.toString());
|
|
13566
|
-
// @TODO remove
|
|
13567
|
-
localStorage.setItem('financialYear', user.financialYear.toString());
|
|
13568
|
-
this.cache = user;
|
|
13569
|
-
this.cacheSubject.next(this.cache);
|
|
13570
|
-
return user;
|
|
13571
|
-
}));
|
|
13572
|
-
}
|
|
13573
|
-
/**
|
|
13574
|
-
* Register new user
|
|
13575
|
-
*/
|
|
13576
|
-
register(data) {
|
|
13577
|
-
return this.http.post(`${this.environment.apiV2}/users/registration`, data);
|
|
13578
|
-
}
|
|
13579
|
-
/**
|
|
13580
|
-
* Update user
|
|
13581
|
-
*/
|
|
13582
|
-
update(user) {
|
|
13583
|
-
return this.http.put(`${this.environment.apiV2}/users/${user.id}`, user)
|
|
13584
|
-
.pipe(map((userBase) => {
|
|
13585
|
-
this.cache = plainToClass(User, userBase);
|
|
13586
|
-
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.USER_UPDATED, null));
|
|
13587
|
-
this.cacheSubject.next(this.cache);
|
|
13588
|
-
}));
|
|
13589
|
-
}
|
|
13590
|
-
/**
|
|
13591
|
-
* Change user password
|
|
13592
|
-
*/
|
|
13593
|
-
changePassword(currentPassword, newPassword) {
|
|
13594
|
-
return this.http.put(`${this.environment.apiV2}/users/password/change`, { currentPassword, newPassword });
|
|
13595
|
-
}
|
|
13596
|
-
/**
|
|
13597
|
-
* Recovery user password
|
|
13598
|
-
*/
|
|
13599
|
-
recoveryPassword(email) {
|
|
13600
|
-
return this.http.put(`${this.environment.apiV2}/users/password/recovery`, { email });
|
|
13601
|
-
}
|
|
13602
|
-
/**
|
|
13603
|
-
* Reset user password
|
|
13604
|
-
*/
|
|
13605
|
-
resetPassword(newPassword, resetToken) {
|
|
13606
|
-
return this.http.put(`${this.environment.apiV2}/users/password/reset`, { newPassword, resetToken });
|
|
13607
|
-
}
|
|
13608
|
-
resendConfirmationEmail(email) {
|
|
13609
|
-
return this.http.post(`${this.environment.apiV2}/users/confirmation/resend`, { email });
|
|
13610
|
-
}
|
|
13611
|
-
/**
|
|
13612
|
-
* Confirm registered user
|
|
13613
|
-
*/
|
|
13614
|
-
confirm(verificationCode) {
|
|
13615
|
-
return this.http.post(`${this.environment.apiV2}/users/confirmation`, { verificationCode });
|
|
13616
|
-
}
|
|
13617
|
-
/**
|
|
13618
|
-
* Search existing user
|
|
13619
|
-
*/
|
|
13620
|
-
search(email) {
|
|
13621
|
-
return this.http.get(`${this.environment.apiV2}/users/search?email=${email}`)
|
|
13622
|
-
.pipe(map((userBase) => {
|
|
13623
|
-
return plainToClass(User, userBase);
|
|
13624
|
-
}));
|
|
13625
|
-
}
|
|
13626
|
-
/**
|
|
13627
|
-
* Finish onboarding process
|
|
13628
|
-
*/
|
|
13629
|
-
finishOnboarding(user) {
|
|
13630
|
-
return this.http.put(`${this.environment.apiV2}/users/status`, user)
|
|
13631
|
-
.pipe(map(() => {
|
|
13632
|
-
this.cache = user;
|
|
13633
|
-
this.cacheSubject.next(this.cache);
|
|
13634
|
-
}));
|
|
13635
|
-
}
|
|
13636
|
-
/**
|
|
13637
|
-
* Update user photo
|
|
13638
|
-
*/
|
|
13639
|
-
updatePhoto(photo) {
|
|
13640
|
-
return this.http.post(`${this.environment.apiV2}/users/photo?_method=PUT`, photo)
|
|
13641
|
-
.pipe(map((photoUrl) => {
|
|
13642
|
-
this.cache = plainToClass(User, Object.assign(this.cache, { photo: photoUrl }));
|
|
13643
|
-
this.cacheSubject.next(this.cache);
|
|
13644
|
-
}));
|
|
13645
|
-
}
|
|
13646
|
-
switchFinancialYear(year) {
|
|
13647
|
-
return this.http.get(`${this.environment.apiV2}/financial-year/switch`, { params: new HttpParams({ fromString: `financialYear=${year}` }) }).pipe(map(() => {
|
|
13648
|
-
localStorage.setItem('financialYear', year.toString());
|
|
13649
|
-
window.location.reload();
|
|
13650
|
-
}));
|
|
13651
|
-
}
|
|
13652
|
-
/**
|
|
13653
|
-
* clear service cache
|
|
13654
|
-
*/
|
|
13655
|
-
resetCache() {
|
|
13656
|
-
this.fetch().subscribe();
|
|
13657
|
-
}
|
|
13658
|
-
/**
|
|
13659
|
-
* Update cache when user's service subscription is updated
|
|
13660
|
-
*/
|
|
13661
|
-
listenServiceSubscriptionUpdated() {
|
|
13662
|
-
this.eventDispatcherService.on(AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(() => this.resetCache());
|
|
13663
|
-
}
|
|
13664
|
-
}
|
|
13665
|
-
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: JwtService }, { token: EventDispatcherService }, { token: SseService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13666
|
-
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, providedIn: 'root' });
|
|
13667
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, decorators: [{
|
|
13668
|
-
type: Injectable,
|
|
13669
|
-
args: [{
|
|
13670
|
-
providedIn: 'root'
|
|
13671
|
-
}]
|
|
13672
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: JwtService }, { type: EventDispatcherService }, { type: SseService }, { type: undefined, decorators: [{
|
|
13673
|
-
type: Inject,
|
|
13674
|
-
args: ['environment']
|
|
13675
|
-
}] }]; } });
|
|
13676
|
-
|
|
13677
13783
|
/**
|
|
13678
13784
|
* Service to work with XLSX (generate, download, e.t.c.)
|
|
13679
13785
|
*/
|
|
@@ -14257,6 +14363,34 @@ class SoleBusinessForm extends AbstractForm {
|
|
|
14257
14363
|
description: new FormControl(business.description),
|
|
14258
14364
|
website: new FormControl(business.website)
|
|
14259
14365
|
}, business);
|
|
14366
|
+
// User have to create income source with new business.
|
|
14367
|
+
// Income source is not able for edit business
|
|
14368
|
+
if (!business.id) {
|
|
14369
|
+
// @TODO Alex: move to separated form class
|
|
14370
|
+
this.addControl('incomeSource', new FormGroup({
|
|
14371
|
+
type: new FormControl(IncomeSourceTypeEnum.SOLE, Validators.required),
|
|
14372
|
+
name: new FormControl(null, Validators.required),
|
|
14373
|
+
soleForecasts: new FormArray([
|
|
14374
|
+
new FormGroup({
|
|
14375
|
+
financialYear: new FormControl(new FinancialYear().year, Validators.required),
|
|
14376
|
+
amount: new FormControl(null, Validators.required),
|
|
14377
|
+
taxInstalments: new FormControl(null, Validators.required)
|
|
14378
|
+
})
|
|
14379
|
+
])
|
|
14380
|
+
}));
|
|
14381
|
+
this.addControl('losses', new FormArray([
|
|
14382
|
+
new FormGroup({
|
|
14383
|
+
financialYear: new FormControl(new FinancialYear().year),
|
|
14384
|
+
openBalance: new FormControl(null, Validators.required)
|
|
14385
|
+
})
|
|
14386
|
+
]));
|
|
14387
|
+
}
|
|
14388
|
+
}
|
|
14389
|
+
get forecastFormGroup() {
|
|
14390
|
+
return this.get('incomeSource').get('soleForecasts').at(0);
|
|
14391
|
+
}
|
|
14392
|
+
get lossFormGroup() {
|
|
14393
|
+
return this.get('losses').at(0);
|
|
14260
14394
|
}
|
|
14261
14395
|
}
|
|
14262
14396
|
|
|
@@ -14345,10 +14479,22 @@ class SoleDepreciationMethodForm extends AbstractForm {
|
|
|
14345
14479
|
}
|
|
14346
14480
|
}
|
|
14347
14481
|
|
|
14482
|
+
/**
|
|
14483
|
+
* Validator check if entered strong length is equal to passed length parameter
|
|
14484
|
+
*/
|
|
14485
|
+
function requiredLengthValidator(length) {
|
|
14486
|
+
return (control) => {
|
|
14487
|
+
if (control.value && control.value.length !== length) {
|
|
14488
|
+
return { requiredLength: length };
|
|
14489
|
+
}
|
|
14490
|
+
return null;
|
|
14491
|
+
};
|
|
14492
|
+
}
|
|
14493
|
+
|
|
14348
14494
|
class SoleDetailsForm extends AbstractForm {
|
|
14349
14495
|
constructor(soleDetails) {
|
|
14350
14496
|
super({
|
|
14351
|
-
abn: new FormControl(soleDetails.abn, [Validators.required,
|
|
14497
|
+
abn: new FormControl(soleDetails.abn, [Validators.required, requiredLengthValidator(11)]),
|
|
14352
14498
|
isGST: new FormControl(soleDetails.isGST || false)
|
|
14353
14499
|
}, soleDetails);
|
|
14354
14500
|
}
|
|
@@ -15219,5 +15365,5 @@ VehicleLogbookForm.maxDescriptionLength = 60;
|
|
|
15219
15365
|
* Generated bundle index. Do not edit.
|
|
15220
15366
|
*/
|
|
15221
15367
|
|
|
15222
|
-
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, 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, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStatusesEnum, 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, 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 };
|
|
15368
|
+
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, 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, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceCollection, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStatusesEnum, 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, 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 };
|
|
15223
15369
|
//# sourceMappingURL=taxtank-core.js.map
|