taxtank-core 0.16.10 → 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 +23 -18
- 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/income-source/income-source-type.js +4 -6
- package/esm2015/lib/models/income-source/income-source.js +4 -2
- package/esm2015/lib/services/account-setup/account-setup.service.js +11 -7
- package/fesm2015/taxtank-core.js +22 -18
- 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/income-source/income-source-type.d.ts +1 -1
- package/lib/services/account-setup/account-setup.service.d.ts +3 -2
- 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;
|
|
@@ -10101,11 +10100,11 @@
|
|
|
10101
10100
|
var batch = [];
|
|
10102
10101
|
// Salary item is completed when user added salary income source
|
|
10103
10102
|
if (incomeTypes.salary) {
|
|
10104
|
-
batch.push(this.create(AccountSetupItemsEnum.SALARY, this.
|
|
10103
|
+
batch.push(this.create(AccountSetupItemsEnum.SALARY, this.getIncomeSources(true)));
|
|
10105
10104
|
}
|
|
10106
10105
|
// Other income item is completed when user added at least one other income source
|
|
10107
10106
|
if (incomeTypes.dividends || incomeTypes.other) {
|
|
10108
|
-
batch.push(this.create(AccountSetupItemsEnum.OTHER_INCOME, this.
|
|
10107
|
+
batch.push(this.create(AccountSetupItemsEnum.OTHER_INCOME, this.getIncomeSources()));
|
|
10109
10108
|
}
|
|
10110
10109
|
// Rental income item is completed when user added at least one property
|
|
10111
10110
|
if (incomeTypes.property) {
|
|
@@ -10130,11 +10129,17 @@
|
|
|
10130
10129
|
return rxjs.combineLatest(batch).pipe(operators.map(function (items) { return new AccountSetupItemCollection(items); }));
|
|
10131
10130
|
};
|
|
10132
10131
|
/**
|
|
10133
|
-
* @TODO work with collection when services refactored
|
|
10132
|
+
* @TODO Alex: work with collection when services refactored
|
|
10133
|
+
* @TODO Vik: waiting for income sources refactoring
|
|
10134
10134
|
*/
|
|
10135
|
-
AccountSetupService.prototype.
|
|
10135
|
+
AccountSetupService.prototype.getIncomeSources = function (isSalary) {
|
|
10136
|
+
if (isSalary === void 0) { isSalary = false; }
|
|
10136
10137
|
return this.incomeSourceService.get().pipe(operators.map(function (incomeSources) {
|
|
10137
|
-
|
|
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(); });
|
|
10138
10143
|
}));
|
|
10139
10144
|
};
|
|
10140
10145
|
/**
|