taxtank-core 0.28.0 → 0.28.3

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 (39) hide show
  1. package/bundles/taxtank-core.umd.js +366 -245
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/index.js +2 -1
  4. package/esm2015/lib/collections/sole/index.js +2 -0
  5. package/esm2015/lib/collections/sole/sole-invoice.collection.js +13 -0
  6. package/esm2015/lib/collections/vehicle/vehicle-logbook.collection.js +2 -2
  7. package/esm2015/lib/db/Models/sole/sole-business-loss.js +1 -1
  8. package/esm2015/lib/forms/sole/sole-business.form.js +11 -2
  9. package/esm2015/lib/forms/sole/sole-details.form.js +3 -2
  10. package/esm2015/lib/interceptors/basiq-client-id.interceptor.js +31 -0
  11. package/esm2015/lib/interceptors/basiq-token.interceptor.js +35 -0
  12. package/esm2015/lib/interceptors/interceptors.module.js +15 -4
  13. package/esm2015/lib/models/endpoint/endpoints.const.js +2 -1
  14. package/esm2015/lib/models/event/app-event-type.enum.js +21 -19
  15. package/esm2015/lib/models/sole/sole-invoice.js +7 -1
  16. package/esm2015/lib/models/vehicle/vehicle-logbook.js +4 -4
  17. package/esm2015/lib/services/http/sole/sole-depreciation-method/sole-depreciation-method.service.js +12 -1
  18. package/esm2015/lib/services/http/sole/sole-details/sole-details.service.js +10 -4
  19. package/esm2015/lib/services/http/user/user.service.js +12 -1
  20. package/esm2015/lib/validators/min-date/min-date.validator.js +6 -2
  21. package/esm2015/lib/validators/required-length.validator.js +12 -0
  22. package/fesm2015/taxtank-core.js +334 -227
  23. package/fesm2015/taxtank-core.js.map +1 -1
  24. package/lib/collections/index.d.ts +1 -0
  25. package/lib/collections/sole/index.d.ts +1 -0
  26. package/lib/collections/sole/sole-invoice.collection.d.ts +7 -0
  27. package/lib/db/Models/sole/sole-business-loss.d.ts +2 -3
  28. package/lib/forms/sole/sole-business.form.d.ts +1 -0
  29. package/lib/interceptors/basiq-client-id.interceptor.d.ts +15 -0
  30. package/lib/interceptors/{basiq.interceptor.d.ts → basiq-token.interceptor.d.ts} +3 -3
  31. package/lib/models/event/app-event-type.enum.d.ts +20 -18
  32. package/lib/models/sole/sole-invoice.d.ts +2 -0
  33. package/lib/models/vehicle/vehicle-logbook.d.ts +2 -2
  34. package/lib/services/http/sole/sole-depreciation-method/sole-depreciation-method.service.d.ts +4 -1
  35. package/lib/services/http/sole/sole-details/sole-details.service.d.ts +3 -1
  36. package/lib/services/http/user/user.service.d.ts +4 -0
  37. package/lib/validators/required-length.validator.d.ts +5 -0
  38. package/package.json +1 -1
  39. package/esm2015/lib/interceptors/basiq.interceptor.js +0 -35
@@ -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, Observable, of, from } from 'rxjs';
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';
@@ -240,24 +240,26 @@ var AppEventTypeEnum;
240
240
  AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 40] = "SERVICE_SUBSCRIPTION_UPDATED";
241
241
  AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 41] = "SOLE_BUSINESS_CREATED";
242
242
  AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 42] = "SOLE_DEPRECIATION_METHOD_UPDATED";
