taxtank-core 0.16.7 → 0.16.10
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 +83 -57
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/db/Enums/income-source-type-list-salary.enum.js +1 -1
- package/esm2015/lib/db/Enums/income-source-type-list-sole.enum.js +5 -0
- package/esm2015/lib/db/Enums/income-source-type-list-work.enum.js +1 -1
- package/esm2015/lib/db/Enums/income-source-type.enum.js +1 -1
- package/esm2015/lib/models/account-setup/account-setup-items.const.js +2 -2
- package/esm2015/lib/models/event/app-event-type.enum.js +38 -37
- package/esm2015/lib/models/toast/toast.js +2 -1
- package/esm2015/lib/services/account-setup/account-setup.service.js +31 -17
- package/esm2015/lib/services/http/bank/basiq/basiq.service.js +5 -3
- package/esm2015/lib/services/http/firm/client-income/client-income-types.service.js +3 -1
- package/esm2015/lib/services/http/rest/rest.service.js +2 -1
- package/esm2015/public-api.js +2 -2
- package/fesm2015/taxtank-core.js +80 -55
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/db/Enums/income-source-type-list-sole.enum.d.ts +3 -0
- package/lib/models/event/app-event-type.enum.d.ts +37 -36
- package/lib/models/toast/toast.d.ts +1 -0
- package/lib/services/http/bank/basiq/basiq.service.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
|
@@ -4371,10 +4371,10 @@
|
|
|
4371
4371
|
return IncomeSourceType;
|
|
4372
4372
|
}(AbstractModel));
|
|
4373
4373
|
|
|
4374
|
-
|
|
4374
|
+
var IncomeSourceTypeListSalaryEnum;
|
|
4375
4375
|
(function (IncomeSourceTypeListSalaryEnum) {
|
|
4376
4376
|
IncomeSourceTypeListSalaryEnum[IncomeSourceTypeListSalaryEnum["BONUSES"] = 1] = "BONUSES";
|
|
4377
|
-
})(
|
|
4377
|
+
})(IncomeSourceTypeListSalaryEnum || (IncomeSourceTypeListSalaryEnum = {}));
|
|
4378
4378
|
|
|
4379
4379
|
exports.IncomeSourceTypeListWorkEnum = void 0;
|
|
4380
4380
|
(function (IncomeSourceTypeListWorkEnum) {
|
|
@@ -4400,7 +4400,7 @@
|
|
|
4400
4400
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4401
4401
|
}
|
|
4402
4402
|
IncomeSourceType.prototype.isSalary = function () {
|
|
4403
|
-
return !!
|
|
4403
|
+
return !!IncomeSourceTypeListSalaryEnum[this.id];
|
|
4404
4404
|
};
|
|
4405
4405
|
IncomeSourceType.prototype.isWork = function () {
|
|
4406
4406
|
return !!exports.IncomeSourceTypeListWorkEnum[this.id];
|
|
@@ -6089,6 +6089,11 @@
|
|
|
6089
6089
|
DepreciationWriteOffAmountEnum[DepreciationWriteOffAmountEnum["BORROWING_EXPENSES"] = 100] = "BORROWING_EXPENSES";
|
|
6090
6090
|
})(exports.DepreciationWriteOffAmountEnum || (exports.DepreciationWriteOffAmountEnum = {}));
|
|
6091
6091
|
|
|
6092
|
+
exports.IncomeSourceTypeListSoleEnum = void 0;
|
|
6093
|
+
(function (IncomeSourceTypeListSoleEnum) {
|
|
6094
|
+
IncomeSourceTypeListSoleEnum[IncomeSourceTypeListSoleEnum["SOLE_TRADER"] = 7] = "SOLE_TRADER";
|
|
6095
|
+
})(exports.IncomeSourceTypeListSoleEnum || (exports.IncomeSourceTypeListSoleEnum = {}));
|
|
6096
|
+
|
|
6092
6097
|
exports.InviteStatusEnum = void 0;
|
|
6093
6098
|
(function (InviteStatusEnum) {
|
|
6094
6099
|
InviteStatusEnum[InviteStatusEnum["PENDING"] = 1] = "PENDING";
|
|
@@ -7575,42 +7580,43 @@
|
|
|
7575
7580
|
AppEventTypeEnum[AppEventTypeEnum["BANK_ACCOUNT_UPDATED"] = 3] = "BANK_ACCOUNT_UPDATED";
|
|
7576
7581
|
AppEventTypeEnum[AppEventTypeEnum["BANK_TRANSACTION_ALLOCATED"] = 4] = "BANK_TRANSACTION_ALLOCATED";
|
|
7577
7582
|
AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONSENT_UPDATED"] = 5] = "BASIQ_CONSENT_UPDATED";
|
|
7578
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7579
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7580
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7581
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7582
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7583
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7584
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7585
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7586
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7587
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7588
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7589
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7590
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7591
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7592
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7593
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7594
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7595
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7596
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7597
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7598
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7599
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7600
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7601
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7602
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7603
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7604
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7605
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7606
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7607
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7608
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7609
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7610
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7611
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7612
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7613
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7583
|
+
AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONNECTION_UPDATED"] = 6] = "BASIQ_CONNECTION_UPDATED";
|
|
7584
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_INVITE_ACCEPTED"] = 7] = "CLIENT_INVITE_ACCEPTED";
|
|
7585
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_OPEN_CHAT"] = 8] = "CLIENT_OPEN_CHAT";
|
|
7586
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_TRANSFER_TO_OTHER_EMPLOYEE"] = 9] = "CLIENT_TRANSFER_TO_OTHER_EMPLOYEE";
|
|
7587
|
+
AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 10] = "DEPRECIATION_DELETED";
|
|
7588
|
+
AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 11] = "DEPRECIATIONS_CREATED";
|
|
7589
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 12] = "INCOME_SOURCES_CREATED";
|
|
7590
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 13] = "INCOME_SOURCES_UPDATED";
|
|
7591
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 14] = "INCOME_SOURCES_FORECASTS_CREATED";
|
|
7592
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 15] = "INCOME_SOURCES_FORECASTS_UPDATED";
|
|
7593
|
+
AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 16] = "LOAN_UPDATED";
|
|
7594
|
+
AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 17] = "LOAN_PAYOUT_UPDATED";
|
|
7595
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 18] = "MESSAGE_CREATED";
|
|
7596
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 19] = "MESSAGE_FILE_CREATED";
|
|
7597
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 20] = "MESSAGE_FILE_DELETED";
|
|
7598
|
+
AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 21] = "NOTIFICATION_ADDED";
|
|
7599
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 22] = "PROPERTY_UPDATED_WITH_DOCUMENT";
|
|
7600
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 23] = "PROPERTY_DOCUMENT_ADDED";
|
|
7601
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 24] = "PROPERTY_MOVEMENT_CREATED";
|
|
7602
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 25] = "PROPERTY_MOVEMENT_UPDATED";
|
|
7603
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 26] = "PROPERTY_MOVEMENT_DELETED";
|
|
7604
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 27] = "PROPERTY_SHARE_UPDATED";
|
|
7605
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 28] = "PROPERTY_SUBSCRIPTION_ADDED";
|
|
7606
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 29] = "PROPERTY_SUBSCRIPTION_DELETED";
|
|
7607
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 30] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
|
|
7608
|
+
AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 31] = "SERVICE_SUBSCRIPTION_UPDATED";
|
|
7609
|
+
AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 32] = "TAX_REVIEW_UPDATED";
|
|
7610
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 33] = "TRANSACTION_CREATED";
|
|
7611
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 34] = "TRANSACTION_DELETED";
|
|
7612
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 35] = "TRANSACTION_UPDATED";
|
|
7613
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 36] = "TRANSACTIONS_CREATED";
|
|
7614
|
+
AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 37] = "USER_UPDATED";
|
|
7615
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 38] = "VEHICLE_CLAIM_UPDATED";
|
|
7616
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 39] = "VEHICLE_CLAIM_CREATED";
|
|
7617
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 40] = "VEHICLE_LOGBOOK_CREATED";
|
|
7618
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 41] = "VEHICLE_LOGBOOK_UPDATED";
|
|
7619
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 42] = "VEHICLE_LOGBOOK_DELETED";
|
|
7614
7620
|
})(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
|
|
7615
7621
|
|
|
7616
7622
|
/**
|
|
@@ -8675,6 +8681,7 @@
|
|
|
8675
8681
|
var Toast = /** @class */ (function () {
|
|
8676
8682
|
function Toast() {
|
|
8677
8683
|
this.duration = 3000;
|
|
8684
|
+
this.autoClose = true;
|
|
8678
8685
|
}
|
|
8679
8686
|
return Toast;
|
|
8680
8687
|
}());
|
|
@@ -8896,7 +8903,7 @@
|
|
|
8896
8903
|
clientIncomeTypes: ['sole']
|
|
8897
8904
|
}),
|
|
8898
8905
|
_a[AccountSetupItemsEnum.TRANSACTION] = classTransformer.plainToClass(AccountSetupItem, {
|
|
8899
|
-
title: '
|
|
8906
|
+
title: 'Allocate transactions',
|
|
8900
8907
|
description: 'Select one or multiple transactions, the category from the dropdown and attach your receipt. It’s that simple to capture every possible deduction, and keep organised all throughout the year.',
|
|
8901
8908
|
url: '/client/bank-feeds',
|
|
8902
8909
|
urlFragment: 'allocationProductTour',
|
|
@@ -8915,6 +8922,8 @@
|
|
|
8915
8922
|
ClientIncomeTypesService.prototype.get = function () {
|
|
8916
8923
|
var _this = this;
|
|
8917
8924
|
if (!this.cache) {
|
|
8925
|
+
// @TODO alex fix everywhere, start with rest service
|
|
8926
|
+
this.cache = classTransformer.plainToClass(ClientIncomeTypes, {});
|
|
8918
8927
|
this.http.get(this.environment.apiV2 + "/client-income-types")
|
|
8919
8928
|
.pipe(operators.map(function (response) {
|
|
8920
8929
|
return classTransformer.plainToClass(ClientIncomeTypes, response['hydra:member'][0], { excludePrefixes: ['@'] });
|
|
@@ -9053,6 +9062,7 @@
|
|
|
9053
9062
|
*/
|
|
9054
9063
|
RestService.prototype.get = function () {
|
|
9055
9064
|
if (!this.cache) {
|
|
9065
|
+
this.cache = [];
|
|
9056
9066
|
this.fetch().subscribe();
|
|
9057
9067
|
}
|
|
9058
9068
|
return this.cacheSubject.asObservable();
|
|
@@ -10042,12 +10052,22 @@
|
|
|
10042
10052
|
AccountSetupService.prototype.get = function () {
|
|
10043
10053
|
var _this = this;
|
|
10044
10054
|
if (!this.cache) {
|
|
10045
|
-
this.
|
|
10055
|
+
this.cache = new AccountSetupItemCollection([]);
|
|
10056
|
+
this.clientIncomeTypesService.get()
|
|
10057
|
+
.pipe(
|
|
10058
|
+
// we need account setup only when user selected at least one income type
|
|
10059
|
+
operators.filter(function (incomeTypes) { return !!incomeTypes.length; }), operators.mergeMap(function (incomeTypes) {
|
|
10046
10060
|
_this.clientIncomeTypesId = incomeTypes.id;
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10061
|
+
return _this.createBatch(incomeTypes);
|
|
10062
|
+
}))
|
|
10063
|
+
.subscribe(function (items) {
|
|
10064
|
+
switch (true) {
|
|
10065
|
+
case !_this.cache:
|
|
10066
|
+
case _this.cache.getBy('isCompleted', true).length !== items.getBy('isCompleted', true).length:
|
|
10067
|
+
case _this.cache.length !== items.length:
|
|
10068
|
+
_this.cache = cloneDeep__default["default"](items);
|
|
10069
|
+
_this.cacheSubject.next(_this.cache);
|
|
10070
|
+
}
|
|
10051
10071
|
});
|
|
10052
10072
|
}
|
|
10053
10073
|
return this.cacheSubject.asObservable();
|
|
@@ -10067,6 +10087,9 @@
|
|
|
10067
10087
|
if (result.length) {
|
|
10068
10088
|
item.isCompleted = true;
|
|
10069
10089
|
}
|
|
10090
|
+
else {
|
|
10091
|
+
item.isCompleted = false;
|
|
10092
|
+
}
|
|
10070
10093
|
return item;
|
|
10071
10094
|
}));
|
|
10072
10095
|
};
|
|
@@ -10078,7 +10101,7 @@
|
|
|
10078
10101
|
var batch = [];
|
|
10079
10102
|
// Salary item is completed when user added salary income source
|
|
10080
10103
|
if (incomeTypes.salary) {
|
|
10081
|
-
batch.push(this.create(AccountSetupItemsEnum.SALARY, this.getIncomeSourcesByType(exports.IncomeSourceTypeEnum.
|
|
10104
|
+
batch.push(this.create(AccountSetupItemsEnum.SALARY, this.getIncomeSourcesByType(exports.IncomeSourceTypeEnum.WORK)));
|
|
10082
10105
|
}
|
|
10083
10106
|
// Other income item is completed when user added at least one other income source
|
|
10084
10107
|
if (incomeTypes.dividends || incomeTypes.other) {
|
|
@@ -10104,7 +10127,7 @@
|
|
|
10104
10127
|
// }
|
|
10105
10128
|
// Allocation item is completed when user added at least one transaction allocation
|
|
10106
10129
|
batch.push(this.create(AccountSetupItemsEnum.TRANSACTION, this.transactionAllocationService.get()));
|
|
10107
|
-
return batch;
|
|
10130
|
+
return rxjs.combineLatest(batch).pipe(operators.map(function (items) { return new AccountSetupItemCollection(items); }));
|
|
10108
10131
|
};
|
|
10109
10132
|
/**
|
|
10110
10133
|
* @TODO work with collection when services refactored
|
|
@@ -10118,15 +10141,15 @@
|
|
|
10118
10141
|
* Show logbook item when user has at least 1 vehicle transaction
|
|
10119
10142
|
*/
|
|
10120
10143
|
AccountSetupService.prototype.getLogbookItem = function () {
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
if (
|
|
10127
|
-
return
|
|
10144
|
+
var _this = this;
|
|
10145
|
+
return this.transactionService.get()
|
|
10146
|
+
.pipe(
|
|
10147
|
+
// @TODO Alex: remove map when services start work with collections
|
|
10148
|
+
operators.map(function (transactions) { return new TransactionCollection(transactions); }), operators.mergeMap(function (transactions) {
|
|
10149
|
+
if (transactions.getVehicleTransactions().length) {
|
|
10150
|
+
return _this.create(AccountSetupItemsEnum.WORK_LOGBOOK, _this.vehicleClaimService.get());
|
|
10128
10151
|
}
|
|
10129
|
-
return null;
|
|
10152
|
+
return rxjs.of(null);
|
|
10130
10153
|
}));
|
|
10131
10154
|
};
|
|
10132
10155
|
return AccountSetupService;
|
|
@@ -10503,7 +10526,10 @@
|
|
|
10503
10526
|
* Notify backend to update connections
|
|
10504
10527
|
*/
|
|
10505
10528
|
BasiqService.prototype.updateConnections = function () {
|
|
10506
|
-
|
|
10529
|
+
var _this = this;
|
|
10530
|
+
return this.http.post(this.environment.apiV2 + "/basiq/connections", {}).pipe(operators.map(function (connections) {
|
|
10531
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_CONNECTION_UPDATED, !!connections));
|
|
10532
|
+
}));
|
|
10507
10533
|
};
|
|
10508
10534
|
/**
|
|
10509
10535
|
* access token to use basiq connect ui iframe
|
|
@@ -10555,7 +10581,7 @@
|
|
|
10555
10581
|
_this.confirmConsents().pipe(operators.take(1)).subscribe();
|
|
10556
10582
|
}
|
|
10557
10583
|
callback();
|
|
10558
|
-
});
|
|
10584
|
+
}, { once: true });
|
|
10559
10585
|
};
|
|
10560
10586
|
/**
|
|
10561
10587
|
* Get URL with filled params to run basiq UI iframe
|