taxtank-core 2.1.74 → 2.1.75
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.
|
@@ -6648,7 +6648,7 @@ class Property extends Property$1 {
|
|
|
6648
6648
|
return this.corelogicLastRequest ? new Date(this.corelogicLastRequest.getTime() + Property.corelogicCooldown) : new Date();
|
|
6649
6649
|
}
|
|
6650
6650
|
isCorelogicAvailable() {
|
|
6651
|
-
return this.corelogicLastRequest < new Date(Date.now() - Property.corelogicCooldown);
|
|
6651
|
+
return this.address.country.isAustralianCode() && (this.corelogicLastRequest < new Date(Date.now() - Property.corelogicCooldown));
|
|
6652
6652
|
}
|
|
6653
6653
|
getGrowth() {
|
|
6654
6654
|
return this.valuation.marketValue - this.purchasePrice;
|
|
@@ -24052,10 +24052,10 @@ class AddressForm extends AbstractForm {
|
|
|
24052
24052
|
address = address ?? plainToClass(Address, {});
|
|
24053
24053
|
super({
|
|
24054
24054
|
// prefill search input with address string for edit case
|
|
24055
|
-
searchQuery: new UntypedFormControl(address.nameLong
|
|
24055
|
+
searchQuery: new UntypedFormControl(address.nameLong),
|
|
24056
24056
|
type: new UntypedFormControl(address.type || AddressTypeEnum.STREET, Validators.required),
|
|
24057
24057
|
// google fields (required for non-australia and disabled for other countries)
|
|
24058
|
-
googlePlaceId: new UntypedFormControl(null,
|
|
24058
|
+
googlePlaceId: new UntypedFormControl(null, [RxwebValidators.required({ message: 'The address is incomplete or incorrect. Please check and try again.' })]),
|
|
24059
24059
|
// corelogic fields (required for Australia and disabled for other countries)
|
|
24060
24060
|
corelogicLocId: new UntypedFormControl(address.corelogicLocId, Validators.required),
|
|
24061
24061
|
corelogicRefId: new UntypedFormControl(address.corelogicRefId, [RxwebValidators.required({ message: 'The address is incomplete or incorrect. Please check and try again.' })]),
|
|
@@ -24079,7 +24079,7 @@ class AddressForm extends AbstractForm {
|
|
|
24079
24079
|
*/
|
|
24080
24080
|
get manualSearchQuery() {
|
|
24081
24081
|
// nothing to search when manual fields are invalid or when selected country is not Australia because we don't need to use corelogic for other countries
|
|
24082
|
-
if (!this.isManualSearchAvailable()
|
|
24082
|
+
if (!this.isManualSearchAvailable()) {
|
|
24083
24083
|
return '';
|
|
24084
24084
|
}
|
|
24085
24085
|
// for manual mode we search corelogic for city (location) and ignore street
|
|
@@ -24103,8 +24103,6 @@ class AddressForm extends AbstractForm {
|
|
|
24103
24103
|
corelogicLocId: suggestion?.localityId ?? null,
|
|
24104
24104
|
corelogicRefId: suggestion?.propertyId ?? null
|
|
24105
24105
|
});
|
|
24106
|
-
console.log(this.value);
|
|
24107
|
-
// console.log(this.getRawValue());
|
|
24108
24106
|
}
|
|
24109
24107
|
/**
|
|
24110
24108
|
* Check if Australia is selected in country field
|
|
@@ -24126,6 +24124,7 @@ class AddressForm extends AbstractForm {
|
|
|
24126
24124
|
this.get('state').enable();
|
|
24127
24125
|
this.get('postcode').enable();
|
|
24128
24126
|
this.get('corelogicRefId').clearValidators();
|
|
24127
|
+
this.get('googlePlaceId').clearValidators();
|
|
24129
24128
|
this.listenManualFieldsChanges();
|
|
24130
24129
|
this.listenStreetFieldsChanges();
|
|
24131
24130
|
}
|
|
@@ -24171,7 +24170,7 @@ class AddressForm extends AbstractForm {
|
|
|
24171
24170
|
// delay to avoid search request for each value change
|
|
24172
24171
|
debounceTime(AddressForm.searchDelay),
|
|
24173
24172
|
// do nothing when not all required fields filled
|
|
24174
|
-
filter(() => this.isManualSearchAvailable()
|
|
24173
|
+
filter(() => this.isManualSearchAvailable()), map(() => this.manualSearchQuery),
|
|
24175
24174
|
// skip when value not changed
|
|
24176
24175
|
distinctUntilChanged())
|
|
24177
24176
|
.subscribe(() => {
|
|
@@ -26282,7 +26281,7 @@ class PropertyValuationForm extends AbstractForm {
|
|
|
26282
26281
|
super({
|
|
26283
26282
|
// corelogic available only for new valuations if request cooldown has passed
|
|
26284
26283
|
isCorelogic: new FormControl(property?.isCorelogicAvailable() && !valuation.id),
|
|
26285
|
-
growthPercent: new FormControl(
|
|
26284
|
+
growthPercent: new FormControl(property?.growthPercent),
|
|
26286
26285
|
marketValue: new FormControl(valuation.marketValue ?? property?.marketValue, Validators.required),
|
|
26287
26286
|
date: new FormControl(valuation.date, Validators.required),
|
|
26288
26287
|
document: new FormGroup({
|