243
- AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 43] = "TAX_REVIEW_UPDATED";
244
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 44] = "TRANSACTION_CREATED";
245
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 45] = "TRANSACTION_DELETED";
246
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 46] = "TRANSACTION_UPDATED";
247
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 47] = "TRANSACTION_UPDATED_WITH_RECEIPT";
248
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 48] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
249
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 49] = "TRANSACTION_RECEIPT_CREATED";
250
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 50] = "TRANSACTION_RECEIPT_DELETED";
251
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 51] = "TRANSACTIONS_CREATED";
252
- AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 52] = "USER_UPDATED";
253
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 53] = "VEHICLE_CLAIM_UPDATED";
254
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 54] = "VEHICLE_CLAIM_CREATED";
255
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 55] = "VEHICLE_CLAIM_DETAILS_UPDATED";
256
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 56] = "VEHICLE_CLAIM_DETAILS_CREATED";
257
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 57] = "VEHICLE_LOGBOOK_CREATED";
258
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 58] = "VEHICLE_LOGBOOK_UPDATED";
259
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 59] = "VEHICLE_LOGBOOK_DELETED";
260
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 60] = "VEHICLE_LOGBOOK_BEST_PERIOD_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";
261
263
  })(AppEventTypeEnum || (AppEventTypeEnum = {}));
262
264
 
263
265
  class EventDispatcherService {
@@ -684,6 +686,7 @@ const ENDPOINTS = {
684
686
  SOLE_BUSINESSES_GET: new Endpoint('GET', '\\/sole-businesses'),
685
687
  SOLE_BUSINESSES_POST: new Endpoint('POST', '\\/sole-businesses'),
686
688
  SOLE_BUSINESSES_PUT: new Endpoint('PUT', '\\/sole-businesses\\/\\d+'),
689
+ BUSINESS_ACTIVITIES_GET: new Endpoint('GET', '\\/sole-business-activities'),
687
690
  SOLE_DEPRECIATION_METHODS_GET: new Endpoint('GET', '\\/sole-depreciation-methods'),
688
691
  SOLE_DEPRECIATION_METHODS_PUT: new Endpoint('PUT', '\\/sole-depreciation-methods\\/\\d+'),
689
692
  SOLE_INVOICES_GET: new Endpoint('GET', '\\/sole-invoices'),
@@ -2533,6 +2536,12 @@ class SoleInvoice extends SoleInvoice$1 {
2533
2536
  isPaid() {
2534
2537
  return this.status === SoleInvoiceStatusesEnum.PAID;
2535
2538
  }
2539
+ isOverdue() {
2540
+ return this.isPending() && this.dateTo < new Date();
2541
+ }
2542
+ isUnpaid() {
2543
+ return this.isPending() && this.dateTo >= new Date();
2544
+ }
2536
2545
  }
2537
2546
  __decorate([
2538
2547
  Type(() => Date)
@@ -2601,14 +2610,14 @@ class VehicleLogbook extends VehicleLogbook$1 {
2601
2610
  * Get logbook period date range from logbook date and weeksInPeriod duration
2602
2611
  */
2603
2612
  getPeriod() {
2604
- return moment.rangeFromInterval('weeks', VehicleLogbook.bestPeriodWeeks, this.date);
2613
+ return moment.rangeFromInterval('milliseconds', VehicleLogbook.bestPeriodDuration, this.date);
2605
2614
  }
2606
2615
  }
2607
2616
  /**
2608
- * Logbook period duration in weeks.
2617
+ * Logbook period duration in milliseconds.
2609
2618
  * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/211517441/Logbook+Vehicle
2610
2619
  */
2611
- VehicleLogbook.bestPeriodWeeks = 12;
2620
+ VehicleLogbook.bestPeriodDuration = 12 * 7 * 24 * 3600 * 1000;
2612
2621
  __decorate([
2613
2622
  Type(() => Date)
2614
2623
  ], VehicleLogbook.prototype, "date", void 0);
@@ -4726,7 +4735,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
4726
4735
  /**
4727
4736
  * Interceptor which adds user's basiq token to any http request to basiq api
4728
4737
  */
4729
- class BasiqInterceptor {
4738
+ class BasiqTokenInterceptor {
4730
4739
  constructor(basiqTokenService) {
4731
4740
  this.basiqTokenService = basiqTokenService;
4732
4741
  }
@@ -4747,12 +4756,239 @@ class BasiqInterceptor {
4747
4756
  });
4748
4757
  }
4749
4758
  }
4750
- BasiqInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqInterceptor, deps: [{ token: BasiqTokenService }], target: i0.ɵɵFactoryTarget.Injectable });
4751
- BasiqInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqInterceptor });
4752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BasiqInterceptor, decorators: [{
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: [{
4753
4762
  type: Injectable
4754
4763
  }], ctorParameters: function () { return [{ type: BasiqTokenService }]; } });
