taxtank-core 0.16.0 → 0.16.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.
- package/bundles/taxtank-core.umd.js +104 -62
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/db/Models/user/client-details.js +1 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +38 -37
- package/esm2015/lib/services/http/bank/basiq/basiq.service.js +17 -1
- package/esm2015/lib/services/http/property/property.service.js +1 -8
- package/esm2015/lib/services/http/user/user.service.js +51 -18
- package/fesm2015/taxtank-core.js +100 -60
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/db/Models/user/client-details.d.ts +1 -1
- package/lib/models/event/app-event-type.enum.d.ts +37 -36
- package/lib/services/http/bank/basiq/basiq.service.d.ts +8 -0
- package/lib/services/http/property/property.service.d.ts +0 -4
- package/lib/services/http/user/user.service.d.ts +17 -3
- package/package.json +1 -1
|
@@ -7535,42 +7535,43 @@
|
|
|
7535
7535
|
AppEventTypeEnum[AppEventTypeEnum["BANK_ACCOUNT_CREATED"] = 2] = "BANK_ACCOUNT_CREATED";
|
|
7536
7536
|
AppEventTypeEnum[AppEventTypeEnum["BANK_ACCOUNT_UPDATED"] = 3] = "BANK_ACCOUNT_UPDATED";
|
|
7537
7537
|
AppEventTypeEnum[AppEventTypeEnum["BANK_TRANSACTION_ALLOCATED"] = 4] = "BANK_TRANSACTION_ALLOCATED";
|
|
7538
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7539
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7540
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7541
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7542
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7543
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7544
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7545
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7546
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7547
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7548
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7549
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7550
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7551
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7552
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7553
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7554
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7555
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7556
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7557
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7558
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7559
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7560
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7561
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7562
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7563
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7564
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7565
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7566
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7567
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7568
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7569
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7570
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7571
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7572
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7573
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7538
|
+
AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONSENT_UPDATED"] = 5] = "BASIQ_CONSENT_UPDATED";
|
|
7539
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_INVITE_ACCEPTED"] = 6] = "CLIENT_INVITE_ACCEPTED";
|
|
7540
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_OPEN_CHAT"] = 7] = "CLIENT_OPEN_CHAT";
|
|
7541
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_TRANSFER_TO_OTHER_EMPLOYEE"] = 8] = "CLIENT_TRANSFER_TO_OTHER_EMPLOYEE";
|
|
7542
|
+
AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 9] = "DEPRECIATION_DELETED";
|
|
7543
|
+
AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 10] = "DEPRECIATIONS_CREATED";
|
|
7544
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 11] = "INCOME_SOURCES_CREATED";
|
|
7545
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 12] = "INCOME_SOURCES_UPDATED";
|
|
7546
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 13] = "INCOME_SOURCES_FORECASTS_CREATED";
|
|
7547
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 14] = "INCOME_SOURCES_FORECASTS_UPDATED";
|
|
7548
|
+
AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 15] = "LOAN_UPDATED";
|
|
7549
|
+
AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 16] = "LOAN_PAYOUT_UPDATED";
|
|
7550
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 17] = "MESSAGE_CREATED";
|
|
7551
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 18] = "MESSAGE_FILE_CREATED";
|
|
7552
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 19] = "MESSAGE_FILE_DELETED";
|
|
7553
|
+
AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 20] = "NOTIFICATION_ADDED";
|
|
7554
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 21] = "PROPERTY_UPDATED_WITH_DOCUMENT";
|
|
7555
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 22] = "PROPERTY_DOCUMENT_ADDED";
|
|
7556
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 23] = "PROPERTY_MOVEMENT_CREATED";
|
|
7557
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 24] = "PROPERTY_MOVEMENT_UPDATED";
|
|
7558
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 25] = "PROPERTY_MOVEMENT_DELETED";
|
|
7559
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 26] = "PROPERTY_SHARE_UPDATED";
|
|
7560
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 27] = "PROPERTY_SUBSCRIPTION_ADDED";
|
|
7561
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 28] = "PROPERTY_SUBSCRIPTION_DELETED";
|
|
7562
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 29] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
|
|
7563
|
+
AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 30] = "SERVICE_SUBSCRIPTION_UPDATED";
|
|
7564
|
+
AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 31] = "TAX_REVIEW_UPDATED";
|
|
7565
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 32] = "TRANSACTION_CREATED";
|
|
7566
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 33] = "TRANSACTION_DELETED";
|
|
7567
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 34] = "TRANSACTION_UPDATED";
|
|
7568
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 35] = "TRANSACTIONS_CREATED";
|
|
7569
|
+
AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 36] = "USER_UPDATED";
|
|
7570
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 37] = "VEHICLE_CLAIM_UPDATED";
|
|
7571
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 38] = "VEHICLE_CLAIM_CREATED";
|
|
7572
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 39] = "VEHICLE_LOGBOOK_CREATED";
|
|
7573
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 40] = "VEHICLE_LOGBOOK_UPDATED";
|
|
7574
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 41] = "VEHICLE_LOGBOOK_DELETED";
|
|
7574
7575
|
})(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
|
|
7575
7576
|
|
|
7576
7577
|
/**
|
|
@@ -9225,7 +9226,6 @@
|
|
|
9225
9226
|
}
|
|
9226
9227
|
PropertyService.prototype.listenEvents = function () {
|
|
9227
9228
|
this.listenShareInviteAccepted();
|
|
9228
|
-
this.listenServiceSubscriptionUpdated();
|
|
9229
9229
|
// @TODO Alex: consider to refactor property movements logic similar to client-movements
|
|
9230
9230
|
this.listenMovementsChanged();
|
|
9231
9231
|
};
|
|
@@ -9236,13 +9236,6 @@
|
|
|
9236
9236
|
var _this = this;
|
|
9237
9237
|
this.eventDispatcherService.on(exports.AppEventTypeEnum.PROPERTY_SHARE_UPDATED).subscribe(function () { return _this.resetCache(); });
|
|
9238
9238
|
};
|
|
9239
|
-
/**
|
|
9240
|
-
* Update cache when user's service subscription is updated
|
|
9241
|
-
*/
|
|
9242
|
-
PropertyService.prototype.listenServiceSubscriptionUpdated = function () {
|
|
9243
|
-
var _this = this;
|
|
9244
|
-
this.eventDispatcherService.on(exports.AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(function () { return _this.resetCache(); });
|
|
9245
|
-
};
|
|
9246
9239
|
/**
|
|
9247
9240
|
* Update cache when property category changed
|
|
9248
9241
|
*/
|
|
@@ -10448,6 +10441,22 @@
|
|
|
10448
10441
|
this.listenToBankConnectionAdded();
|
|
10449
10442
|
this.listenNotifications();
|
|
10450
10443
|
};
|
|
10444
|
+
/**
|
|
10445
|
+
* Update user's basiq consents data on backend
|
|
10446
|
+
*/
|
|
10447
|
+
BasiqService.prototype.confirmConsents = function () {
|
|
10448
|
+
var _this = this;
|
|
10449
|
+
return this.http.put(this.environment.apiV2 + "/basiq/consents", {}).pipe(operators.map(function (isConfirmed) {
|
|
10450
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_CONSENT_UPDATED, isConfirmed));
|
|
10451
|
+
return isConfirmed;
|
|
10452
|
+
}));
|
|
10453
|
+
};
|
|
10454
|
+
/**
|
|
10455
|
+
* Notify backend to update connections
|
|
10456
|
+
*/
|
|
10457
|
+
BasiqService.prototype.updateConnections = function () {
|
|
10458
|
+
return this.http.post(this.environment.apiV2 + "/basiq/connections", {});
|
|
10459
|
+
};
|
|
10451
10460
|
/**
|
|
10452
10461
|
* access token to use basiq connect ui iframe
|
|
10453
10462
|
*/
|
|
@@ -13229,33 +13238,41 @@
|
|
|
13229
13238
|
* Service to work with user
|
|
13230
13239
|
*/
|
|
13231
13240
|
var UserService = /** @class */ (function () {
|
|
13232
|
-
function UserService(http, jwtService, eventDispatcherService, environment) {
|
|
13241
|
+
function UserService(http, jwtService, eventDispatcherService, sseService, environment) {
|
|
13233
13242
|
this.http = http;
|
|
13234
13243
|
this.jwtService = jwtService;
|
|
13235
13244
|
this.eventDispatcherService = eventDispatcherService;
|
|
13245
|
+
this.sseService = sseService;
|
|
13236
13246
|
this.environment = environment;
|
|
13237
13247
|
this.cacheSubject = new rxjs.ReplaySubject(1);
|
|
13248
|
+
this.listenEvents();
|
|
13238
13249
|
}
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13250
|
+
UserService.prototype.listenEvents = function () {
|
|
13251
|
+
this.listenServiceSubscriptionUpdated();
|
|
13252
|
+
this.listenBasiqConcentUpdated();
|
|
13253
|
+
};
|
|
13242
13254
|
UserService.prototype.get = function () {
|
|
13243
|
-
var _this = this;
|
|
13244
13255
|
if (!this.cache) {
|
|
13245
|
-
this.
|
|
13246
|
-
.pipe(operators.map(function (userBase) {
|
|
13247
|
-
return classTransformer.plainToClass(User, userBase);
|
|
13248
|
-
}))
|
|
13249
|
-
.subscribe(function (user) {
|
|
13250
|
-
localStorage.setItem('userId', user.id.toString());
|
|
13251
|
-
// @TODO remove
|
|
13252
|
-
localStorage.setItem('financialYear', user.financialYear.toString());
|
|
13253
|
-
_this.cache = user;
|
|
13254
|
-
_this.cacheSubject.next(_this.cache);
|
|
13255
|
-
});
|
|
13256
|
+
this.fetch().subscribe();
|
|
13256
13257
|
}
|
|
13257
13258
|
return this.cacheSubject.asObservable();
|
|
13258
13259
|
};
|
|
13260
|
+
/**
|
|
13261
|
+
* Get current user
|
|
13262
|
+
*/
|
|
13263
|
+
UserService.prototype.fetch = function () {
|
|
13264
|
+
var _this = this;
|
|
13265
|
+
return this.http.get(this.environment.apiV2 + "/users/current")
|
|
13266
|
+
.pipe(operators.map(function (userBase) {
|
|
13267
|
+
var user = classTransformer.plainToClass(User, userBase);
|
|
13268
|
+
localStorage.setItem('userId', user.id.toString());
|
|
13269
|
+
// @TODO remove
|
|
13270
|
+
localStorage.setItem('financialYear', user.financialYear.toString());
|
|
13271
|
+
_this.cache = user;
|
|
13272
|
+
_this.cacheSubject.next(_this.cache);
|
|
13273
|
+
return user;
|
|
13274
|
+
}));
|
|
13275
|
+
};
|
|
13259
13276
|
/**
|
|
13260
13277
|
* Register new user
|
|
13261
13278
|
*/
|
|
@@ -13329,9 +13346,34 @@
|
|
|
13329
13346
|
UserService.prototype.switchFinancialYear = function () {
|
|
13330
13347
|
return this.http.get(this.environment.apiV2 + "/financial-year/switch");
|
|
13331
13348
|
};
|
|
13349
|
+
/**
|
|
13350
|
+
* clear service cache
|
|
13351
|
+
*/
|
|
13352
|
+
UserService.prototype.resetCache = function () {
|
|
13353
|
+
this.fetch().subscribe();
|
|
13354
|
+
};
|
|
13355
|
+
/**
|
|
13356
|
+
* Update cache when user's service subscription is updated
|
|
13357
|
+
*/
|
|
13358
|
+
UserService.prototype.listenServiceSubscriptionUpdated = function () {
|
|
13359
|
+
var _this = this;
|
|
13360
|
+
this.eventDispatcherService.on(exports.AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(function () { return _this.resetCache(); });
|
|
13361
|
+
};
|
|
13362
|
+
UserService.prototype.listenBasiqConcentUpdated = function () {
|
|
13363
|
+
var _this = this;
|
|
13364
|
+
this.eventDispatcherService.on(exports.AppEventTypeEnum.BASIQ_CONSENT_UPDATED).subscribe(function (isConfirmed) {
|
|
13365
|
+
if (!isConfirmed) {
|
|
13366
|
+
return;
|
|
13367
|
+
}
|
|
13368
|
+
var user = clone__default["default"](_this.cache);
|
|
13369
|
+
user.clientDetails.basiqConsentExist = true;
|
|
13370
|
+
_this.cache = user;
|
|
13371
|
+
_this.cacheSubject.next(_this.cache);
|
|
13372
|
+
});
|
|
13373
|
+
};
|
|
13332
13374
|
return UserService;
|
|
13333
13375
|
}());
|
|
13334
|
-
UserService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserService, deps: [{ token: i1__namespace.HttpClient }, { token: JwtService }, { token: EventDispatcherService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
13376
|
+
UserService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserService, deps: [{ token: i1__namespace.HttpClient }, { token: JwtService }, { token: EventDispatcherService }, { token: SseService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
13335
13377
|
UserService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserService, providedIn: 'root' });
|
|
13336
13378
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserService, decorators: [{
|
|
13337
13379
|
type: i0.Injectable,
|
|
@@ -13339,7 +13381,7 @@
|
|
|
13339
13381
|
providedIn: 'root'
|
|
13340
13382
|
}]
|
|
13341
13383
|
}], ctorParameters: function () {
|
|
13342
|
-
return [{ type: i1__namespace.HttpClient }, { type: JwtService }, { type: EventDispatcherService }, { type: undefined, decorators: [{
|
|
13384
|
+
return [{ type: i1__namespace.HttpClient }, { type: JwtService }, { type: EventDispatcherService }, { type: SseService }, { type: undefined, decorators: [{
|
|
13343
13385
|
type: i0.Inject,
|
|
13344
13386
|
args: ['environment']
|
|
13345
13387
|
}] }];
|