taxtank-core 0.30.123 → 0.30.124
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/esm2020/lib/collections/tax-summary/tax-return-categories.const.mjs +2 -2
- package/esm2020/lib/models/tax-summary/tax-summary.mjs +13 -3
- package/esm2020/lib/services/http/bank/basiq/basiq.service.mjs +2 -13
- package/fesm2015/taxtank-core.mjs +10 -11
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +10 -11
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/lib/collections/tax-summary/tax-return-categories.const.d.ts +1 -1
- package/lib/models/tax-summary/tax-summary.d.ts +3 -0
- package/lib/services/http/bank/basiq/basiq.service.d.ts +0 -4
- package/package.json +1 -1
|
@@ -10383,9 +10383,6 @@ class BasiqService extends RestService$1 {
|
|
|
10383
10383
|
* Get Basiq job result
|
|
10384
10384
|
*/
|
|
10385
10385
|
retrieveJob(jobId) {
|
|
10386
|
-
// if we get a jobId then we know that user accepted basiq consent
|
|
10387
|
-
// @TODO Nikita (TT-3308): if user close the tab before redirect then consent exist in basiq but not in database
|
|
10388
|
-
this.updateBasiqConsentAgreement();
|
|
10389
10386
|
return this.http.get(`${BasiqService.basiqApiUrl}/jobs/${jobId}`)
|
|
10390
10387
|
.pipe(map((response) => plainToClass(BasiqJobResponse, response)));
|
|
10391
10388
|
}
|
|
@@ -10422,14 +10419,6 @@ class BasiqService extends RestService$1 {
|
|
|
10422
10419
|
return response.getRetrieveAccountsStep().isSuccess();
|
|
10423
10420
|
}));
|
|
10424
10421
|
}
|
|
10425
|
-
/**
|
|
10426
|
-
* Ask backend to update user's basiq consent flag
|
|
10427
|
-
*/
|
|
10428
|
-
updateBasiqConsentAgreement() {
|
|
10429
|
-
this.http.put(`${this.environment.apiV2}/basiq/consents`, {}).subscribe((result) => {
|
|
10430
|
-
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.BASIQ_CONSENT_UPDATED, result));
|
|
10431
|
-
});
|
|
10432
|
-
}
|
|
10433
10422
|
/**
|
|
10434
10423
|
* listen to notifications to update basiq accounts list
|
|
10435
10424
|
*/
|
|
@@ -12208,6 +12197,9 @@ class TaxSummary {
|
|
|
12208
12197
|
get sections() {
|
|
12209
12198
|
return [this.work, this.property, this.other, this.sole, this.summary];
|
|
12210
12199
|
}
|
|
12200
|
+
getReportItems(sections) {
|
|
12201
|
+
return new ReportItemCollection([].concat(...this.sections.map((section) => section.items.toArray())));
|
|
12202
|
+
}
|
|
12211
12203
|
get taxPercent() {
|
|
12212
12204
|
// Check if netAmount is not 0 to avoid division by zero
|
|
12213
12205
|
if (!this.summary.netAmount) {
|
|
@@ -12223,6 +12215,13 @@ class TaxSummary {
|
|
|
12223
12215
|
const taxWithheld = this.summary.items.sumByCategoriesAndSection(TAX_RETURN_CATEGORIES.work.taxWithheld, TaxSummarySectionEnum.WORK_TANK);
|
|
12224
12216
|
return this.workNetTotal - Math.abs(taxWithheld);
|
|
12225
12217
|
}
|
|
12218
|
+
get income() {
|
|
12219
|
+
return this.getReportItems([this.work, this.property, this.other]).sumByCategories([
|
|
12220
|
+
...TAX_RETURN_CATEGORIES.work.income,
|
|
12221
|
+
...TAX_RETURN_CATEGORIES.property.income,
|
|
12222
|
+
...TAX_RETURN_CATEGORIES.other.income,
|
|
12223
|
+
]);
|
|
12224
|
+
}
|
|
12226
12225
|
/**
|
|
12227
12226
|
* Work Net Total = Income - expenses - interest
|
|
12228
12227
|
* https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/217677990/Dashboard+Main
|