4755
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
+
4756
4992
  class InterceptorsModule {
4757
4993
  }
4758
4994
  InterceptorsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: InterceptorsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -4786,7 +5022,12 @@ InterceptorsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", vers
4786
5022
  },
4787
5023
  {
4788
5024
  provide: HTTP_INTERCEPTORS,
4789
- useClass: BasiqInterceptor,
5025
+ useClass: BasiqTokenInterceptor,
5026
+ multi: true
5027
+ },
5028
+ {
5029
+ provide: HTTP_INTERCEPTORS,
5030
+ useClass: BasiqClientIdInterceptor,
4790
5031
  multi: true
4791
5032
  }
4792
5033
  ] });
@@ -4822,7 +5063,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
4822
5063
  },
4823
5064
  {
4824
5065
  provide: HTTP_INTERCEPTORS,
4825
- useClass: BasiqInterceptor,
5066
+ useClass: BasiqTokenInterceptor,
5067
+ multi: true
5068
+ },
5069
+ {
5070
+ provide: HTTP_INTERCEPTORS,
5071
+ useClass: BasiqClientIdInterceptor,
4826
5072
  multi: true
4827
5073
  }
4828
5074
  ]
@@ -4893,7 +5139,7 @@ class VehicleLogbookCollection extends Collection {
4893
5139
  if (this.items.length < 2) {
4894
5140
  return false;
4895
5141
  }
4896
- return VehicleLogbook.bestPeriodWeeks < (this.last.date.getTime() - this.first.date.getTime());
5142
+ return VehicleLogbook.bestPeriodDuration < (this.last.date.getTime() - this.first.date.getTime());
4897
5143
  }
4898
5144
  /**
4899
5145
  * Get collection of non-personal logbooks (work-related, sole-related).
@@ -4971,6 +5217,18 @@ class VehicleLogbookCollection extends Collection {
4971
5217
  }
4972
5218
  }
4973
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
+
4974
5232
  // @TODO Alex move here all collections
4975
5233
 
4976
5234
  class AccountSetupItemCollection extends Collection {
@@ -8956,6 +9214,10 @@ class SoleDepreciationMethodService {
8956
9214
  this.toastService = toastService;
8957
9215
  this.cacheSubject = new ReplaySubject(1);
8958
9216
  this.url = 'sole-depreciation-methods';
9217
+ this.listenEvents();
9218
+ }
9219
+ listenEvents() {
9220
+ this.listenSoleDetailsChanges();
8959
9221
  }
8960
9222
  get() {
8961
9223
  if (!this.cache) {
@@ -8982,6 +9244,13 @@ class SoleDepreciationMethodService {
8982
9244
  return throwError$1(error);
8983
9245
  }));
8984
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
+ }
8985
9254
  }
8986
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 });
8987
9256
  SoleDepreciationMethodService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDepreciationMethodService, providedIn: 'root' });
@@ -8999,9 +9268,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
8999
9268
  * @TODO TT-1777 Alex: extend from rest service when it refactored
9000
9269
  */
