taxtank-core 0.16.8 → 0.16.11
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 +66 -56
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/income-source.collection.js +4 -1
- package/esm2015/lib/db/Enums/income-source-type-list-other.enum.js +1 -1
- package/esm2015/lib/db/Enums/income-source-type-list-work.enum.js +2 -1
- package/esm2015/lib/db/Enums/income-source-type.enum.js +3 -4
- package/esm2015/lib/models/event/app-event-type.enum.js +38 -37
- package/esm2015/lib/models/income-source/income-source-type.js +4 -6
- package/esm2015/lib/models/income-source/income-source.js +4 -2
- package/esm2015/lib/models/toast/toast.js +2 -1
- package/esm2015/lib/services/account-setup/account-setup.service.js +11 -7
- package/esm2015/lib/services/http/bank/basiq/basiq.service.js +5 -3
- package/fesm2015/taxtank-core.js +64 -56
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/income-source.collection.d.ts +1 -0
- package/lib/db/Enums/income-source-type-list-work.enum.d.ts +1 -0
- package/lib/db/Enums/income-source-type.enum.d.ts +3 -4
- package/lib/models/event/app-event-type.enum.d.ts +37 -36
- package/lib/models/income-source/income-source-type.d.ts +1 -1
- package/lib/models/toast/toast.d.ts +1 -0
- package/lib/services/account-setup/account-setup.service.d.ts +3 -2
- package/lib/services/http/bank/basiq/basiq.service.d.ts +1 -1
- package/package.json +1 -1
- package/esm2015/lib/db/Enums/income-source-type-list-salary.enum.js +0 -5
- package/lib/db/Enums/income-source-type-list-salary.enum.d.ts +0 -3
|
@@ -2205,6 +2205,9 @@
|
|
|
2205
2205
|
IncomeSourceCollection.prototype.filterByTypes = function (types) {
|
|
2206
2206
|
return this.items.filter(function (incomeSource) { return types.includes(incomeSource.type); });
|
|
2207
2207
|
};
|
|
2208
|
+
IncomeSourceCollection.prototype.getSalary = function () {
|
|
2209
|
+
return this.items.filter(function (incomeSource) { return incomeSource.isSalaryIncome(); });
|
|
2210
|
+
};
|
|
2208
2211
|
Object.defineProperty(IncomeSourceCollection.prototype, "forecasts", {
|
|
2209
2212
|
/**
|
|
2210
2213
|
* Get income sources list of forecasts
|
|
@@ -4288,10 +4291,9 @@
|
|
|
4288
4291
|
|
|
4289
4292
|
exports.IncomeSourceTypeEnum = void 0;
|
|
4290
4293
|
(function (IncomeSourceTypeEnum) {
|
|
4291
|
-
IncomeSourceTypeEnum[IncomeSourceTypeEnum["
|
|
4292
|
-
IncomeSourceTypeEnum[IncomeSourceTypeEnum["
|
|
4294
|
+
IncomeSourceTypeEnum[IncomeSourceTypeEnum["WORK"] = 1] = "WORK";
|
|
4295
|
+
IncomeSourceTypeEnum[IncomeSourceTypeEnum["SOLE"] = 2] = "SOLE";
|
|
4293
4296
|
IncomeSourceTypeEnum[IncomeSourceTypeEnum["OTHER"] = 3] = "OTHER";
|
|
4294
|
-
IncomeSourceTypeEnum[IncomeSourceTypeEnum["SOLE"] = 4] = "SOLE";
|
|
4295
4297
|
})(exports.IncomeSourceTypeEnum || (exports.IncomeSourceTypeEnum = {}));
|
|
4296
4298
|
|
|
4297
4299
|
var SalaryForecast$1 = /** @class */ (function (_super) {
|
|
@@ -4371,13 +4373,9 @@
|
|
|
4371
4373
|
return IncomeSourceType;
|
|
4372
4374
|
}(AbstractModel));
|
|
4373
4375
|
|
|
4374
|
-
var IncomeSourceTypeListSalaryEnum;
|
|
4375
|
-
(function (IncomeSourceTypeListSalaryEnum) {
|
|
4376
|
-
IncomeSourceTypeListSalaryEnum[IncomeSourceTypeListSalaryEnum["BONUSES"] = 1] = "BONUSES";
|
|
4377
|
-
})(IncomeSourceTypeListSalaryEnum || (IncomeSourceTypeListSalaryEnum = {}));
|
|
4378
|
-
|
|
4379
4376
|
exports.IncomeSourceTypeListWorkEnum = void 0;
|
|
4380
4377
|
(function (IncomeSourceTypeListWorkEnum) {
|
|
4378
|
+
IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["BONUSES"] = 1] = "BONUSES";
|
|
4381
4379
|
IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["DIRECTOR_FEES"] = 2] = "DIRECTOR_FEES";
|
|
4382
4380
|
IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["DIVIDENDS"] = 3] = "DIVIDENDS";
|
|
4383
4381
|
IncomeSourceTypeListWorkEnum[IncomeSourceTypeListWorkEnum["INTEREST"] = 4] = "INTEREST";
|
|
@@ -4399,8 +4397,8 @@
|
|
|
4399
4397
|
function IncomeSourceType() {
|
|
4400
4398
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4401
4399
|
}
|
|
4402
|
-
IncomeSourceType.prototype.
|
|
4403
|
-
return
|
|
4400
|
+
IncomeSourceType.prototype.isBonuses = function () {
|
|
4401
|
+
return this.id === exports.IncomeSourceTypeListWorkEnum.BONUSES;
|
|
4404
4402
|
};
|
|
4405
4403
|
IncomeSourceType.prototype.isWork = function () {
|
|
4406
4404
|
return !!exports.IncomeSourceTypeListWorkEnum[this.id];
|
|
@@ -4409,13 +4407,12 @@
|
|
|
4409
4407
|
return !!exports.IncomeSourceTypeListOtherEnum[this.id];
|
|
4410
4408
|
};
|
|
4411
4409
|
IncomeSourceType.prototype.isSole = function () {
|
|
4410
|
+
// @TODO use IncomeSourceTypeListSoleEnum when sole tank ready
|
|
4412
4411
|
return !!exports.IncomeSourceTypeListOtherEnum[this.id];
|
|
4413
4412
|
};
|
|
4414
4413
|
Object.defineProperty(IncomeSourceType.prototype, "type", {
|
|
4415
4414
|
get: function () {
|
|
4416
4415
|
switch (true) {
|
|
4417
|
-
case this.isSalary():
|
|
4418
|
-
return exports.IncomeSourceTypeEnum.SALARY;
|
|
4419
4416
|
case this.isWork():
|
|
4420
4417
|
return exports.IncomeSourceTypeEnum.WORK;
|
|
4421
4418
|
case this.isSole():
|
|
@@ -4472,7 +4469,9 @@
|
|
|
4472
4469
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4473
4470
|
}
|
|
4474
4471
|
IncomeSource.prototype.isSalaryIncome = function () {
|
|
4475
|
-
return this.
|
|
4472
|
+
return !!this.salaryForecasts.length;
|
|
4473
|
+
// @TODO Vik: old code
|
|
4474
|
+
// return this.type === IncomeSourceTypeEnum.SALARY;
|
|
4476
4475
|
};
|
|
4477
4476
|
IncomeSource.prototype.isSoleIncome = function () {
|
|
4478
4477
|
return this.type === exports.IncomeSourceTypeEnum.SOLE;
|
|
@@ -7580,42 +7579,43 @@
|
|
|
7580
7579
|
AppEventTypeEnum[AppEventTypeEnum["BANK_ACCOUNT_UPDATED"] = 3] = "BANK_ACCOUNT_UPDATED";
|
|
7581
7580
|
AppEventTypeEnum[AppEventTypeEnum["BANK_TRANSACTION_ALLOCATED"] = 4] = "BANK_TRANSACTION_ALLOCATED";
|
|
7582
7581
|
AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONSENT_UPDATED"] = 5] = "BASIQ_CONSENT_UPDATED";
|
|
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["
|
|
7614
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7615
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7616
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7617
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7618
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
7582
|
+
AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONNECTION_UPDATED"] = 6] = "BASIQ_CONNECTION_UPDATED";
|
|
7583
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_INVITE_ACCEPTED"] = 7] = "CLIENT_INVITE_ACCEPTED";
|
|
7584
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_OPEN_CHAT"] = 8] = "CLIENT_OPEN_CHAT";
|
|
7585
|
+
AppEventTypeEnum[AppEventTypeEnum["CLIENT_TRANSFER_TO_OTHER_EMPLOYEE"] = 9] = "CLIENT_TRANSFER_TO_OTHER_EMPLOYEE";
|
|
7586
|
+
AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 10] = "DEPRECIATION_DELETED";
|
|
7587
|
+
AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 11] = "DEPRECIATIONS_CREATED";
|
|
7588
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 12] = "INCOME_SOURCES_CREATED";
|
|
7589
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 13] = "INCOME_SOURCES_UPDATED";
|
|
7590
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 14] = "INCOME_SOURCES_FORECASTS_CREATED";
|
|
7591
|
+
AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 15] = "INCOME_SOURCES_FORECASTS_UPDATED";
|
|
7592
|
+
AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 16] = "LOAN_UPDATED";
|
|
7593
|
+
AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 17] = "LOAN_PAYOUT_UPDATED";
|
|
7594
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 18] = "MESSAGE_CREATED";
|
|
7595
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 19] = "MESSAGE_FILE_CREATED";
|
|
7596
|
+
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 20] = "MESSAGE_FILE_DELETED";
|
|
7597
|
+
AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 21] = "NOTIFICATION_ADDED";
|
|
7598
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 22] = "PROPERTY_UPDATED_WITH_DOCUMENT";
|
|
7599
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 23] = "PROPERTY_DOCUMENT_ADDED";
|
|
7600
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 24] = "PROPERTY_MOVEMENT_CREATED";
|
|
7601
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 25] = "PROPERTY_MOVEMENT_UPDATED";
|
|
7602
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 26] = "PROPERTY_MOVEMENT_DELETED";
|
|
7603
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 27] = "PROPERTY_SHARE_UPDATED";
|
|
7604
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 28] = "PROPERTY_SUBSCRIPTION_ADDED";
|
|
7605
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 29] = "PROPERTY_SUBSCRIPTION_DELETED";
|
|
7606
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 30] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
|
|
7607
|
+
AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 31] = "SERVICE_SUBSCRIPTION_UPDATED";
|
|
7608
|
+
AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 32] = "TAX_REVIEW_UPDATED";
|
|
7609
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 33] = "TRANSACTION_CREATED";
|
|
7610
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 34] = "TRANSACTION_DELETED";
|
|
7611
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 35] = "TRANSACTION_UPDATED";
|
|
7612
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 36] = "TRANSACTIONS_CREATED";
|
|
7613
|
+
AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 37] = "USER_UPDATED";
|
|
7614
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 38] = "VEHICLE_CLAIM_UPDATED";
|
|
7615
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 39] = "VEHICLE_CLAIM_CREATED";
|
|
7616
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 40] = "VEHICLE_LOGBOOK_CREATED";
|
|
7617
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 41] = "VEHICLE_LOGBOOK_UPDATED";
|
|
7618
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 42] = "VEHICLE_LOGBOOK_DELETED";
|
|
7619
7619
|
})(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
|
|
7620
7620
|
|
|
7621
7621
|
/**
|
|
@@ -8680,6 +8680,7 @@
|
|
|
8680
8680
|
var Toast = /** @class */ (function () {
|
|
8681
8681
|
function Toast() {
|
|
8682
8682
|
this.duration = 3000;
|
|
8683
|
+
this.autoClose = true;
|
|
8683
8684
|
}
|
|
8684
8685
|
return Toast;
|
|
8685
8686
|
}());
|
|
@@ -10099,11 +10100,11 @@
|
|
|
10099
10100
|
var batch = [];
|
|
10100
10101
|
// Salary item is completed when user added salary income source
|
|
10101
10102
|
if (incomeTypes.salary) {
|
|
10102
|
-
batch.push(this.create(AccountSetupItemsEnum.SALARY, this.
|
|
10103
|
+
batch.push(this.create(AccountSetupItemsEnum.SALARY, this.getIncomeSources(true)));
|
|
10103
10104
|
}
|
|
10104
10105
|
// Other income item is completed when user added at least one other income source
|
|
10105
10106
|
if (incomeTypes.dividends || incomeTypes.other) {
|
|
10106
|
-
batch.push(this.create(AccountSetupItemsEnum.OTHER_INCOME, this.
|
|
10107
|
+
batch.push(this.create(AccountSetupItemsEnum.OTHER_INCOME, this.getIncomeSources()));
|
|
10107
10108
|
}
|
|
10108
10109
|
// Rental income item is completed when user added at least one property
|
|
10109
10110
|
if (incomeTypes.property) {
|
|
@@ -10128,11 +10129,17 @@
|
|
|
10128
10129
|
return rxjs.combineLatest(batch).pipe(operators.map(function (items) { return new AccountSetupItemCollection(items); }));
|
|
10129
10130
|
};
|
|
10130
10131
|
/**
|
|
10131
|
-
* @TODO work with collection when services refactored
|
|
10132
|
+
* @TODO Alex: work with collection when services refactored
|
|
10133
|
+
* @TODO Vik: waiting for income sources refactoring
|
|
10132
10134
|
*/
|
|
10133
|
-
AccountSetupService.prototype.
|
|
10135
|
+
AccountSetupService.prototype.getIncomeSources = function (isSalary) {
|
|
10136
|
+
if (isSalary === void 0) { isSalary = false; }
|
|
10134
10137
|
return this.incomeSourceService.get().pipe(operators.map(function (incomeSources) {
|
|
10135
|
-
|
|
10138
|
+
var collection = new IncomeSourceCollection(incomeSources);
|
|
10139
|
+
if (isSalary) {
|
|
10140
|
+
return collection.getSalary();
|
|
10141
|
+
}
|
|
10142
|
+
return collection.items.filter(function (incomeSource) { return !incomeSource.isSalaryIncome() && !incomeSource.isSoleIncome(); });
|
|
10136
10143
|
}));
|
|
10137
10144
|
};
|
|
10138
10145
|
/**
|
|
@@ -10524,7 +10531,10 @@
|
|
|
10524
10531
|
* Notify backend to update connections
|
|
10525
10532
|
*/
|
|
10526
10533
|
BasiqService.prototype.updateConnections = function () {
|
|
10527
|
-
|
|
10534
|
+
var _this = this;
|
|
10535
|
+
return this.http.post(this.environment.apiV2 + "/basiq/connections", {}).pipe(operators.map(function (connections) {
|
|
10536
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_CONNECTION_UPDATED, !!connections));
|
|
10537
|
+
}));
|
|
10528
10538
|
};
|
|
10529
10539
|
/**
|
|
10530
10540
|
* access token to use basiq connect ui iframe
|
|
@@ -10576,7 +10586,7 @@
|
|
|
10576
10586
|
_this.confirmConsents().pipe(operators.take(1)).subscribe();
|
|
10577
10587
|
}
|
|
10578
10588
|
callback();
|
|
10579
|
-
});
|
|
10589
|
+
}, { once: true });
|
|
10580
10590
|
};
|
|
10581
10591
|
/**
|
|
10582
10592
|
* Get URL with filled params to run basiq UI iframe
|