Remove zip code matching condition causing zip code state validation
This commit is contained in:
hiteshkumar87 2025-01-27 17:30:40 +05:30
parent 2a7f15df12
commit 2a97b02b04

View file

@ -241,57 +241,46 @@ export default {
this.displayMismatchStateAndZipAlert = false; this.displayMismatchStateAndZipAlert = false;
}, },
async setMobileLocation() { async setMobileLocation() {
if ( this.resetAlerts();
this.internalModel.addressQuestions.zipCode !== // Validate the Zip Code
this.modelValue.addressQuestions.zipCode const zipCodeData = await this.getZipCodeData(
) { this.internalModel.addressQuestions.zipCode,
this.resetAlerts(); "service-location"
// Validate the Zip Code );
const zipCodeData = await this.getZipCodeData(
this.internalModel.addressQuestions.zipCode, if (!zipCodeData.isValid) {
this.displayInvalidZipAlert = true;
this.resetModalButtonStyle();
} else if (zipCodeData.state != this.internalModel.addressQuestions.state) {
this.displayMismatchStateAndZipAlert = true;
this.resetModalButtonStyle();
} else {
// retrieve mobile fee part
const serviceZipCode = this.internalModel.addressQuestions.zipCode;
const mobileFeePart = await getPricedMobileFeePart(
serviceZipCode,
"service-location" "service-location"
); );
if (!zipCodeData.isValid) { // retrieve serviceability details
this.displayInvalidZipAlert = true; const serviceabilityDetails = await getServiceabilityDetails(
this.resetModalButtonStyle(); serviceZipCode,
} else if (zipCodeData.state != this.internalModel.addressQuestions.state) { null,
this.displayMismatchStateAndZipAlert = true; "service-location"
this.resetModalButtonStyle(); );
} else {
// retrieve mobile fee part
const serviceZipCode = this.internalModel.addressQuestions.zipCode;
const mobileFeePart = await getPricedMobileFeePart(
serviceZipCode,
"service-location"
);
// retrieve serviceability details const billToAccountNumber = await getBillToAccountNumber(
const serviceabilityDetails = await getServiceabilityDetails( this.internalModel.zipCodeCtu
serviceZipCode, );
null,
"service-location"
);
const billToAccountNumber = await getBillToAccountNumber( // update content related to service zip code
this.internalModel.zipCodeCtu this.$emit("updated-mobile-fee-part", mobileFeePart);
); this.$emit("updated-serviceability", serviceabilityDetails.data);
this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase);
this.$emit("updated-mobile-ctu", zipCodeData.zipCodeCtu);
this.$emit("updated-bill-to-account-number", billToAccountNumber);
// update content related to service zip code // update the page level model
this.$emit("updated-mobile-fee-part", mobileFeePart);
this.$emit("updated-serviceability", serviceabilityDetails.data);
this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase);
this.$emit("updated-mobile-ctu", zipCodeData.zipCodeCtu);
this.$emit("updated-bill-to-account-number", billToAccountNumber);
// update the page level model
this.$emit("update:modelValue", this.internalModel);
//Page advance to Schedule page
this.$emit("mobileLocationSelected");
}
} else {
// Update the page level model
this.$emit("update:modelValue", this.internalModel); this.$emit("update:modelValue", this.internalModel);
//Page advance to Schedule page //Page advance to Schedule page