9001
9270
  class SoleDetailsService {
9002
- constructor(http, environment) {
9271
+ constructor(http, environment, eventDispatcherService) {
9003
9272
  this.http = http;
9004
9273
  this.environment = environment;
9274
+ this.eventDispatcherService = eventDispatcherService;
9005
9275
  this.cacheSubject = new ReplaySubject(1);
9006
9276
  }
9007
9277
  get() {
@@ -9024,6 +9294,7 @@ class SoleDetailsService {
9024
9294
  return this.http.post(`${this.environment.apiV2}/sole-details`, soleDetails).pipe(map((soleDetailsBase) => {
9025
9295
  this.cache = plainToClass(SoleDetails, soleDetailsBase);
9026
9296
  this.cacheSubject.next(this.cache);
9297
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.SOLE_DETAILS_CREATED, soleDetails));
9027
9298
  return this.cache;
9028
9299
  }));
9029
9300
  }
@@ -9031,11 +9302,12 @@ class SoleDetailsService {
9031
9302
  return this.http.put(`${this.environment.apiV2}/sole-details/${soleDetails.id}`, soleDetails).pipe(map((soleDetailsBase) => {
9032
9303
  this.cache = plainToClass(SoleDetails, soleDetailsBase);
9033
9304
  this.cacheSubject.next(this.cache);
9305
+ this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.SOLE_DETAILS_UPDATED, soleDetails));
9034
9306
  return this.cache;
9035
9307
  }));
9036
9308
  }
9037
9309
  }
9038
- 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 });
9039
9311
  SoleDetailsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDetailsService, providedIn: 'root' });
9040
9312
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleDetailsService, decorators: [{
9041
9313
  type: Injectable,
@@ -9045,7 +9317,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
9045
9317
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
9046
9318
  type: Inject,
9047
9319
  args: ['environment']
9048
- }] }]; } });
9320
+ }] }, { type: EventDispatcherService }]; } });
9049
9321
 
9050
9322
  class SoleInvoiceService extends RestService {
9051
9323
  constructor() {
@@ -11024,50 +11296,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
11024
11296
  }]
11025
11297
  }] });
11026
11298
 
11027
- /**
11028
- * server sent events service
11029
- * https://symfony.com/doc/current/mercure.html
11030
- */
11031
- class SseService {
11032
- constructor(zone, jwtService, environment) {
11033
- this.zone = zone;
11034
- this.jwtService = jwtService;
11035
- this.environment = environment;
11036
- }
11037
- /**
11038
- * list to url for server events
11039
- */
11040
- on(topic) {
11041
- const url = new URL(this.environment.mercureUrl);
11042
- url.searchParams.append('topic', `${this.environment.apiV2}/users/${this.jwtService.decodeToken().username}/${topic}`);
11043
- // tslint:disable-next-line:typedef
11044
- return new Observable((observer) => {
11045
- const es = new EventSourcePolyfill(url, {
11046
- headers: {
11047
- Authorization: 'Bearer ' + this.jwtService.getToken(),
11048
- }
11049
- });
11050
- es.onmessage = (event) => {
11051
- this.zone.run(() => observer.next(event));
11052
- };
11053
- })
11054
- .pipe(map((messageEvent) => {
11055
- return JSON.parse(messageEvent.data);
11056
- }));
11057
- }
11058
- }
11059
- 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 });
11060
- SseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, providedIn: 'root' });
11061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SseService, decorators: [{
11062
- type: Injectable,
11063
- args: [{
11064
- providedIn: 'root'
11065
- }]
11066
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: JwtService }, { type: undefined, decorators: [{
11067
- type: Inject,
11068
- args: ['environment']
11069
- }] }]; } });
11070
-
11071
11299
  /**
11072
11300
  * Service for work with chats
11073
11301
  */
@@ -13552,152 +13780,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
13552
13780
  }]
13553
13781
  }] });
13554
13782
 
