refactor to use correct SQL values

This commit is contained in:
FrankRua 2022-09-07 09:29:10 -04:00
parent c7fc4c8373
commit 7dc95f7f36

View file

@ -379,26 +379,28 @@ export const getters = {
payment: (state) => state.order.payment, payment: (state) => state.order.payment,
experimentOrder: (state) => { experimentOrder: (state) => {
return { return {
vehicleYear: state.order.vehicle.year, funnelVehicleYear: state.order.vehicle.year,
vehicleMake: state.order.vehicle.make, funnelVehicleMake: state.order.vehicle.make,
vehicleModel: state.order.vehicle.model, funnelVehicleModel: state.order.vehicle.model,
vehicleStyle: state.order.vehicle.style, funnelVehicleStyle: state.order.vehicle.style,
isRepair: state.order.damage.isRepair, funnelIsRepair: state.order.damage.isRepair,
numberOfChips: state.order.damage.numberOfChips, funnelNumberOfChips: state.order.damage.numberOfChips,
carId: state.order.vehicle.carId, funnelCarId: state.order.vehicle.carId,
serviceCity: state.order.serviceLocation.city, funnelServiceCity: state.order.serviceLocation.city,
serviceState: state.order.serviceLocation.state, funnelServiceState: state.order.serviceLocation.state,
serviceZipCode: state.order.serviceLocation.zipCode, funnelServiceZipCode: state.order.serviceLocation.zipCode,
parentAccountNumber: state.order.accountNumber, funnelParentAccountNumber: state.order.accountNumber,
isCoverageVerified: state.order.payment.insuranceCoverage.isVerified, funnelIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified,
orderPartNumbers: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "partNumber"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "partNumber")], funnelHasRecalibrationPart: getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "requiresRecalibration")?.length > 0,
orderPartTypes: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "recalibrationType"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "recalibrationType")], funnelSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
hasRecalibrationPart: getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "requiresRecalibration")?.length > 0, funnelSelectedWindshieldGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.WINDSHIELD),
selectedMultiGlass: state.order.damage.glassToReplace?.length > 1, funnelSelectedBackGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.REAR),
selectedWindshieldGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.WINDSHIELD), funnelSelectedDriverSideGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.DRIVER),
selectedBackGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.REAR), funnelSelectedPassengerSideGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.PASSENGER),
selectedDriverSideGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.DRIVER),
selectedPassengerSideGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.PASSENGER) funnelOrderPartNumbers: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "partNumber"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "partNumber")],
funnelOrderPartTypes: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "recalibrationType"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "recalibrationType")],
} }
}, },
experimentSettings: (state) => state.applicationUser.experiments.map(x => x.settings).reduce((r, c) => Object.assign(r, c), {}) ?? {} experimentSettings: (state) => state.applicationUser.experiments.map(x => x.settings).reduce((r, c) => Object.assign(r, c), {}) ?? {}