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
|
@@ -11308,7 +11308,7 @@ class BasiqTokenService extends RestService$1 {
|
|
|
11308
11308
|
* Access token to use basiq flow
|
|
11309
11309
|
*/
|
|
11310
11310
|
get() {
|
|
11311
|
-
if (this.
|
|
11311
|
+
if (this.getCacheFirst() && this.getCacheFirst().isExpired()) {
|
|
11312
11312
|
this.cache = undefined;
|
|
11313
11313
|
}
|
|
11314
11314
|
return super.get();
|
|
@@ -15628,11 +15628,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
|
|
|
15628
15628
|
}] });
|
|
15629
15629
|
|
|
15630
15630
|
class UserService extends RestService$1 {
|
|
15631
|
-
constructor(
|
|
15632
|
-
super(
|
|
15633
|
-
this.http = http;
|
|
15634
|
-
this.eventDispatcherService = eventDispatcherService;
|
|
15635
|
-
this.environment = environment;
|
|
15631
|
+
constructor() {
|
|
15632
|
+
super(...arguments);
|
|
15636
15633
|
this.modelClass = User;
|
|
15637
15634
|
this.collectionClass = Collection;
|
|
15638
15635
|
this.endpointUri = 'users';
|
|
@@ -15714,13 +15711,13 @@ class UserService extends RestService$1 {
|
|
|
15714
15711
|
}
|
|
15715
15712
|
updatePhoto(photo) {
|
|
15716
15713
|
return this.http.post(`${this.apiUrl}/photo?_method=PUT`, photo).pipe(map((photoUrl) => {
|
|
15717
|
-
this.setCache([Object.assign(this.
|
|
15714
|
+
this.setCache([Object.assign(this.getCacheFirst(), { photo: photoUrl })], true);
|
|
15718
15715
|
}));
|
|
15719
15716
|
}
|
|
15720
15717
|
createBasiq() {
|
|
15721
15718
|
return this.http.post(`${this.environment.apiV2}/basiq/user`, {})
|
|
15722
15719
|
.pipe(map((basiqId) => {
|
|
15723
|
-
this.setCache([Object.assign(this.
|
|
15720
|
+
this.setCache([Object.assign(this.getCacheFirst(), { basiqId })], true);
|
|
15724
15721
|
return basiqId;
|
|
15725
15722
|
}));
|
|
15726
15723
|
}
|
|
@@ -15742,19 +15739,14 @@ class UserService extends RestService$1 {
|
|
|
15742
15739
|
this.eventDispatcherService.on(AppEventTypeEnum.BASIQ_CONSENT_UPDATED).subscribe(() => this.refreshCache());
|
|
15743
15740
|
}
|
|
15744
15741
|
}
|
|
15745
|
-
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, deps:
|
|
15742
|
+
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
15746
15743
|
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, providedIn: 'root' });
|
|
15747
15744
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, decorators: [{
|
|
15748
15745
|
type: Injectable,
|
|
15749
15746
|
args: [{
|
|
15750
15747
|
providedIn: 'root'
|
|
15751
15748
|
}]
|
|
15752
|
-
}]
|
|
15753
|
-
return [{ type: i1.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
|
|
15754
|
-
type: Inject,
|
|
15755
|
-
args: ['environment']
|
|
15756
|
-
}] }];
|
|
15757
|
-
} });
|
|
15749
|
+
}] });
|
|
15758
15750
|
|
|
15759
15751
|
class FinancialYearService {
|
|
15760
15752
|
constructor(http, environment, mpService) {
|
|
@@ -19606,6 +19598,7 @@ const ENDPOINTS = {
|
|
|
19606
19598
|
BASIQ_ACCOUNTS_GET: new Endpoint('GET', '\\/basiq\\/accounts'),
|
|
19607
19599
|
BASIQ_TOKEN_GET: new Endpoint('GET', '\\/basiq\\/tokens'),
|
|
19608
19600
|
BASIQ_DELETE: new Endpoint('PUT', '\\/bank-connections/\\d+\\/remove-basiq'),
|
|
19601
|
+
BASIQ_USER_POST: new Endpoint('POST', '\\/basiq\\/user'),
|
|
19609
19602
|
BUDGETS_GET: new Endpoint('GET', '\\/budgets'),
|
|
19610
19603
|
BUDGETS_POST: new Endpoint('POST', '\\/budgets'),
|
|
19611
19604
|
BUDGETS_PUT: new Endpoint('PUT', '\\/budgets\\/\\d+'),
|
|
@@ -20564,29 +20557,6 @@ class AbstractForm extends UntypedFormGroup {
|
|
|
20564
20557
|
}
|
|
20565
20558
|
}
|
|
20566
20559
|
|
|
20567
|
-
/**
|
|
20568
|
-
* Validator for address, check if corelogic suggestion selected correctly
|
|
20569
|
-
*/
|
|
20570
|
-
function addressCorelogicValidator() {
|
|
20571
|
-
return (form) => {
|
|
20572
|
-
// we are interested in corelogic ids only for Australian addresses
|
|
20573
|
-
if (!form.isAustraliaSelected()) {
|
|
20574
|
-
return null;
|
|
20575
|
-
}
|
|
20576
|
-
// we need at least corelogic locality id to get growth percent
|
|
20577
|
-
const locIdControl = form.get('corelogicLocId');
|
|
20578
|
-
const refIdControl = form.get('corelogicRefId');
|
|
20579
|
-
if (locIdControl.enabled && locIdControl.hasError('required')) {
|
|
20580
|
-
return { address: 'City, state or postal code not specified' };
|
|
20581
|
-
}
|
|
20582
|
-
// @TODO Artem why?
|
|
20583
|
-
// if (refIdControl.enabled && refIdControl.hasError('required')) {
|
|
20584
|
-
// return { address: 'Street number not specified' };
|
|
20585
|
-
// }
|
|
20586
|
-
return null;
|
|
20587
|
-
};
|
|
20588
|
-
}
|
|
20589
|
-
|
|
20590
20560
|
/**
|
|
20591
20561
|
* Address form. Works with corelogic or manual address
|
|
20592
20562
|
*/
|
|
@@ -20600,20 +20570,19 @@ class AddressForm extends AbstractForm {
|
|
|
20600
20570
|
searchQuery: new UntypedFormControl((address === null || address === void 0 ? void 0 : address.address) ? address.nameLong : null, Validators.required),
|
|
20601
20571
|
type: new UntypedFormControl((address === null || address === void 0 ? void 0 : address.type) || AddressTypeEnum.STREET, Validators.required),
|
|
20602
20572
|
// corelogic fields (required for Australia and disabled for other countries)
|
|
20603
|
-
|
|
20573
|
+
// @TODO not required temporary, waiting for corelogic support response why it can't find some suburbs (like Hamilton Island)
|
|
20574
|
+
corelogicLocId: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.corelogicLocId, disabled: true }),
|
|
20604
20575
|
corelogicRefId: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.corelogicRefId, disabled: true }),
|
|
20605
|
-
// @TODO Artem why?
|
|
20606
|
-
// corelogicRefId: new UntypedFormControl({value: address?.corelogicRefId, disabled: true}, Validators.required),
|
|
20607
20576
|
// manual fields (using when address not found in corelogic)
|
|
20608
20577
|
unitNumber: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.unitNumber, disabled: true }),
|
|
20609
|
-
address: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.address, disabled: true }
|
|
20578
|
+
address: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.address, disabled: true }),
|
|
20610
20579
|
streetNumber: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.streetNumber, disabled: true }, [Validators.required, Validators.pattern(AddressForm.streetNumberPattern)]),
|
|
20611
20580
|
street: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.street, disabled: true }, Validators.required),
|
|
20612
20581
|
city: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.city, disabled: true }, Validators.required),
|
|
20613
20582
|
state: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.state, disabled: true }, Validators.required),
|
|
20614
20583
|
postcode: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.postcode, disabled: true }, Validators.required),
|
|
20615
20584
|
country: new UntypedFormControl({ value: (address === null || address === void 0 ? void 0 : address.country) || Country.australia, disabled: true }, Validators.required)
|
|
20616
|
-
}, address
|
|
20585
|
+
}, address);
|
|
20617
20586
|
/**
|
|
20618
20587
|
* Emit event to search address in corelogic when user filled enough data for corelogic
|
|
20619
20588
|
*/
|
|
@@ -20641,14 +20610,15 @@ class AddressForm extends AbstractForm {
|
|
|
20641
20610
|
* Handle corelogic suggestion select
|
|
20642
20611
|
*/
|
|
20643
20612
|
onSelectSuggestion(suggestion) {
|
|
20613
|
+
var _a, _b;
|
|
20644
20614
|
// if no suggestion then 'Add manually' option selected
|
|
20645
|
-
if (!suggestion) {
|
|
20615
|
+
if (!suggestion && !this.isManual) {
|
|
20646
20616
|
this.switchToManual();
|
|
20647
20617
|
return;
|
|
20648
20618
|
}
|
|
20649
20619
|
this.patchValue({
|
|
20650
|
-
corelogicLocId: suggestion.localityId,
|
|
20651
|
-
corelogicRefId: suggestion.propertyId
|
|
20620
|
+
corelogicLocId: (_a = suggestion === null || suggestion === void 0 ? void 0 : suggestion.localityId) !== null && _a !== void 0 ? _a : null,
|
|
20621
|
+
corelogicRefId: (_b = suggestion === null || suggestion === void 0 ? void 0 : suggestion.propertyId) !== null && _b !== void 0 ? _b : null
|
|
20652
20622
|
});
|
|
20653
20623
|
}
|
|
20654
20624
|
/**
|