CASH-1036: fix dropoff issue for temporary state

This commit is contained in:
AdamCaouetteSafelite 2025-06-27 10:48:59 -04:00
parent 86fdfd81f8
commit ebec894e33
2 changed files with 37 additions and 14 deletions

View file

@ -76,6 +76,7 @@ import {
} from "@/layouts/schedule/helpers/schedule-helper"; } from "@/layouts/schedule/helpers/schedule-helper";
import { import {
AppointmentTypeStrings, AppointmentTypeStrings,
RouteCodeFlags,
PREMIUM_FEE_PART_TYPE, PREMIUM_FEE_PART_TYPE,
PRICING_BY_DAY_PART_TYPE, PRICING_BY_DAY_PART_TYPE,
} from "@/constants/schedule-constants"; } from "@/constants/schedule-constants";
@ -447,7 +448,7 @@ export default {
if (this.isMobileSelected) { if (this.isMobileSelected) {
return "Mobile"; return "Mobile";
} else { } else {
return "Inshop"; return "InshopOrDropoff";
} }
}, },
getServiceMinutesMin() { getServiceMinutesMin() {
@ -569,10 +570,14 @@ export default {
timeSlotInfo.timeSlot.date timeSlotInfo.timeSlot.date
)}`; )}`;
if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) { if (this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF) {
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime( if (
timeSlotInfo.timeSlot.startTime !timeSlotInfo.timeSlot.routeCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)
)}`; ) {
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime(
timeSlotInfo.timeSlot.startTime
)}`;
}
} else if ( } else if (
this.appointmentType === AppointmentTypeStrings.MOBILE && this.appointmentType === AppointmentTypeStrings.MOBILE &&
!timeSlotInfo.isPremiumAppointment !timeSlotInfo.isPremiumAppointment

View file

@ -14,7 +14,7 @@
class="mt-4" class="mt-4"
:class="[ :class="[
isMobileAppointment ? 'is-mobile-appointment' : '', isMobileAppointment ? 'is-mobile-appointment' : '',
isDropOffAppointment ? 'is-drop-off-appointment' : '', isInshopOrDropOffAppointment ? 'is-inshop-or-drop-off-appointment' : '',
]" ]"
:answers="availableTimeSlots" :answers="availableTimeSlots"
groupName="chooseTimeSlot" groupName="chooseTimeSlot"
@ -329,14 +329,12 @@ export default {
return null; return null;
} }
if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) { if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
return this.getAvailableTimeSlotsForDropOff(
this.timeSlotsForSelectedDate.timeSlots
);
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
return this.getAvailableTimeSlotsForMobile(this.timeSlotsForSelectedDate.timeSlots); return this.getAvailableTimeSlotsForMobile(this.timeSlotsForSelectedDate.timeSlots);
} else { } else {
return this.getAvailableTimeSlotsForInshop(this.timeSlotsForSelectedDate.timeSlots); return this.getAvailableTimeSlotsForInshopOrDropOff(
this.timeSlotsForSelectedDate.timeSlots
);
} }
}, },
hasWaitListExperiment() { hasWaitListExperiment() {
@ -357,8 +355,8 @@ export default {
isMobileAppointment() { isMobileAppointment() {
return this.appointmentType === AppointmentTypeStrings.MOBILE; return this.appointmentType === AppointmentTypeStrings.MOBILE;
}, },
isDropOffAppointment() { isInshopOrDropOffAppointment() {
return this.appointmentType === AppointmentTypeStrings.DROP_OFF; return this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF;
}, },
}, },
methods: { methods: {
@ -408,6 +406,26 @@ export default {
return availableTimeSlots; return availableTimeSlots;
}, },
getAvailableTimeSlotsForInshopOrDropOff(timeSlotsForSelectedDate) {
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => {
let buttonLabelValue;
if (timeSlot.id.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)) {
buttonLabelValue = this.dropoffButtonText;
} else if (timeSlot.id.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
buttonLabelValue = this.overnightDropoffButtonText;
} else if (this.isSameDay) {
buttonLabelValue = this.sameDayDropoffButtonText;
} else {
buttonLabelValue = militaryToTwelveHourTime(timeSlot.startTime);
}
return {
value: timeSlot.id,
buttonLabel: buttonLabelValue,
};
});
return availableTimeSlots;
},
getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) { getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) {
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => { const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => {
const readableTime = `${militaryToTwelveHourTime(timeSlot.startTime)} - ${militaryToTwelveHourTime( const readableTime = `${militaryToTwelveHourTime(timeSlot.startTime)} - ${militaryToTwelveHourTime(