Merge pull request #657 from Safelite/feature/richardson/SSR-1176.2
Use provider ctu if inshop or dropoff
This commit is contained in:
commit
e554a2596b
1 changed files with 52 additions and 46 deletions
|
|
@ -374,52 +374,58 @@ export const useMainStore = defineStore({
|
||||||
duration: readableDuration
|
duration: readableDuration
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
experimentOrder: (state) => ({
|
experimentOrder: (s) => {
|
||||||
funnelVehicleYear: state.order.vehicle.year,
|
const ctuToUse = (s.order.serviceLocation.appointmentType === AppointmentTypeStrings.IN_SHOP
|
||||||
funnelVehicleMake: state.order.vehicle.make,
|
|| s.order.serviceLocation.appointmentType === AppointmentTypeStrings.DROP_OFF)
|
||||||
funnelVehicleModel: state.order.vehicle.model,
|
? s.order.serviceLocation.zipCodeCtu : s.order.serviceLocation.provider?.address?.zipCodeCtu;
|
||||||
funnelVehicleStyle: state.order.vehicle.style,
|
|
||||||
funnelIsRepair: state.order.damage.isRepair,
|
return {
|
||||||
funnelNumberOfChips: state.order.damage.numberOfChips,
|
funnelVehicleYear: s.order.vehicle.year,
|
||||||
funnelCarId: state.order.vehicle.carId,
|
funnelVehicleMake: s.order.vehicle.make,
|
||||||
funnelServiceCity: state.order.serviceLocation.city,
|
funnelVehicleModel: s.order.vehicle.model,
|
||||||
funnelServiceState: state.order.serviceLocation.state,
|
funnelVehicleStyle: s.order.vehicle.style,
|
||||||
funnelServiceZipCode: state.order.serviceLocation.zipCode,
|
funnelIsRepair: s.order.damage.isRepair,
|
||||||
funnelServiceZipCodeCtu: state.order.serviceLocation.zipCodeCtu,
|
funnelNumberOfChips: s.order.damage.numberOfChips,
|
||||||
funnelParentAccountNumber: state.order.accountNumber,
|
funnelCarId: s.order.vehicle.carId,
|
||||||
funnelProviderNumber: state.order.serviceLocation.provider.providerNumber,
|
funnelServiceCity: s.order.serviceLocation.city,
|
||||||
funnelIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified,
|
funnelServices: s.order.serviceLocation.state,
|
||||||
funnelHasRecalibrationPart: getHasRecalibrationPart(state),
|
funnelServiceZipCode: s.order.serviceLocation.zipCode,
|
||||||
funnelSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
|
funnelServiceZipCodeCtu: ctuToUse,
|
||||||
funnelSelectedWindshieldGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
|
funnelParentAccountNumber: s.order.accountNumber,
|
||||||
|
funnelProviderNumber: s.order.serviceLocation.provider.providerNumber,
|
||||||
|
funnelIsCoverageVerified: s.order.payment.insuranceCoverage.isVerified,
|
||||||
|
funnelHasRecalibrationPart: getHasRecalibrationPart(s),
|
||||||
|
funnelSelectedMultiGlass: s.order.damage.glassToReplace?.length > 1,
|
||||||
|
funnelSelectedWindshieldGlass: getNonFalseValuesOfPropertyInArrayOfObjects(s.order.damage.glassToReplace, 'glassLocation')
|
||||||
.includes(damageLocationsSelected.WINDSHIELD),
|
.includes(damageLocationsSelected.WINDSHIELD),
|
||||||
funnelSelectedBackGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
|
funnelSelectedBackGlass: getNonFalseValuesOfPropertyInArrayOfObjects(s.order.damage.glassToReplace, 'glassLocation')
|
||||||
.includes(damageLocationsSelected.REAR),
|
.includes(damageLocationsSelected.REAR),
|
||||||
funnelSelectedDriverSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
|
funnelSelectedDriverSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(s.order.damage.glassToReplace, 'glassLocation')
|
||||||
.includes(damageLocationsSelected.DRIVER),
|
.includes(damageLocationsSelected.DRIVER),
|
||||||
funnelSelectedPassengerSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
|
funnelSelectedPassengerSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(s.order.damage.glassToReplace, 'glassLocation')
|
||||||
.includes(damageLocationsSelected.PASSENGER),
|
.includes(damageLocationsSelected.PASSENGER),
|
||||||
funnelOrderPartNumbers: [
|
funnelOrderPartNumbers: [
|
||||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||||
state.order.lineItems.glassParts,
|
s.order.lineItems.glassParts,
|
||||||
'partNumber'
|
'partNumber'
|
||||||
),
|
),
|
||||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||||
state.order.lineItems.otherParts,
|
s.order.lineItems.otherParts,
|
||||||
'partNumber'
|
'partNumber'
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
funnelOrderPartTypes: [
|
funnelOrderPartTypes: [
|
||||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||||
state.order.lineItems.glassParts,
|
s.order.lineItems.glassParts,
|
||||||
'recalibrationType'
|
'recalibrationType'
|
||||||
),
|
),
|
||||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||||
state.order.lineItems.otherParts,
|
s.order.lineItems.otherParts,
|
||||||
'recalibrationType'
|
'recalibrationType'
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
}),
|
};
|
||||||
|
},
|
||||||
experimentSettings: (state) => state.applicationUser.experiments
|
experimentSettings: (state) => state.applicationUser.experiments
|
||||||
.filter((x) => !!x.isActive)
|
.filter((x) => !!x.isActive)
|
||||||
.map((x) => x.settings)
|
.map((x) => x.settings)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue