Merge pull request #471 from Safelite/feature/richardson/SSR-679

include mobile_insurance in mobile checks
This commit is contained in:
brich1212safe 2023-10-05 17:06:44 -04:00 committed by GitHub
commit 9af1c00c37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 15 deletions

View file

@ -1,7 +1,7 @@
const AppointmentTypeStrings = {
IN_SHOP: 'Inshop',
MOBILE: 'Mobile',
MOBILE_INSURANCE: 'Mobile-Insurance',
MOBILE_NOT_ITAC: 'Mobile-Not-ITAC',
DROP_OFF: 'Dropoff'
};
const PREMIUM_FEE_PART_TYPE = 'EARLY BIRD';

View file

@ -130,7 +130,8 @@ const getAvailableDates = async (
apiEndDate = apiEndDateLimit;
}
if (appointmentType === AppointmentTypeStrings.MOBILE) {
if (appointmentType === AppointmentTypeStrings.MOBILE
|| appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC) {
storeActionConfig = {
storeAction: GET_MOBILE_TIME_SLOTS,
payload: {
@ -311,7 +312,8 @@ export default {
const serviceLocationPreReqs = serviceLocation.zipCode
&& serviceLocation.zipCodeCtu
&& serviceLocation.appointmentType
&& (serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
&& ((serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|| serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC)
|| serviceLocation.provider.providerNumber);
const paymentInfo = useMainStore().payment.isInsurance !== null;
const supportingItems = useMainStore().lineItems.supportingItems !== null;
@ -319,6 +321,7 @@ export default {
useMainStore().order.damage.isRepair
|| (useMainStore().order.lineItems?.glassParts != null
&& useMainStore().order.lineItems.glassParts.length > 0);
return serviceLocationPreReqs && paymentInfo && supportingItems && damageInfo;
},
setData(initialShopTimeSlotsResponse) {

View file

@ -52,14 +52,14 @@ export default {
},
answersToDisplay() {
const shouldShowMobile = this.isServiceableMobile && this.isITAC;
const shouldShowMobileInsurance = this.isServiceableMobile && !this.isITAC;
const shouldShowMobileNotITAC = this.isServiceableMobile && !this.isITAC;
const shouldShowInshop = this.isServiceableInshop;
const shouldShowDropoff = this.isServiceableInshop && !useMainStore().damage.isRepair;
return this.answersFromCms
? this.answersFromCms.filter((answer) => (
(answer.Name === AppointmentTypeStrings.IN_SHOP && shouldShowInshop)
|| (answer.Name === AppointmentTypeStrings.MOBILE && shouldShowMobile)
|| (answer.Name === AppointmentTypeStrings.MOBILE_INSURANCE && shouldShowMobileInsurance)
|| (answer.Name === AppointmentTypeStrings.MOBILE_NOT_ITAC && shouldShowMobileNotITAC)
|| (answer.Name === AppointmentTypeStrings.DROP_OFF && shouldShowDropoff)
))
: [];
@ -86,12 +86,12 @@ export default {
if (
newValue.length === 1
&& newValue.findIndex((answer) => (answer.Name === AppointmentTypeStrings.MOBILE
|| answer.Name === AppointmentTypeStrings.MOBILE_INSURANCE)) !== -1
|| answer.Name === AppointmentTypeStrings.MOBILE_NOT_ITAC)) !== -1
) {
if (this.isITAC) {
this.selectedValues = AppointmentTypeStrings.MOBILE;
} else {
this.selectedValues = AppointmentTypeStrings.MOBILE_INSURANCE;
this.selectedValues = AppointmentTypeStrings.MOBILE_NOT_ITAC;
}
}
},
@ -103,7 +103,7 @@ export default {
if (this.isITAC) {
this.selectedValues = AppointmentTypeStrings.MOBILE;
} else {
this.selectedValues = AppointmentTypeStrings.MOBILE_INSURANCE;
this.selectedValues = AppointmentTypeStrings.MOBILE_NOT_ITAC;
}
}
}

View file

@ -262,7 +262,7 @@ export default {
if (newValue.zipCode !== this.zipCode) {
if (!(this.selectedAppointmentType === AppointmentTypeStrings.MOBILE
|| this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_INSURANCE)) {
|| this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC)) {
this.selectedAppointmentType = null;
}
this.selectedProvider = null;
@ -293,7 +293,7 @@ export default {
},
isMobileLocationDisplayed() {
return this.selectedAppointmentType === AppointmentTypeStrings.MOBILE
|| this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_INSURANCE;
|| this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC;
},
requiresInshopRecalibration() {
// Specifically check for isRecalibrationServiceableMobile === false, not null or true.

View file

@ -142,7 +142,7 @@ export default {
await nextTick();
if (newValue !== AppointmentTypeStrings.MOBILE && newValue !== AppointmentTypeStrings.MOBILE_INSURANCE) {
if (newValue !== AppointmentTypeStrings.MOBILE && newValue !== AppointmentTypeStrings.MOBILE_NOT_ITAC) {
this.getNextShopsFromList();
}
}

View file

@ -195,7 +195,7 @@ export const useMainStore = defineStore({
policy: (state) => state.order.policy,
hasAnyNonWindshieldGlassParts: (state) => !state.order.policy.isDamageGlassOnly,
isMobileAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|| state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_INSURANCE,
|| state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC,
isDropOffAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.DROP_OFF,
isClaimRegistrationRequired: (state) => state.issConfig.isClaimRegistrationRequired,
eventBusItem: (state) => (eventCategory, eventSubCategory) => {
@ -641,7 +641,7 @@ export const useMainStore = defineStore({
startDate,
endDate,
applicationName: applicationConfig.APPLICATION_NAME,
parentAccountNumber: this.payment.parentAccountNumber,
parentAccountNumber: this.issConfig.parentAccountNumber, // this.payment.parentAccountNumber,
carId: vehicle.carId,
lineItems,
glassPieces,
@ -703,7 +703,7 @@ export const useMainStore = defineStore({
endDate,
shopAppointmentType,
applicationName: applicationConfig.APPLICATION_NAME,
parentAccountNumber: 167132, // this.payment.parentAccountNumber,
parentAccountNumber: this.issConfig.parentAccountNumber, // this.payment.parentAccountNumber,
carId: vehicle.carId,
lineItems,
glassPieces,

View file

@ -1033,7 +1033,7 @@ describe('Store', () => {
// Act
store.updateServiceLocation({
appointmentType: AppointmentTypeStrings.MOBILE_INSURANCE
appointmentType: AppointmentTypeStrings.MOBILE_NOT_ITAC
});
// Assert