Added zip validation event.

This commit is contained in:
Jeremy-Z 2026-04-20 11:34:43 -04:00
parent fff491d0ad
commit 33c0526f1c
2 changed files with 22 additions and 2 deletions

View file

@ -361,6 +361,15 @@ export default {
this.pushEventToGA("policy_search", "policy_found", this.mainStore.isPolicyLookupSuccessful ? "Yes" : "No", true);
if ( this.mainStore.isPolicyLookupSuccessful) {
this.pushEventToGA("zip_validation", "success", "N/A", true);
}
else {
if ( this.mainStore.order.policy.policyLookupErrorCode === 2) {
this.pushEventToGA("zip_validation", "fail", "N/A", true);
}
}
await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true })
this.navigateForward();
},

View file

@ -110,7 +110,8 @@ export const getDefaultState = () => ({
endorsements: [],
endorsementQuestionAnswers: [],
status: null,
policyData: null
policyData: null,
policyLookupErrorCode: 0
},
customer: {
address: {
@ -595,10 +596,19 @@ export const useMainStore = defineStore({
// populate vehicles
order.policy.vehicles = responsePolicy.vehicles ?? [];
} else {
order.policy.policyLookupErrorCode = 0;
} else {
if ( response?.data?.isError) {
order.policy.policyLookupErrorCode = response.data.errorCode;
}
this.updateCoverageType(coverageType.NONE);
}
} catch (e) {
if ( response?.data?.isError) {
order.policy.policyLookupErrorCode = response.data.errorCode;
}
this.updateCoverageType(coverageType.NONE);
}
},
@ -2113,6 +2123,7 @@ export const useMainStore = defineStore({
this.order.policy.endorsements = [];
this.order.policy.endorsementQuestionAnswers = [];
this.order.policy.policyData = null;
this.order.policy.policyLookupErrorCode = 0;
this.order.policy.deductible.repair = null;
this.order.policy.deductible.replace = null;
},