Update for making ISS PIA work with current Experiment

This commit is contained in:
Bill Richardson 2024-04-25 11:23:54 -04:00
parent db36b32cd0
commit 6fcfe140f0
3 changed files with 28 additions and 22 deletions

View file

@ -4,7 +4,7 @@ const experimentUniverses = Object.freeze({
const experimentSettings = Object.freeze({ const experimentSettings = Object.freeze({
GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index', GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index',
ISS_DISPLAY_PAY_IN_ADVANCE: 'ISSDisplayPIAInsurance_ISS' ISS_DISPLAY_PAY_IN_ADVANCE: 'DisplayPIAInsurance'
}); });
const experimentTriggers = Object.freeze({ const experimentTriggers = Object.freeze({

View file

@ -89,6 +89,7 @@ import bailoutMessage from '@/constants/bailoutMessage';
import { AppointmentTypeStrings } from '@/constants/schedule-constants'; import { AppointmentTypeStrings } from '@/constants/schedule-constants';
import VehicleBanner from '@/iss-components/vehicle-banner/vehicle-banner.vue'; import VehicleBanner from '@/iss-components/vehicle-banner/vehicle-banner.vue';
import { submitWorkOrder } from '@/helpers/order-helper.js'; import { submitWorkOrder } from '@/helpers/order-helper.js';
import { experimentSettings } from '@/constants/experiments';
export default { export default {
name: 'payment-method', name: 'payment-method',
@ -183,7 +184,10 @@ export default {
return this.$route.query[queryStrings.DISPLAY_PAY_IN_ADVANCE_ALERT]; return this.$route.query[queryStrings.DISPLAY_PAY_IN_ADVANCE_ALERT];
}, },
isPayInAdvanceDisabled() { isPayInAdvanceDisabled() {
return useMainStore().isUnverified; const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
const isEnabled = piaExperience === 'true';
return !isEnabled || useMainStore().isUnverified;
}, },
paymentMethod() { paymentMethod() {
return this.paymentMethodInternalModel; return this.paymentMethodInternalModel;

View file

@ -375,29 +375,30 @@ export const useMainStore = defineStore({
}; };
}, },
experimentOrder: (state) => ({ experimentOrder: (state) => ({
issVehicleYear: state.order.vehicle.year, funnelVehicleYear: state.order.vehicle.year,
issVehicleMake: state.order.vehicle.make, funnelVehicleMake: state.order.vehicle.make,
issVehicleModel: state.order.vehicle.model, funnelVehicleModel: state.order.vehicle.model,
issVehicleStyle: state.order.vehicle.style, funnelVehicleStyle: state.order.vehicle.style,
issIsRepair: state.order.damage.isRepair, funnelIsRepair: state.order.damage.isRepair,
issNumberOfChips: state.order.damage.numberOfChips, funnelNumberOfChips: state.order.damage.numberOfChips,
issCarId: state.order.vehicle.carId, funnelCarId: state.order.vehicle.carId,
issServiceCity: state.order.serviceLocation.city, funnelServiceCity: state.order.serviceLocation.city,
issServiceState: state.order.serviceLocation.state, funnelServiceState: state.order.serviceLocation.state,
issServiceZipCode: state.order.serviceLocation.zipCode, funnelServiceZipCode: state.order.serviceLocation.zipCode,
issParentAccountNumber: state.order.accountNumber, funnelServiceZipCodeCtu: state.order.serviceLocation.zipCodeCtu,
issIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified, funnelParentAccountNumber: state.order.accountNumber,
issHasRecalibrationPart: getHasRecalibrationPart(state), funnelIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified,
issSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1, funnelHasRecalibrationPart: getHasRecalibrationPart(state),
issSelectedWindshieldGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') funnelSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
funnelSelectedWindshieldGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
.includes(damageLocationsSelected.WINDSHIELD), .includes(damageLocationsSelected.WINDSHIELD),
issSelectedBackGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') funnelSelectedBackGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
.includes(damageLocationsSelected.REAR), .includes(damageLocationsSelected.REAR),
issSelectedDriverSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') funnelSelectedDriverSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
.includes(damageLocationsSelected.DRIVER), .includes(damageLocationsSelected.DRIVER),
issSelectedPassengerSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') funnelSelectedPassengerSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation')
.includes(damageLocationsSelected.PASSENGER), .includes(damageLocationsSelected.PASSENGER),
issOrderPartNumbers: [ funnelOrderPartNumbers: [
...getNonFalseValuesOfPropertyInArrayOfObjects( ...getNonFalseValuesOfPropertyInArrayOfObjects(
state.order.lineItems.glassParts, state.order.lineItems.glassParts,
'partNumber' 'partNumber'
@ -407,7 +408,7 @@ export const useMainStore = defineStore({
'partNumber' 'partNumber'
) )
], ],
issOrderPartTypes: [ funnelOrderPartTypes: [
...getNonFalseValuesOfPropertyInArrayOfObjects( ...getNonFalseValuesOfPropertyInArrayOfObjects(
state.order.lineItems.glassParts, state.order.lineItems.glassParts,
'recalibrationType' 'recalibrationType'
@ -419,6 +420,7 @@ export const useMainStore = defineStore({
] ]
}), }),
experimentSettings: (state) => state.applicationUser.experiments experimentSettings: (state) => state.applicationUser.experiments
.filter((x) => !!x.isActive)
.map((x) => x.settings) .map((x) => x.settings)
.reduce((r, c) => Object.assign(r, c), {}) ?? {}, .reduce((r, c) => Object.assign(r, c), {}) ?? {},
submittedOrder: () => JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER)) submittedOrder: () => JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER))