Merge branch 'develop' into feature/SSR-669-B
This commit is contained in:
commit
1b161ee5c6
2 changed files with 15 additions and 4 deletions
|
|
@ -174,11 +174,13 @@ export default {
|
|||
async forwardButtonAction() {
|
||||
if (this.selectedVehicleVin !== vehicleSelectionOptions.VEHICLE_NOT_LISTED) {
|
||||
const vehicleLookupResponse = await this.lookupVehicleByVin(this.selectedVehicleVin);
|
||||
const vehicle = this.policyVehicles.find((pv) => pv.vin === this.selectedVehicleVin);
|
||||
|
||||
if (vehicleLookupResponse.error) {
|
||||
if (vehicleLookupResponse.status === 404) {
|
||||
const vehicle = this.policyVehicles.find((pv) => pv.vin === this.selectedVehicleVin);
|
||||
this.mainStore.resetVehicleState();
|
||||
useMainStore().updateVehicle({
|
||||
policyVehicleId: vehicle.id,
|
||||
carId: '0',
|
||||
category: '',
|
||||
year: vehicle.vehicleYear || '',
|
||||
|
|
@ -200,6 +202,7 @@ export default {
|
|||
}
|
||||
|
||||
this.vehicleFromLookup = Object.assign(vehicleLookupResponse.data, {
|
||||
policyVehicleId: vehicle.id,
|
||||
vin: this.selectedVehicleVin,
|
||||
noCoverage: this.noCoverageForSelectedVehicle,
|
||||
deductible: this.deductibleForSelectedVehicle,
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ function getTimeSlotsAdditionalEventData(
|
|||
const getDefaultState = () => ({
|
||||
order: {
|
||||
vehicle: {
|
||||
policyVehicleId: null,
|
||||
year: null,
|
||||
make: null,
|
||||
model: null,
|
||||
|
|
@ -76,11 +77,12 @@ const getDefaultState = () => ({
|
|||
repair: null, // numerical value; how much customer owes on deductible in repair case
|
||||
replace: null // numerical value; how much customer owes on deductible in replace case,
|
||||
},
|
||||
isITAC: null,
|
||||
isITAC: false,
|
||||
vehicles: [],
|
||||
endorsements: [],
|
||||
endorsementQuestionAnswers: [],
|
||||
status: null
|
||||
status: null,
|
||||
policyData: null
|
||||
},
|
||||
customer: {
|
||||
address: {
|
||||
|
|
@ -421,6 +423,7 @@ export const useMainStore = defineStore({
|
|||
|
||||
// populate additional fields
|
||||
order.serviceLocation.zipCode = insured?.zipCode;
|
||||
order.policy.policyData = responsePolicy.policyData;
|
||||
|
||||
// populate vehicles
|
||||
order.policy.vehicles = responsePolicy.vehicles ?? [];
|
||||
|
|
@ -443,6 +446,8 @@ export const useMainStore = defineStore({
|
|||
{
|
||||
referralCorrelationId: this.order.referralCorrelationId,
|
||||
accountNumber: this.issConfig.parentAccountNumber?.toString() ?? '',
|
||||
policyData: this.order.policy.policyData,
|
||||
isItac: this.order.policy.isITAC,
|
||||
insured: {
|
||||
firstName: this.order.customer.firstName,
|
||||
lastName: this.order.customer.lastName,
|
||||
|
|
@ -479,6 +484,7 @@ export const useMainStore = defineStore({
|
|||
country: 'US' // TODO set from store
|
||||
},
|
||||
vehicle: {
|
||||
id: this.order.vehicle.id?.toString() ?? '',
|
||||
year: this.order.vehicle.year?.toString() ?? '',
|
||||
make: this.order.vehicle.make,
|
||||
model: this.order.vehicle.model,
|
||||
|
|
@ -1373,6 +1379,7 @@ export const useMainStore = defineStore({
|
|||
updateVehicle(vehicle) {
|
||||
// Assuming that the method caller pass all the properties.
|
||||
// otherwise need to check for undefined for every property.
|
||||
this.vehicle.policyVehicleId = vehicle.policyVehicleId;
|
||||
this.vehicle.carId = vehicle.carId;
|
||||
this.order.vehicle.category = vehicle.category;
|
||||
this.order.vehicle.year = vehicle.year;
|
||||
|
|
@ -1406,6 +1413,7 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
|
||||
resetVehicleState() {
|
||||
this.order.vehicle.policyVehicleId = null;
|
||||
this.order.vehicle.year = null;
|
||||
this.order.vehicle.make = null;
|
||||
this.order.vehicle.model = null;
|
||||
|
|
@ -2037,7 +2045,7 @@ export const useMainStore = defineStore({
|
|||
this.order.policy.damageCause = null;
|
||||
this.order.policy.damageCity = null;
|
||||
this.order.policy.damageState = null;
|
||||
this.order.policy.isITAC = null;
|
||||
this.order.policy.isITAC = false;
|
||||
this.order.customer.phoneNumber = null;
|
||||
this.order.customer.emailAddress = null;
|
||||
this.order.customer.firstName = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue