taxtank-core 0.33.68 → 0.33.70
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/esm2022/src/lib/services/http/bank/bank-account/bank-account.service.mjs +18 -2
- package/esm2022/src/lib/services/http/bank/bank-connection/bank-connection.service.mjs +17 -5
- package/esm2022/src/lib/services/http/firm/client-invite/client-invite.service.mjs +20 -4
- package/esm2022/src/lib/services/http/rest/rest.service.mjs +6 -8
- package/esm2022/src/lib/services/xlsx/xlsx.service.mjs +18 -10
- package/fesm2022/taxtank-core.mjs +122 -75
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/services/http/bank/bank-account/bank-account.service.d.ts +1 -0
- package/src/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +1 -1
- package/src/lib/services/http/firm/client-invite/client-invite.service.d.ts +1 -1
- package/src/lib/services/xlsx/xlsx.service.d.ts +7 -0
@@ -5,7 +5,7 @@ import { formatDate, CommonModule, CurrencyPipe, DatePipe } from '@angular/commo
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
6
6
|
import { HttpParams, HttpClient, HttpErrorResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
|
7
7
|
import { map, catchError, mergeMap, filter, first as first$1, finalize, debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
|
8
|
-
import { ReplaySubject, throwError, Subject, Observable, combineLatest, BehaviorSubject, forkJoin,
|
8
|
+
import { ReplaySubject, throwError, Subject, Observable, of, combineLatest, BehaviorSubject, forkJoin, from, merge as merge$1 } from 'rxjs';
|
9
9
|
import { plainToClass, Type, Transform, Exclude, Expose, classToPlain } from 'class-transformer';
|
10
10
|
import { __decorate } from 'tslib';
|
11
11
|
import get from 'lodash/get';
|
@@ -11389,11 +11389,6 @@ let RestService$1 = class RestService extends DataService {
|
|
11389
11389
|
* Get data from backend and fill the cache
|
11390
11390
|
*/
|
11391
11391
|
fetch(path = this.apiUrl, cache = true) {
|
11392
|
-
this.handleAccessError('get');
|
11393
|
-
if (!this.hasRoles()) {
|
11394
|
-
this.setCache([], true);
|
11395
|
-
return this.getCacheSubjectObservable();
|
11396
|
-
}
|
11397
11392
|
// Set cache as empty collection to avoid multiple requests before cache filled
|
11398
11393
|
this.setCache([]);
|
11399
11394
|
return this.http.get(path)
|
@@ -11403,6 +11398,10 @@ let RestService$1 = class RestService extends DataService {
|
|
11403
11398
|
}), catchError((error) => this.handleError(error)));
|
11404
11399
|
}
|
11405
11400
|
get(path = this.apiUrl) {
|
11401
|
+
this.handleAccessError('get');
|
11402
|
+
if (!this.hasRoles()) {
|
11403
|
+
return of(this.createCollectionInstance(this.collectionClass, []));
|
11404
|
+
}
|
11406
11405
|
if (!this.cache) {
|
11407
11406
|
this.fetch(path).pipe(first$1()).subscribe();
|
11408
11407
|
}
|
@@ -11412,7 +11411,6 @@ let RestService$1 = class RestService extends DataService {
|
|
11412
11411
|
return this.get().pipe(map((projects) => projects.filterBy(path, values)));
|
11413
11412
|
}
|
11414
11413
|
getFirst() {
|
11415
|
-
this.handleAccessError('get');
|
11416
11414
|
return this.get().pipe(map((collection) => collection.first));
|
11417
11415
|
}
|
11418
11416
|
hasInCache(id) {
|
@@ -11639,6 +11637,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
11639
11637
|
args: ['environment']
|
11640
11638
|
}] }] });
|
11641
11639
|
|
11640
|
+
var UserEventTypeTypeEnum;
|
11641
|
+
(function (UserEventTypeTypeEnum) {
|
11642
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTERED"] = 1000] = "REGISTERED";
|
11643
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PASSWORD_RESET_REQUEST"] = 1001] = "PASSWORD_RESET_REQUEST";
|
11644
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["APP_FEATURES"] = 1010] = "APP_FEATURES";
|
11645
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
|
11646
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
|
11647
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
|
11648
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
|
11649
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_PAYMENT_FAILED"] = 2006] = "SUBSCRIPTION_PAYMENT_FAILED";
|
11650
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
|
11651
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
|
11652
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
|
11653
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
|
11654
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
|
11655
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
|
11656
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
|
11657
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
|
11658
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
|
11659
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
|
11660
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
|
11661
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
|
11662
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
|
11663
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_SUBSCRIBED"] = 2028] = "OWNER_SUBSCRIBED";
|
11664
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_UNSUBSCRIBED"] = 2029] = "OWNER_UNSUBSCRIBED";
|
11665
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
|
11666
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
|
11667
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
|
11668
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
|
11669
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["INVOICE_AUTO_ALLOCATED"] = 2035] = "INVOICE_AUTO_ALLOCATED";
|
11670
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["INVOICE_AUTO_PART_ALLOCATED"] = 2036] = "INVOICE_AUTO_PART_ALLOCATED";
|
11671
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["RULES_AUTO_ALLOCATED"] = 2037] = "RULES_AUTO_ALLOCATED";
|
11672
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
|
11673
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
|
11674
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_EMAIL_CONFIRMED"] = 2050] = "CLIENT_EMAIL_CONFIRMED";
|
11675
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
|
11676
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_TO_REGISTER"] = 3000] = "FIRM_INVITE_TO_REGISTER";
|
11677
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE"] = 3001] = "FIRM_INVITE";
|
11678
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_ACCEPTED"] = 3002] = "CLIENT_INVITE_ACCEPTED";
|
11679
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REJECTED"] = 3003] = "CLIENT_INVITE_REJECTED";
|
11680
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REGISTERED"] = 3004] = "CLIENT_INVITE_REGISTERED";
|
11681
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_NEW_CLIENT"] = 3005] = "FIRM_NEW_CLIENT";
|
11682
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_LOST_CLIENT"] = 3006] = "FIRM_LOST_CLIENT";
|
11683
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE"] = 3010] = "EMPLOYEE_INVITE";
|
11684
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_LOST_CLIENT"] = 3011] = "EMPLOYEE_LOST_CLIENT";
|
11685
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_NEW_CLIENT"] = 3012] = "EMPLOYEE_NEW_CLIENT";
|
11686
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE_ACCEPTED"] = 3013] = "EMPLOYEE_INVITE_ACCEPTED";
|
11687
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_EMAIL_CONFIRMED"] = 3020] = "EMPLOYEE_EMAIL_CONFIRMED";
|
11688
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_RECEIVED"] = 3030] = "TAX_REVIEW_RECEIVED";
|
11689
|
+
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SHARESIGHT_IMPORT"] = 2070] = "SHARESIGHT_IMPORT";
|
11690
|
+
})(UserEventTypeTypeEnum || (UserEventTypeTypeEnum = {}));
|
11691
|
+
|
11642
11692
|
/**
|
11643
11693
|
* Service that handling user's bank accounts logic
|
11644
11694
|
*/
|
@@ -11664,10 +11714,12 @@ class BankAccountService extends RestService$1 {
|
|
11664
11714
|
*/
|
11665
11715
|
listenEvents() {
|
11666
11716
|
this.listenToEventDispatcherChanges();
|
11717
|
+
// @TODO why?
|
11667
11718
|
this.listenCSE(BankTransaction, this.refreshCache, ['post', 'delete']);
|
11668
11719
|
this.listenCSE(PropertyShare, this.refreshCache, ['put']);
|
11669
11720
|
this.listenCSE(BankConnection, this.refreshCache, ['post']);
|
11670
|
-
this.
|
11721
|
+
this.listenNotifications();
|
11722
|
+
// this.listenConnections();
|
11671
11723
|
}
|
11672
11724
|
/**
|
11673
11725
|
* Update bank account current balance
|
@@ -11701,6 +11753,19 @@ class BankAccountService extends RestService$1 {
|
|
11701
11753
|
this.refreshCache();
|
11702
11754
|
});
|
11703
11755
|
}
|
11756
|
+
listenNotifications() {
|
11757
|
+
this.eventDispatcherService.on(AppEventTypeEnum.NOTIFICATION_ADDED).subscribe((notification) => {
|
11758
|
+
const events = [
|
11759
|
+
UserEventTypeTypeEnum.BASIQ_NEW_ACCOUNTS,
|
11760
|
+
UserEventTypeTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE,
|
11761
|
+
UserEventTypeTypeEnum.BASIQ_AUTHORIZATION_FAIL,
|
11762
|
+
];
|
11763
|
+
if (!notification.isRead && events.includes(notification.eventType)) {
|
11764
|
+
// @TODO TT-3826 move to unified mercure event
|
11765
|
+
this.refreshCache();
|
11766
|
+
}
|
11767
|
+
});
|
11768
|
+
}
|
11704
11769
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BankAccountService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: SseService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
11705
11770
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BankAccountService, providedIn: 'root' }); }
|
11706
11771
|
}
|
@@ -11752,12 +11817,10 @@ class BankConnectionService extends RestService$1 {
|
|
11752
11817
|
this.collectionClass = Collection;
|
11753
11818
|
this.endpointUri = 'bank-connections';
|
11754
11819
|
this.disabledMethods = ['postBatch', 'putBatch', 'delete', 'deleteBatch'];
|
11755
|
-
this.mercureTopic = 'bankConnections';
|
11756
11820
|
this.listenEvents();
|
11757
11821
|
}
|
11758
11822
|
listenEvents() {
|
11759
|
-
|
11760
|
-
this.listenSSE();
|
11823
|
+
this.listenNotifications();
|
11761
11824
|
}
|
11762
11825
|
/**
|
11763
11826
|
* there is no put BankConnection method, we have to post to update
|
@@ -11800,6 +11863,19 @@ class BankConnectionService extends RestService$1 {
|
|
11800
11863
|
deactivate(bankConnection) {
|
11801
11864
|
return this.put(bankConnection, `${this.apiUrl}/${bankConnection.id}/deactivate`);
|
11802
11865
|
}
|
11866
|
+
listenNotifications() {
|
11867
|
+
this.eventDispatcherService.on(AppEventTypeEnum.NOTIFICATION_ADDED).subscribe((notification) => {
|
11868
|
+
const events = [
|
11869
|
+
UserEventTypeTypeEnum.BASIQ_NEW_ACCOUNTS,
|
11870
|
+
UserEventTypeTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE,
|
11871
|
+
UserEventTypeTypeEnum.BASIQ_AUTHORIZATION_FAIL,
|
11872
|
+
];
|
11873
|
+
if (!notification.isRead && events.includes(notification.eventType)) {
|
11874
|
+
// @TODO TT-3826 move to unified mercure event
|
11875
|
+
this.refreshCache();
|
11876
|
+
}
|
11877
|
+
});
|
11878
|
+
}
|
11803
11879
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BankConnectionService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
11804
11880
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BankConnectionService, providedIn: 'root' }); }
|
11805
11881
|
}
|
@@ -11813,58 +11889,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
11813
11889
|
args: ['environment']
|
11814
11890
|
}] }] });
|
11815
11891
|
|
11816
|
-
var UserEventTypeTypeEnum;
|
11817
|
-
(function (UserEventTypeTypeEnum) {
|
11818
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTERED"] = 1000] = "REGISTERED";
|
11819
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PASSWORD_RESET_REQUEST"] = 1001] = "PASSWORD_RESET_REQUEST";
|
11820
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["APP_FEATURES"] = 1010] = "APP_FEATURES";
|
11821
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
|
11822
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
|
11823
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
|
11824
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
|
11825
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_PAYMENT_FAILED"] = 2006] = "SUBSCRIPTION_PAYMENT_FAILED";
|
11826
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
|
11827
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
|
11828
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
|
11829
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
|
11830
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
|
11831
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
|
11832
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
|
11833
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
|
11834
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
|
11835
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
|
11836
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
|
11837
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
|
11838
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
|
11839
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_SUBSCRIBED"] = 2028] = "OWNER_SUBSCRIBED";
|
11840
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_UNSUBSCRIBED"] = 2029] = "OWNER_UNSUBSCRIBED";
|
11841
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
|
11842
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
|
11843
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
|
11844
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
|
11845
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["INVOICE_AUTO_ALLOCATED"] = 2035] = "INVOICE_AUTO_ALLOCATED";
|
11846
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["INVOICE_AUTO_PART_ALLOCATED"] = 2036] = "INVOICE_AUTO_PART_ALLOCATED";
|
11847
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["RULES_AUTO_ALLOCATED"] = 2037] = "RULES_AUTO_ALLOCATED";
|
11848
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
|
11849
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
|
11850
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_EMAIL_CONFIRMED"] = 2050] = "CLIENT_EMAIL_CONFIRMED";
|
11851
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
|
11852
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_TO_REGISTER"] = 3000] = "FIRM_INVITE_TO_REGISTER";
|
11853
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE"] = 3001] = "FIRM_INVITE";
|
11854
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_ACCEPTED"] = 3002] = "CLIENT_INVITE_ACCEPTED";
|
11855
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REJECTED"] = 3003] = "CLIENT_INVITE_REJECTED";
|
11856
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REGISTERED"] = 3004] = "CLIENT_INVITE_REGISTERED";
|
11857
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_NEW_CLIENT"] = 3005] = "FIRM_NEW_CLIENT";
|
11858
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_LOST_CLIENT"] = 3006] = "FIRM_LOST_CLIENT";
|
11859
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE"] = 3010] = "EMPLOYEE_INVITE";
|
11860
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_LOST_CLIENT"] = 3011] = "EMPLOYEE_LOST_CLIENT";
|
11861
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_NEW_CLIENT"] = 3012] = "EMPLOYEE_NEW_CLIENT";
|
11862
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE_ACCEPTED"] = 3013] = "EMPLOYEE_INVITE_ACCEPTED";
|
11863
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_EMAIL_CONFIRMED"] = 3020] = "EMPLOYEE_EMAIL_CONFIRMED";
|
11864
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_RECEIVED"] = 3030] = "TAX_REVIEW_RECEIVED";
|
11865
|
-
UserEventTypeTypeEnum[UserEventTypeTypeEnum["SHARESIGHT_IMPORT"] = 2070] = "SHARESIGHT_IMPORT";
|
11866
|
-
})(UserEventTypeTypeEnum || (UserEventTypeTypeEnum = {}));
|
11867
|
-
|
11868
11892
|
/**
|
11869
11893
|
* Service for bank transactions business logic
|
11870
11894
|
*/
|
@@ -12790,12 +12814,10 @@ class ClientInviteService extends RestService$1 {
|
|
12790
12814
|
this.endpointUri = 'client-invites';
|
12791
12815
|
this.collectionClass = ClientInviteCollection;
|
12792
12816
|
this.modelClass = ClientInvite;
|
12793
|
-
this.mercureTopic = 'clientInvites';
|
12794
12817
|
this.listenEvents();
|
12795
12818
|
}
|
12796
12819
|
listenEvents() {
|
12797
|
-
|
12798
|
-
this.listenSSE();
|
12820
|
+
this.listenNotifications();
|
12799
12821
|
}
|
12800
12822
|
/**
|
12801
12823
|
* Get invite which employee is TaxTank Advisor
|
@@ -12859,6 +12881,23 @@ class ClientInviteService extends RestService$1 {
|
|
12859
12881
|
return throwError(error);
|
12860
12882
|
}));
|
12861
12883
|
}
|
12884
|
+
listenNotifications() {
|
12885
|
+
this.eventDispatcherService.on(AppEventTypeEnum.NOTIFICATION_ADDED).subscribe((notification) => {
|
12886
|
+
const events = [
|
12887
|
+
UserEventTypeTypeEnum.CLIENT_INVITE,
|
12888
|
+
UserEventTypeTypeEnum.FIRM_INVITE_ACCEPTED,
|
12889
|
+
UserEventTypeTypeEnum.FIRM_INVITE_REJECTED,
|
12890
|
+
UserEventTypeTypeEnum.FIRM_INVITE,
|
12891
|
+
UserEventTypeTypeEnum.CLIENT_INVITE_ACCEPTED,
|
12892
|
+
UserEventTypeTypeEnum.CLIENT_INVITE_REJECTED,
|
12893
|
+
UserEventTypeTypeEnum.CLIENT_INVITE_REGISTERED,
|
12894
|
+
];
|
12895
|
+
if (!notification.isRead && events.includes(notification.eventType)) {
|
12896
|
+
// @TODO TT-3826 move to unified mercure event
|
12897
|
+
this.refreshCache();
|
12898
|
+
}
|
12899
|
+
});
|
12900
|
+
}
|
12862
12901
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ClientInviteService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
12863
12902
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ClientInviteService, providedIn: 'root' }); }
|
12864
12903
|
}
|
@@ -19847,15 +19886,8 @@ class XlsxService {
|
|
19847
19886
|
// add caption for the current table
|
19848
19887
|
xlsx.utils.sheet_add_aoa(worksheet, [[data.caption?.innerText]], { origin: -1 });
|
19849
19888
|
// Prepare to add table data to the worksheet, processing each cell
|
19850
|
-
const rows = Array.from(data.rows)
|
19851
|
-
|
19852
|
-
// Convert currency strings like "$0.00" to numbers
|
19853
|
-
if (/^-?\$/.test(cellValue)) {
|
19854
|
-
// @TODO vik fix
|
19855
|
-
// cellValue = parseFloat(cellValue.replace('$', ''));
|
19856
|
-
}
|
19857
|
-
return cellValue;
|
19858
|
-
}));
|
19889
|
+
const rows = Array.from(data.rows)
|
19890
|
+
.map((row) => Array.from(row.cells).map(cell => this.htmlToXlsCell(cell)));
|
19859
19891
|
// Add the processed table data to the worksheet
|
19860
19892
|
xlsx.utils.sheet_add_aoa(worksheet, rows, { origin: -1 });
|
19861
19893
|
// set empty row after current table
|
@@ -19864,6 +19896,21 @@ class XlsxService {
|
|
19864
19896
|
xlsx.utils.book_append_sheet(workbook, worksheet);
|
19865
19897
|
return xlsx.write(workbook, { bookType: 'xlsx', type: 'array' });
|
19866
19898
|
}
|
19899
|
+
htmlToXlsCell(cell) {
|
19900
|
+
const cellValue = cell.innerText;
|
19901
|
+
// regex to check currency value
|
19902
|
+
return /^-?\$/.test(cellValue) ? this.currencyToNumber(cellValue) : cellValue;
|
19903
|
+
}
|
19904
|
+
/**
|
19905
|
+
* function which reconverts values from customCurrencyPipe
|
19906
|
+
* @param cellValue - string with $ and possibly comma. $123,123.03
|
19907
|
+
* @returns value without $ and comma. like 123123.03
|
19908
|
+
*/
|
19909
|
+
currencyToNumber(cellValue) {
|
19910
|
+
// remove dollar sign and comma
|
19911
|
+
cellValue = cellValue.replace(/[$,]/g, '');
|
19912
|
+
return parseFloat(cellValue);
|
19913
|
+
}
|
19867
19914
|
/**
|
19868
19915
|
* @TODO vik/artem work with ExportDataTable instead of ExportableCollection
|
19869
19916
|
* @TODO vik/artem why so much code? here is 6 rows solution https://stackoverflow.com/questions/64939994/how-to-export-array-of-objects-to-an-excel-in-angular-8
|