13555
- /**
13556
- * Service to work with user
13557
- */
13558
- class UserService {
13559
- constructor(http, jwtService, eventDispatcherService, sseService, environment) {
13560
- this.http = http;
13561
- this.jwtService = jwtService;
13562
- this.eventDispatcherService = eventDispatcherService;
13563
- this.sseService = sseService;
13564
- this.environment = environment;
13565
- this.cacheSubject = new ReplaySubject(1);
13566
- this.listenEvents();
13567
- }
13568
- listenEvents() {
13569
- this.listenServiceSubscriptionUpdated();
13570
- }
13571
- get() {
13572
- if (!this.cache) {
13573
- this.fetch().subscribe(() => { }, (error) => {
13574
- // force logout user (clear localStorage) when get current user return error
13575
- if (error.status === 500) {
13576
- this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.CURRENT_USER_GET_FAILED, null));
13577
- }
13578
- });
13579
- }
13580
- return this.cacheSubject.asObservable();
13581
- }
13582
- /**
13583
- * Get current user
13584
- */
13585
- fetch() {
13586
- return this.http.get(`${this.environment.apiV2}/users/current`)
13587
- .pipe(map((userBase) => {
13588
- const user = plainToClass(User, userBase);
13589
- localStorage.setItem('userId', user.id.toString());
13590
- // @TODO remove
13591
- localStorage.setItem('financialYear', user.financialYear.toString());
13592
- this.cache = user;
13593
- this.cacheSubject.next(this.cache);
13594
- return user;
13595
- }));
13596
- }
13597
- /**
13598
- * Register new user
13599
- */
13600
- register(data) {
13601
- return this.http.post(`${this.environment.apiV2}/users/registration`, data);
13602
- }
13603
- /**
13604
- * Update user
13605
- */
13606
- update(user) {
13607
- return this.http.put(`${this.environment.apiV2}/users/${user.id}`, user)
13608
- .pipe(map((userBase) => {
13609
- this.cache = plainToClass(User, userBase);
13610
- this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.USER_UPDATED, null));
13611
- this.cacheSubject.next(this.cache);
13612
- }));
13613
- }
13614
- /**
13615
- * Change user password
13616
- */
13617
- changePassword(currentPassword, newPassword) {
13618
- return this.http.put(`${this.environment.apiV2}/users/password/change`, { currentPassword, newPassword });
13619
- }
13620
- /**
13621
- * Recovery user password
13622
- */
13623
- recoveryPassword(email) {
13624
- return this.http.put(`${this.environment.apiV2}/users/password/recovery`, { email });
13625
- }
13626
- /**
13627
- * Reset user password
13628
- */
13629
- resetPassword(newPassword, resetToken) {
13630
- return this.http.put(`${this.environment.apiV2}/users/password/reset`, { newPassword, resetToken });
13631
- }
13632
- resendConfirmationEmail(email) {
13633
- return this.http.post(`${this.environment.apiV2}/users/confirmation/resend`, { email });
13634
- }
13635
- /**
13636
- * Confirm registered user
13637
- */
13638
- confirm(verificationCode) {
13639
- return this.http.post(`${this.environment.apiV2}/users/confirmation`, { verificationCode });
13640
- }
13641
- /**
13642
- * Search existing user
13643
- */
13644
- search(email) {
13645
- return this.http.get(`${this.environment.apiV2}/users/search?email=${email}`)
13646
- .pipe(map((userBase) => {
13647
- return plainToClass(User, userBase);
13648
- }));
13649
- }
13650
- /**
13651
- * Finish onboarding process
13652
- */
13653
- finishOnboarding(user) {
13654
- return this.http.put(`${this.environment.apiV2}/users/status`, user)
13655
- .pipe(map(() => {
13656
- this.cache = user;
13657
- this.cacheSubject.next(this.cache);
13658
- }));
13659
- }
13660
- /**
13661
- * Update user photo
13662
- */
13663
- updatePhoto(photo) {
13664
- return this.http.post(`${this.environment.apiV2}/users/photo?_method=PUT`, photo)
13665
- .pipe(map((photoUrl) => {
13666
- this.cache = plainToClass(User, Object.assign(this.cache, { photo: photoUrl }));
13667
- this.cacheSubject.next(this.cache);
13668
- }));
13669
- }
13670
- switchFinancialYear(year) {
13671
- return this.http.get(`${this.environment.apiV2}/financial-year/switch`, { params: new HttpParams({ fromString: `financialYear=${year}` }) }).pipe(map(() => {
13672
- localStorage.setItem('financialYear', year.toString());
13673
- window.location.reload();
13674
- }));
13675
- }
13676
- /**
13677
- * clear service cache
13678
- */
13679
- resetCache() {
13680
- this.fetch().subscribe();
13681
- }
13682
- /**
13683
- * Update cache when user's service subscription is updated
13684
- */
13685
- listenServiceSubscriptionUpdated() {
13686
- this.eventDispatcherService.on(AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(() => this.resetCache());
13687
- }
13688
- }
13689
- 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 });
13690
- UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, providedIn: 'root' });
13691
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UserService, decorators: [{
13692
- type: Injectable,
13693
- args: [{
13694
- providedIn: 'root'
13695
- }]
13696
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: JwtService }, { type: EventDispatcherService }, { type: SseService }, { type: undefined, decorators: [{
13697
- type: Inject,
13698
- args: ['environment']
13699
- }] }]; } });
13700
-
13701
13783
  /**
13702
13784
  * Service to work with XLSX (generate, download, e.t.c.)
13703
13785
  */
@@ -14180,7 +14262,11 @@ var MessagesEnum;
14180
14262
  */
14181
14263
  function minDateValidator(date, message = MessagesEnum.INVALID_DATE.replace('$1', new DatePipe('en-US').transform(date))) {
14182
14264
  return (control) => {
14183
- if (!control.value || (control.value >= date)) {
14265
+ if (!control.value) {
14266
+ return null;
14267
+ }
14268
+ // form control value can be as a Moment object - we wrap it in "new Date()" to work with it like with JS Date
14269
+ if (new Date(control.value) >= new Date(date)) {
14184
14270
  return null;
14185
14271
  }
14186
14272
  return { minDate: message };
@@ -14279,7 +14365,7 @@ class SoleBusinessForm extends AbstractForm {
14279
14365
  name: new FormControl(business.name, Validators.required),
14280
14366
  activity: new FormControl(business.activity, Validators.required),
14281
14367
  description: new FormControl(business.description),
14282
- website: new FormControl(business.website),
14368
+ website: new FormControl(business.website)
14283
14369
  }, business);
14284
14370
  // User have to create income source with new business.
14285
14371
  // Income source is not able for edit business
@@ -14296,11 +14382,20 @@ class SoleBusinessForm extends AbstractForm {
14296
14382
  })
14297
14383
  ])
14298
14384
  }));
14385
+ this.addControl('losses', new FormArray([
14386
+ new FormGroup({
14387
+ financialYear: new FormControl(new FinancialYear().year),
14388
+ openBalance: new FormControl(null, Validators.required)
14389
+ })
14390
+ ]));
14299
14391
  }
14300
14392
  }
14301
14393
  get forecastFormGroup() {
14302
14394
  return this.get('incomeSource').get('soleForecasts').at(0);
14303
14395
  }
14396
+ get lossFormGroup() {
14397
+ return this.get('losses').at(0);
14398
+ }
14304
14399
  }
14305
14400
 
14306
14401
  /**
@@ -14388,10 +14483,22 @@ class SoleDepreciationMethodForm extends AbstractForm {
14388
14483
  }
14389
14484
  }
14390
14485
 
14486
+ /**
14487
+ * Validator check if entered strong length is equal to passed length parameter
14488
+ */
14489
+ function requiredLengthValidator(length) {
14490
+ return (control) => {
14491
+ if (control.value && control.value.length !== length) {
14492
+ return { requiredLength: length };
14493
+ }
14494
+ return null;
14495
+ };
14496
+ }
14497
+
14391
14498
  class SoleDetailsForm extends AbstractForm {
14392
14499
  constructor(soleDetails) {
14393
14500
  super({
14394
- abn: new FormControl(soleDetails.abn, [Validators.required, Validators.minLength(11), Validators.maxLength(11)]),
14501
+ abn: new FormControl(soleDetails.abn, [Validators.required, requiredLengthValidator(11)]),
14395
14502
  isGST: new FormControl(soleDetails.isGST || false)
14396
14503
  }, soleDetails);
14397
14504
  }
@@ -15262,5 +15369,5 @@ VehicleLogbookForm.maxDescriptionLength = 60;
15262
15369
  * Generated bundle index. Do not edit.
15263
15370
  */
15264
15371
 
15265
- 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 };
15372
+ 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 };
15266
15373
  //# sourceMappingURL=taxtank-core.js.map