CSR-416 Add vin-lookup integration

This commit is contained in:
Katie 2022-05-09 13:45:56 -04:00
parent 54791dd81d
commit 674386c7b4
5 changed files with 29 additions and 11 deletions

View file

@ -302,8 +302,8 @@ export default {
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.customerQuestions.addressQuestions.zipCode);
store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, this.customerQuestions.firstName);
store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, this.customerQuestions.lastName);
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip);
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.customerQuestions.email);
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip);
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.customerQuestions.emailAddress);
},
},

View file

@ -300,6 +300,8 @@ export default {
if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) {
store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
}
console.log("A")
console.log(this.licensePlate)
store.commit(storeMutations.UPDATE_VEHICLE_VIN, vin);
store.commit(storeMutations.UPDATE_YEAR, vehicleInfo.year);
store.commit(storeMutations.UPDATE_MAKE, vehicleInfo.make);

View file

@ -250,7 +250,13 @@ export default {
return store.getters.vehicle.vin
},
getZipFromStore(){
return store.getters.vehicle.registration.zipCode
var serviceZip = store.getters.order.serviceLocation.zipCode;
if (!serviceZip) {
serviceZip = store.getters.vehicle.registration.zipCode;
}
return serviceZip;
},
attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, () => {
@ -263,7 +269,12 @@ export default {
});
},
backButtonAction() {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
if (store.getters.vehicle.vin) {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK_WITH_VIN, this.$route);
}
else {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
}
},
async forwardButtonAction() {
const zipValidation = await this.validateZip(this.zip);

View file

@ -166,6 +166,7 @@ async function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery
const currentComponent = currentRoute.matched[0].components;
if (invalidateOnSave) {
console.log("A")
resetDependentState(currentComponent);
}

View file

@ -133,6 +133,7 @@ export const mutations = {
state.order.payment.insuranceCoverage.isVerified = isVerified;
},
updateRegistrationLicensePlate(state, licensePlate){
console.log(licensePlate)
state.order.vehicle.registration.licensePlate = licensePlate;
},
updateRegistrationState(state, registrationState){
@ -148,13 +149,13 @@ export const mutations = {
state.order.serviceLocation.zipCode = serviceLocationZipCode;
},
updateRegistrationCity(state, serviceCity){
state.order.serviceLocation.city = serviceCity;
state.order.vehicle.registration.city = serviceCity;
},
updateRegistrationFirstName(state, firstName){
state.order.serviceLocation.firstName = firstName;
state.order.vehicle.registration.firstName = firstName;
},
updateRegistrationLastName(state, lastName){
state.order.serviceLocation.lastName = lastName;
state.order.vehicle.registration.lastName = lastName;
},
updateCustomerEmailAddress(state, customerEmailAddress){
state.order.customer.emailAddress = customerEmailAddress;
@ -235,7 +236,7 @@ export const mutations = {
city: orderInformation.vehicle.registration.city,
state: orderInformation.vehicle.registration.state,
zipCode: orderInformation.vehicle.registration.zipCode, // TODO CSR-416 make sure customer vs service is different
licensePlate: null,
licensePlate: orderInformation.vehicle.registration.licensePlate,
}
});
@ -245,7 +246,7 @@ export const mutations = {
state.order.lineItems.glassParts = orderInformation.parts;
state.order.accountNumber = orderInformation.accountNumber;
state.order.serviceLocation.zip = orderInformation.zipCode; // TODO CSR-416 make sure customer vs service is different, add this to service
state.order.serviceLocation.zipCode = orderInformation.serviceLocation.zipCode; // TODO CSR-416 make sure customer vs service is different, add this to service
state.order.payment.isInsurance = orderInformation.IsInsuranceOrder;
state.order.payment.insuranceCoverage.isVerified = orderInformation?.insuranceInfo.coverageVerified;
@ -533,8 +534,11 @@ export const actions = {
registration: {
firstName: vehicle.registration.firstName,
lastName: vehicle.registration.lastName,
licensePlate: vehicle.registration.licensePlate,
zipCode: vehicle.registration.zipCode
streetAddress: vehicle.registration.address,
city: vehicle.registration.city,
state: vehicle.registration.state,
zipCode: vehicle.registration.zipCode,
licensePlateNumber: vehicle.registration.licensePlate,
},
},
damage: {