diff --git a/src/constants/part-number-strings.js b/src/constants/part-number-strings.js index d373ba016..488bf0742 100644 --- a/src/constants/part-number-strings.js +++ b/src/constants/part-number-strings.js @@ -5,6 +5,7 @@ const partNumberStrings = { DONATION: "DONATION", // Fees RECYCLE_FEE: "RECYCLE FEE", + PRICING_BY_DAY_UPCHARGE: "PREMAPPT GEN", }; export { partNumberStrings }; diff --git a/src/constants/schedule-constants.js b/src/constants/schedule-constants.js index a0aaf8316..fbd165ad1 100644 --- a/src/constants/schedule-constants.js +++ b/src/constants/schedule-constants.js @@ -8,8 +8,7 @@ const PREMIUM_TIME_SLOT_ID_FLAG = "-PREMIUM"; const PREMIUM_FEE_PART_TYPE = "EARLY BIRD"; -// TODO; This will need updating with real PricingByDay part type -const PRICING_BY_DAY_PART_TYPE = "DISC CASHSAVE20"; +const PRICING_BY_DAY_PART_TYPE = "PREMAPPT GEN"; const RouteCodeFlags = { ALL_DAY_DROP_OFF: "ALL DAY DROP OFF", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 509988c6e..2f53d8133 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -10,6 +10,8 @@ const storeMutations = { UPDATE_MODEL: "updateModel", UPDATE_STYLE: "updateStyle", UPDATE_VEHICLE_SUBTYPE: "updateVehicleSubType", + UPDATE_VEHICLE_SPECIAL_CLASS: "updateVehicleSpecialClass", + UPDATE_IS_BIGTRUCK: "updateIsBigTruck", UPDATE_CAR_ID: "updateCarId", UPDATE_VEHICLE_CATEGORY: "updateVehicleCategory", UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl", diff --git a/src/constants/vehicle-categories.js b/src/constants/vehicle-categories.js index 9300f47e2..37ffcf5e1 100644 --- a/src/constants/vehicle-categories.js +++ b/src/constants/vehicle-categories.js @@ -9,9 +9,3 @@ const vehicleCategories = { }; export { vehicleCategories }; - -const vehicleSubTypes = { - HEAVY_TRUCK: "HEAVY TRUCK", -}; - -export { vehicleSubTypes }; diff --git a/src/digital-components/date-picker/mixins/constants.js b/src/digital-components/date-picker/mixins/constants.js index b9092b5eb..52b973d3f 100644 --- a/src/digital-components/date-picker/mixins/constants.js +++ b/src/digital-components/date-picker/mixins/constants.js @@ -26,43 +26,36 @@ const DAYS_OF_WEEK = [ { label: "Sunday", cssClass: "sunday", - index: 0, - isPricingByDayUpchargeDay: false, + isPricingByDayUpchargeDay: true, }, { label: "Monday", cssClass: "monday", - index: 1, isPricingByDayUpchargeDay: true, }, { label: "Tuesday", cssClass: "tuesday", - index: 2, isPricingByDayUpchargeDay: false, }, { label: "Wednesday", cssClass: "wednesday", - index: 3, isPricingByDayUpchargeDay: false, }, { label: "Thursday", cssClass: "thursday", - index: 4, isPricingByDayUpchargeDay: false, }, { label: "Friday", cssClass: "friday", - index: 5, isPricingByDayUpchargeDay: true, }, { label: "Saturday", cssClass: "saturday", - index: 6, isPricingByDayUpchargeDay: true, }, ]; diff --git a/src/experiment-components/date-picker-for-pricing-by-day.vue b/src/experiment-components/date-picker-for-pricing-by-day.vue index 5bdcec336..cad976cf7 100644 --- a/src/experiment-components/date-picker-for-pricing-by-day.vue +++ b/src/experiment-components/date-picker-for-pricing-by-day.vue @@ -1,5 +1,7 @@ @@ -45,8 +52,10 @@ import alert from "@/ux-components/alert/alert"; import { getPricedMobileFeePart, + getPricedRecycleFeePart, getServiceabilityDetails, getBillToAccountNumber, + getClosestApplicableShops, } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; export default { @@ -62,6 +71,7 @@ export default { internalModel: this.copyModel(this.modelValue), serviceZipCodeTextInputId: "", displayInvalidZipAlert: false, + displayNoServiceAlert: false, }; }, props: { @@ -72,6 +82,11 @@ export default { zipCode: "", }), }, + carId: String, + isVehicleHeavyTruck: { + type: Boolean, + default: false, + }, mobileFeePart: { type: Object, default: () => ({}), @@ -106,6 +121,7 @@ export default { methods: { resetAlerts() { this.displayInvalidZipAlert = false; + this.displayNoServiceAlert = false; }, resetsOnZipInput() { this.resetAlerts(); @@ -154,6 +170,22 @@ export default { this.focusOnZipInput(); this.resetModalButtonStyle(); } else { + if (this.isVehicleHeavyTruck) { + // check the location endpoint to verify this zip can service a heavy truck + const closestShops = await getClosestApplicableShops( + this.internalModel.zipCode, + this.carId, + "service-location" + ); + + if (!closestShops || closestShops.providers?.length === 0) { + this.displayNoServiceAlert = true; + this.focusOnZipInput(); + this.resetModalButtonStyle(); + return null; + } + } + this.internalModel.state = zipCodeData.state; this.internalModel.zipCodeCtu = zipCodeData.zipCodeCtu; @@ -164,6 +196,12 @@ export default { "service-location" ); + // retrieve recycle fee part + const recycleFeePart = await getPricedRecycleFeePart( + serviceZipCode, + "service-location" + ); + // retrieve serviceability details const serviceabilityDetails = await getServiceabilityDetails( serviceZipCode, @@ -177,6 +215,7 @@ export default { // update content related to service zip code this.$emit("updated-mobile-fee-part", mobileFeePart); + this.$emit("updated-recycle-fee-part", recycleFeePart); this.$emit("updated-serviceability", serviceabilityDetails.data); this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); this.$emit("updated-bill-to-account-number", billToAccountNumber); diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index a15d8bb0b..0a3e9eefa 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -179,12 +179,12 @@ export default { } }); - this.pushEventToGA( - this.GaCategories.SERVICE_LOCATION, - gaAction, - shops.join(","), - true - ); + var joinedShops = shops.join(","); + if (!joinedShops) { + joinedShops = "no-shops"; + } + + this.pushEventToGA(this.GaCategories.SERVICE_LOCATION, gaAction, joinedShops, true); } if (this.answers.length === 0) { diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index da4ee6689..257de9bf6 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -49,7 +49,7 @@ placeHolderText="Select style" customDropdownId="styleQuestionField" /> -
+
{ @@ -63,6 +62,8 @@ const getDefaultState = () => { model: null, style: null, vehicleSubType: null, + vehicleSpecialClass: null, + isBigTruck: false, carId: null, category: null, vin: null, @@ -217,6 +218,12 @@ export const mutations = { updateVehicleSubType(state, vehicleSubType) { state.order.vehicle.vehicleSubType = vehicleSubType; }, + updateVehicleSpecialClass(state, vehicleSpecialClass) { + state.order.vehicle.vehicleSpecialClass = vehicleSpecialClass; + }, + updateIsBigTruck(state, isBigTruck) { + state.order.vehicle.isBigTruck = isBigTruck; + }, updateCarId(state, carId) { state.order.vehicle.carId = carId; }, @@ -729,7 +736,8 @@ export const mutations = { // if we're loading a session and we do not have a provider number yet, then set isInsurance to null so that // a service package is not selected by default on the quote page. if ( - !sessionInformation.order.payment.isInsurance && + (sessionInformation.order.payment.isInsurance === null || + sessionInformation.order.payment.isInsurance === undefined) && !sessionInformation.order.serviceLocation.provider?.providerNumber ) { state.order.payment.isInsurance = null; @@ -846,9 +854,6 @@ export const getters = { return false; }, - isHeavyTruckVehicle: (state) => { - return state.order.vehicle.vehicleSubType === vehicleSubTypes.HEAVY_TRUCK; - }, isMobileAppointment: (state) => { return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE; }, @@ -1848,7 +1853,7 @@ export const actions = { endPoint += `&${glassPieces}`; } - endPoint += `&isHeavyTruckVehicle=${context.getters.isHeavyTruckVehicle}`; + endPoint += `&isHeavyTruckVehicle=${context.getters.order.vehicle.isBigTruck}`; return globalMethods.callHttpClient({ method: endpoints.GetServiceabilityDetails.method, @@ -1877,7 +1882,7 @@ export const actions = { url += `/${windshieldPartWithRecal.partNumber}`; } //heavy truck vehicle - url += `/${context.getters.isHeavyTruckVehicle}`; + url += `/${context.getters.order.vehicle.isBigTruck}`; return globalMethods.callHttpClient({ method: endpoints.GetProviders.method, @@ -2109,6 +2114,9 @@ export const actions = { year: vehicle.year, make: vehicle.make, model: vehicle.model, + subType: vehicle.vehicleSubType, + specialClass: vehicle.vehicleSpecialClass, + isBigTruck: vehicle.isBigTruck, isInsurance: order.payment.isInsurance ?? false, isVerified: order.payment.insuranceCoverage.isVerified ?? false, lineItems: { @@ -2163,6 +2171,8 @@ export const actions = { style: vehicle.style, vin: vehicle.vin, vehicleSubType: vehicle.vehicleSubType, + vehicleSpecialClass: vehicle.vehicleSpecialClass, + isBigTruck: vehicle.isBigTruck, registration: { firstName: vehicle.registration.firstName, lastName: vehicle.registration.lastName, @@ -2379,6 +2389,8 @@ export const actions = { model, style, vehicleSubType, + vehicleSpecialClass, + isBigTruck, carId, category, canSafeliteService, @@ -2402,6 +2414,8 @@ export const actions = { context.commit(storeMutations.UPDATE_MODEL, model); context.commit(storeMutations.UPDATE_STYLE, style); context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType); + context.commit(storeMutations.UPDATE_VEHICLE_SPECIAL_CLASS, vehicleSpecialClass); + context.commit(storeMutations.UPDATE_IS_BIGTRUCK, isBigTruck); context.commit(storeMutations.UPDATE_CAR_ID, carId); context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category); context.commit(storeMutations.UPDATE_VEHICLE_CAN_SAFELITE_SERVICE, canSafeliteService);