taxtank-core 0.31.47 → 0.31.49
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/forms/address/address.form.mjs +8 -10
- package/esm2020/lib/forms/sole/sole-contact.form.mjs +2 -2
- package/esm2020/lib/interceptors/preloader.interceptor.mjs +2 -2
- package/esm2020/lib/models/endpoint/endpoints.const.mjs +2 -1
- package/esm2020/lib/services/http/bank/basiq/basiq-token.service.mjs +2 -2
- package/esm2020/lib/services/http/user/user.service.mjs +8 -16
- package/esm2020/lib/validators/address-corelogic.validator.mjs +2 -6
- package/fesm2015/taxtank-core.mjs +16 -46
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +15 -44
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/lib/interceptors/preloader.interceptor.d.ts +1 -1
- package/lib/services/http/user/user.service.d.ts +0 -6
- package/lib/validators/address-corelogic.validator.d.ts +1 -0
- package/package.json +1 -1
|
@@ -11238,7 +11238,7 @@ class BasiqTokenService extends RestService$1 {
|
|
|
11238
11238
|
* Access token to use basiq flow
|
|
11239
11239
|
*/
|
|
11240
11240
|
get() {
|
|
11241
|
-
if (this.
|
|
11241
|
+
if (this.getCacheFirst() && this.getCacheFirst().isExpired()) {
|
|
11242
11242
|
this.cache = undefined;
|
|
11243
11243
|
}
|
|
11244
11244
|
return super.get();
|
|
@@ -15508,11 +15508,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
|
|
|
15508
15508
|
}] });
|
|
15509
15509
|
|
|
15510
15510
|
class UserService extends RestService$1 {
|
|
15511
|
-
constructor(
|
|
15512
|
-
super(
|
|
15513
|
-
this.http = http;
|
|
15514
|
-
this.eventDispatcherService = eventDispatcherService;
|
|
15515
|
-
this.environment = environment;
|
|
15511
|
+
constructor() {
|
|
15512
|
+
super(...arguments);
|
|
15516
15513
|
this.modelClass = User;
|
|
15517
15514
|
this.collectionClass = Collection;
|
|
15518
15515
|
this.endpointUri = 'users';
|
|
@@ -15594,13 +15591,13 @@ class UserService extends RestService$1 {
|
|
|
15594
15591
|
}
|
|
15595
15592
|
updatePhoto(photo) {
|
|
15596
15593
|
return this.http.post(`${this.apiUrl}/photo?_method=PUT`, photo).pipe(map((photoUrl) => {
|
|
15597
|
-
this.setCache([Object.assign(this.
|
|
15594
|
+
this.setCache([Object.assign(this.getCacheFirst(), { photo: photoUrl })], true);
|
|
15598
15595
|
}));
|
|
15599
15596
|
}
|
|
15600
15597
|
createBasiq() {
|
|
15601
15598
|
return this.http.post(`${this.environment.apiV2}/basiq/user`, {})
|
|
15602
15599
|
.pipe(map((basiqId) => {
|
|
15603
|
-
this.setCache([Object.assign(this.
|
|
15600
|
+
this.setCache([Object.assign(this.getCacheFirst(), { basiqId })], true);
|
|
15604
15601
|
return basiqId;
|
|
15605
15602
|
}));
|
|
15606
15603
|
}
|
|
@@ -15622,17 +15619,14 @@ class UserService extends RestService$1 {
|
|
|
15622
15619
|
this.eventDispatcherService.on(AppEventTypeEnum.BASIQ_CONSENT_UPDATED).subscribe(() => this.refreshCache());
|
|
15623
15620
|
}
|
|
15624
15621
|
}
|
|
15625
|
-
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, deps:
|
|
15622
|
+
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
15626
15623
|
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, providedIn: 'root' });
|
|
15627
15624
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, decorators: [{
|
|
15628
15625
|
type: Injectable,
|
|
15629
15626
|
args: [{
|
|
15630
15627
|
providedIn: 'root'
|
|
15631
15628
|
}]
|
|
15632
|
-
}]
|
|
15633
|
-
type: Inject,
|
|
15634
|
-
args: ['environment']
|
|
15635
|
-
}] }]; } });
|
|
15629
|
+
}] });
|
|
15636
15630
|
|
|
15637
15631
|
class FinancialYearService {
|
|
15638
15632
|
constructor(http, environment, mpService) {
|
|
@@ -19476,6 +19470,7 @@ const ENDPOINTS = {
|
|
|
19476
19470
|
BASIQ_ACCOUNTS_GET: new Endpoint('GET', '\\/basiq\\/accounts'),
|
|
19477
19471
|
BASIQ_TOKEN_GET: new Endpoint('GET', '\\/basiq\\/tokens'),
|
|
19478
19472
|
BASIQ_DELETE: new Endpoint('PUT', '\\/bank-connections/\\d+\\/remove-basiq'),
|
|
19473
|
+
BASIQ_USER_POST: new Endpoint('POST', '\\/basiq\\/user'),
|
|
19479
19474
|
BUDGETS_GET: new Endpoint('GET', '\\/budgets'),
|
|
19480
19475
|
BUDGETS_POST: new Endpoint('POST', '\\/budgets'),
|
|
19481
19476
|
BUDGETS_PUT: new Endpoint('PUT', '\\/budgets\\/\\d+'),
|
|
@@ -20438,29 +20433,6 @@ class AbstractForm extends UntypedFormGroup {
|
|
|
20438
20433
|
}
|
|
20439
20434
|
}
|
|
20440
20435
|
|
|
20441
|
-
/**
|
|
20442
|
-
* Validator for address, check if corelogic suggestion selected correctly
|
|
20443
|
-
*/
|
|
20444
|
-
function addressCorelogicValidator() {
|
|
20445
|
-
return (form) => {
|
|
20446
|
-
// we are interested in corelogic ids only for Australian addresses
|
|
20447
|
-
if (!form.isAustraliaSelected()) {
|
|
20448
|
-
return null;
|
|
20449
|
-
}
|
|
20450
|
-
// we need at least corelogic locality id to get growth percent
|
|
20451
|
-
const locIdControl = form.get('corelogicLocId');
|
|
20452
|
-
const refIdControl = form.get('corelogicRefId');
|
|
20453
|
-
if (locIdControl.enabled && locIdControl.hasError('required')) {
|
|
20454
|
-
return { address: 'City, state or postal code not specified' };
|
|
20455
|
-
}
|
|
20456
|
-
// @TODO Artem why?
|
|
20457
|
-
// if (refIdControl.enabled && refIdControl.hasError('required')) {
|
|
20458
|
-
// return { address: 'Street number not specified' };
|
|
20459
|
-
// }
|
|
20460
|
-
return null;
|
|
20461
|
-
};
|
|
20462
|
-
}
|
|
20463
|
-
|
|
20464
20436
|
/**
|
|
20465
20437
|
* Address form. Works with corelogic or manual address
|
|
20466
20438
|
*/
|
|
@@ -20474,20 +20446,19 @@ class AddressForm extends AbstractForm {
|
|
|
20474
20446
|
searchQuery: new UntypedFormControl(address?.address ? address.nameLong : null, Validators.required),
|
|
20475
20447
|
type: new UntypedFormControl(address?.type || AddressTypeEnum.STREET, Validators.required),
|
|
20476
20448
|
// corelogic fields (required for Australia and disabled for other countries)
|
|
20477
|
-
|
|
20449
|
+
// @TODO not required temporary, waiting for corelogic support response why it can't find some suburbs (like Hamilton Island)
|
|
20450
|
+
corelogicLocId: new UntypedFormControl({ value: address?.corelogicLocId, disabled: true }),
|
|
20478
20451
|
corelogicRefId: new UntypedFormControl({ value: address?.corelogicRefId, disabled: true }),
|
|
20479
|
-
// @TODO Artem why?
|
|
20480
|
-
// corelogicRefId: new UntypedFormControl({value: address?.corelogicRefId, disabled: true}, Validators.required),
|
|
20481
20452
|
// manual fields (using when address not found in corelogic)
|
|
20482
20453
|
unitNumber: new UntypedFormControl({ value: address?.unitNumber, disabled: true }),
|
|
20483
|
-
address: new UntypedFormControl({ value: address?.address, disabled: true }
|
|
20454
|
+
address: new UntypedFormControl({ value: address?.address, disabled: true }),
|
|
20484
20455
|
streetNumber: new UntypedFormControl({ value: address?.streetNumber, disabled: true }, [Validators.required, Validators.pattern(AddressForm.streetNumberPattern)]),
|
|
20485
20456
|
street: new UntypedFormControl({ value: address?.street, disabled: true }, Validators.required),
|
|
20486
20457
|
city: new UntypedFormControl({ value: address?.city, disabled: true }, Validators.required),
|
|
20487
20458
|
state: new UntypedFormControl({ value: address?.state, disabled: true }, Validators.required),
|
|
20488
20459
|
postcode: new UntypedFormControl({ value: address?.postcode, disabled: true }, Validators.required),
|
|
20489
20460
|
country: new UntypedFormControl({ value: address?.country || Country.australia, disabled: true }, Validators.required)
|
|
20490
|
-
}, address
|
|
20461
|
+
}, address);
|
|
20491
20462
|
/**
|
|
20492
20463
|
* Emit event to search address in corelogic when user filled enough data for corelogic
|
|
20493
20464
|
*/
|
|
@@ -20516,13 +20487,13 @@ class AddressForm extends AbstractForm {
|
|
|
20516
20487
|
*/
|
|
20517
20488
|
onSelectSuggestion(suggestion) {
|
|
20518
20489
|
// if no suggestion then 'Add manually' option selected
|
|
20519
|
-
if (!suggestion) {
|
|
20490
|
+
if (!suggestion && !this.isManual) {
|
|
20520
20491
|
this.switchToManual();
|
|
20521
20492
|
return;
|
|
20522
20493
|
}
|
|
20523
20494
|
this.patchValue({
|
|
20524
|
-
corelogicLocId: suggestion
|
|
20525
|
-
corelogicRefId: suggestion
|
|
20495
|
+
corelogicLocId: suggestion?.localityId ?? null,
|
|
20496
|
+
corelogicRefId: suggestion?.propertyId ?? null
|
|
20526
20497
|
});
|
|
20527
20498
|
}
|
|
20528
20499
|
/**
|