Merge branch 'develop' into feature/kroell/INSR-8907
This commit is contained in:
commit
fd052b8566
10 changed files with 157 additions and 33 deletions
|
|
@ -244,6 +244,11 @@ stages:
|
|||
Contents: '**'
|
||||
TargetFolder: 'public/.well-known'
|
||||
CleanTargetFolder: true
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
SourceFolder: 'public/apple-pay/non-prod'
|
||||
Contents: '**'
|
||||
TargetFolder: 'public/.well-known'
|
||||
- task: DeleteFiles@1
|
||||
inputs:
|
||||
SourceFolder: 'public/apple-pay'
|
||||
|
|
@ -309,6 +314,11 @@ stages:
|
|||
Contents: '**'
|
||||
TargetFolder: 'public/.well-known'
|
||||
CleanTargetFolder: true
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
SourceFolder: 'public/apple-pay/non-prod'
|
||||
Contents: '**'
|
||||
TargetFolder: 'public/.well-known'
|
||||
- task: DeleteFiles@1
|
||||
inputs:
|
||||
SourceFolder: 'public/apple-pay'
|
||||
|
|
@ -374,6 +384,11 @@ stages:
|
|||
Contents: '**'
|
||||
TargetFolder: 'public/.well-known'
|
||||
CleanTargetFolder: true
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
SourceFolder: 'public/apple-pay/non-prod'
|
||||
Contents: '**'
|
||||
TargetFolder: 'public/.well-known'
|
||||
- task: DeleteFiles@1
|
||||
inputs:
|
||||
SourceFolder: 'public/apple-pay'
|
||||
|
|
|
|||
26
package-lock.json
generated
26
package-lock.json
generated
|
|
@ -4696,9 +4696,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
||||
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -4842,7 +4842,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@vitest/coverage-v8/node_modules/brace-expansion": {
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -7017,7 +7019,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.12",
|
||||
"version": "1.1.13",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz",
|
||||
"integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -8966,7 +8970,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/editorconfig/node_modules/brace-expansion": {
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -14672,7 +14678,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/js-beautify/node_modules/brace-expansion": {
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -16745,7 +16753,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.12",
|
||||
"version": "0.1.13",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
|
||||
"integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -19,9 +19,18 @@ const experimentSettings = Object.freeze({
|
|||
ISS_ENABLE_ADYEN_V1: 'ISS_Enable_Adyen_V1'
|
||||
});
|
||||
|
||||
const experimentTest = Object.freeze({
|
||||
ISS_MOBILE_FIRST_POPUP_V3: 'ISS_Mobile_First_Popup_V3'
|
||||
});
|
||||
|
||||
const experimentVariation = Object.freeze({
|
||||
ISS_MOBILE_FIRST_CONTROL_V3: 'NoShowMobileFirstPopUp_V3_CONTROL',
|
||||
ISS_MOBILE_FIRST_TEST_V3: 'YesShowMobileFirstPopUp_V3_TEST'
|
||||
});
|
||||
|
||||
const experimentTriggers = Object.freeze({
|
||||
SITE_ENTRY: 'SiteEntry',
|
||||
PAGE_ENTRY: 'PageEntry'
|
||||
});
|
||||
|
||||
export { experimentUniverses, experimentSettings, experimentTriggers };
|
||||
export { experimentUniverses, experimentSettings, experimentTest, experimentVariation, experimentTriggers };
|
||||
|
|
|
|||
|
|
@ -73,6 +73,21 @@ export async function getZipCodeData(zipCode) {
|
|||
return await processZipCodeResults(useMainStore().validateZip({ zip: zipCode }));
|
||||
}
|
||||
|
||||
export function isServiceableMobileWithData(isGlassServiceableMobile, isRecalibrationServiceableMobile) {
|
||||
const isBigTruck = useMainStore().order.serviceLocation.isBigTruck;
|
||||
if (isBigTruck) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isRecalibrationServiceableMobile === true || isRecalibrationServiceableMobile === false) {
|
||||
return (
|
||||
isGlassServiceableMobile
|
||||
&& isRecalibrationServiceableMobile
|
||||
);
|
||||
}
|
||||
return !!isGlassServiceableMobile;
|
||||
}
|
||||
|
||||
export function mapTimeSlot(timeSlot, timeOfDay) {
|
||||
return {
|
||||
...timeSlot,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ import suggestTimeslotModal from '@/layouts/schedule-page/suggest-timeslot-modal
|
|||
import recalAckModal from '@/layouts/schedule-page/recal-ack-modal/recal-ack-modal.vue';
|
||||
|
||||
// Supporting files
|
||||
import { experimentSettings, experimentUniverses } from '@/constants/experiments';
|
||||
import { experimentSettings, experimentTest, experimentVariation, experimentUniverses } from '@/constants/experiments';
|
||||
import {
|
||||
AppointmentTypeStrings,
|
||||
GET_MOBILE_TIME_SLOTS,
|
||||
|
|
@ -118,6 +118,7 @@ import {
|
|||
getPricedMobileFeePart,
|
||||
getMobileZipCodeData,
|
||||
getZipCodeData,
|
||||
isServiceableMobileWithData,
|
||||
mapTimeSlot
|
||||
} from '@/helpers/service-location-helper';
|
||||
import { Form } from 'vee-validate';
|
||||
|
|
@ -359,7 +360,7 @@ export default {
|
|||
mobileProviderNumber: resultMap.providers?.mobileProviderNumber,
|
||||
serviceabilityDetails: resultMap.serviceabilityDetails,
|
||||
zipCode: initialServiceLocationObj.zipCode
|
||||
}
|
||||
};
|
||||
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.$refs.serviceLocation.initializeComponent(serviceLocationData);
|
||||
|
|
@ -531,13 +532,18 @@ export default {
|
|||
);
|
||||
},
|
||||
async checkMobileFirstExperience(mobileFirstObject = {}) {
|
||||
const mobileFirstExperimentVariation = this.getExperimentVariationNameByTestName(experimentTest.ISS_MOBILE_FIRST_POPUP_V3);
|
||||
const isMobileFirstTestVariation = mobileFirstExperimentVariation === experimentVariation.ISS_MOBILE_FIRST_TEST_V3;
|
||||
const showMobileFirst = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_SHOW_FIRST_MOBILE_APPOINTMENT);
|
||||
if (showMobileFirst) {
|
||||
const pmMobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS);
|
||||
const mobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_MOBILE_DAYS);
|
||||
const hasSelectedDate = !!this.getSelectedDate();
|
||||
const isServicableMobile = mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile;
|
||||
if (!hasSelectedDate && isServicableMobile && mobileFirstObject.mobileProviderNumber && mobileFirstObject.zipCode) {
|
||||
const isServiceableMobile = isServiceableMobileWithData(
|
||||
mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile ?? null,
|
||||
mobileFirstObject.serviceabilityDetails?.isRecalibrationServiceableMobile ?? null
|
||||
);
|
||||
if (!hasSelectedDate && isServiceableMobile && mobileFirstObject.mobileProviderNumber && mobileFirstObject.zipCode) {
|
||||
const todayDateObject = new Date();
|
||||
const todayDateString = convertDateToDateString(todayDateObject);
|
||||
const calendarViewDirection = 'future';
|
||||
|
|
@ -663,7 +669,11 @@ export default {
|
|||
this.mainStore.logMobileFirstExperimentExposure();
|
||||
}
|
||||
|
||||
this.$refs[SUGGEST_TIMESLOT_MODAL_REF_NAME].openModal(timeSlotForAutoSelectionMobile);
|
||||
if (isMobileFirstTestVariation) {
|
||||
this.$refs[SUGGEST_TIMESLOT_MODAL_REF_NAME].openModal(timeSlotForAutoSelectionMobile);
|
||||
} else {
|
||||
console.log('In Control group or experiment not found, skip showing popup');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ export default {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (this.isRecalibrationServiceableMobile !== null) {
|
||||
if (this.isRecalibrationServiceableMobile === true || this.isRecalibrationServiceableMobile === false) {
|
||||
return (
|
||||
this.isGlassServiceableMobile
|
||||
&& this.isRecalibrationServiceableMobile
|
||||
|
|
|
|||
|
|
@ -12,6 +12,17 @@ export default {
|
|||
const experiment = useMainStore().applicationUser.experiments.find((e) => e.universeName === experimentName);
|
||||
return experiment ? experiment : null;
|
||||
},
|
||||
getExperimentByTestName(testName) {
|
||||
const experiment = useMainStore().applicationUser.experiments.find((experiment) => experiment.testName === testName);
|
||||
return experiment ? experiment : null;
|
||||
},
|
||||
getExperimentVariationNameByTestName(testName) {
|
||||
const experimentByTestName = this.getExperimentByTestName(testName);
|
||||
if (!experimentByTestName) {
|
||||
return null;
|
||||
}
|
||||
return experimentByTestName.variationName;
|
||||
},
|
||||
getSettingValue(settingName) {
|
||||
return this.hasSetting(settingName)
|
||||
? useMainStore().experimentSettings[settingName]
|
||||
|
|
|
|||
|
|
@ -1344,8 +1344,22 @@ export const useMainStore = defineStore({
|
|||
endpoint: `${endpoints.GetMobileFeePart.url}?${params.toString()}`
|
||||
});
|
||||
},
|
||||
|
||||
getServiceabilityDetails(serviceZipCode) {
|
||||
console.log('BEEP BOOP');
|
||||
console.log('--ENVIRONMENT DETECTOR ROBOT ENGAGED--');
|
||||
const currentEnvironment = applicationConfig.CURRENT_ENVIRONMENT;
|
||||
console.log('I HAVE DETERMINED THAT THE CURRENT ENVIRONMENT IS:', currentEnvironment);
|
||||
console.log('---');
|
||||
console.log('---');
|
||||
if (currentEnvironment === 'Localhost' || currentEnvironment === 'Dev') {
|
||||
console.log('NEW SERVICEABILITY DETAILS METHOD ACTIVATED');
|
||||
return this.getServiceabilityDetailsNewMethod(serviceZipCode);
|
||||
} else {
|
||||
console.log('OLD SERVICEABILITY DETAILS METHOD ACTIVATED');
|
||||
return this.getServiceabilityDetailsOldMethod(serviceZipCode);
|
||||
}
|
||||
},
|
||||
getServiceabilityDetailsOldMethod(serviceZipCode) {
|
||||
const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order;
|
||||
const { carId } = vehicle;
|
||||
const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace);
|
||||
|
|
@ -1369,6 +1383,22 @@ export const useMainStore = defineStore({
|
|||
endpoint: `${endpoints.GetServiceabilityDetails.url}?${params.toString()}`
|
||||
});
|
||||
},
|
||||
getServiceabilityDetailsNewMethod(serviceZipCode) {
|
||||
const { damage, lineItems, parentAccountNumber, vehicle } = this.order;
|
||||
const { carId } = vehicle;
|
||||
const flattenedGlassParts = getLineItemsFlattened(lineItems.glassParts);
|
||||
const lineItemsList = flattenedGlassParts.map((part) => part.partNumber).join(',');
|
||||
|
||||
let endPoint = `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&carId=${carId}&parentAccountNumber=${parentAccountNumber}&isRepair=${damage.isRepair}`;
|
||||
if (lineItemsList) {
|
||||
endPoint += `&lineItems=${lineItemsList}`;
|
||||
}
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.GetServiceabilityDetails.method,
|
||||
endpoint: endPoint
|
||||
});
|
||||
},
|
||||
lookupVehicleByVin(vin) {
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LookupVehicleByVin.method,
|
||||
|
|
@ -1935,6 +1965,9 @@ export const useMainStore = defineStore({
|
|||
this.updateMobileFee(fee);
|
||||
} else if (fee.partNumber === partNumberStrings.RECYCLE_FEE) {
|
||||
this.updateRecycleFee(fee);
|
||||
} else if (fee.partNumber === partNumberStrings.LABOR2) {
|
||||
// Do not add Labor2 to feeItems since it's already been added to supportingItems
|
||||
this.addPartNumberFeeItem(null, partNumberStrings.LABOR2);
|
||||
} else {
|
||||
this.addPartNumberFeeItem(fee, fee.partNumber);
|
||||
}
|
||||
|
|
@ -1949,8 +1982,8 @@ export const useMainStore = defineStore({
|
|||
// Process Recycle Fee
|
||||
this.updateRecycleFee(partsData.find((rf) => rf.partNumber === partNumberStrings.RECYCLE_FEE));
|
||||
|
||||
// Remove RecycleFee and Labor2 from supporting items as they're saved in feeItems;
|
||||
this.order.lineItems.supportingItems = partsData.filter((i) => i.partNumber !== partNumberStrings.RECYCLE_FEE && i.partNumber !== partNumberStrings.LABOR2);
|
||||
// Remove RecycleFee from supporting items since it's already been added to feeItems
|
||||
this.order.lineItems.supportingItems = partsData.filter((i) => i.partNumber !== partNumberStrings.RECYCLE_FEE);
|
||||
},
|
||||
|
||||
updateVaps(partsData) {
|
||||
|
|
@ -3084,7 +3117,7 @@ export const useMainStore = defineStore({
|
|||
});
|
||||
return response.data;
|
||||
},
|
||||
|
||||
|
||||
hasSubmittedOrder() {
|
||||
return window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER) !== null;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2490,16 +2490,12 @@ describe('Store', () => {
|
|||
});
|
||||
});
|
||||
describe('updateSupportingItems method', () => {
|
||||
it('updateSupportingItems removes Recyle Fee and Labor2 Fee from supporting items in store', () => {
|
||||
it('updateSupportingItems removes Recycle Fee from supporting items in store', () => {
|
||||
// Arrange
|
||||
const partsData = [
|
||||
{
|
||||
partNumber: 'RECYCLE FEE',
|
||||
partType: 'REPLACE FEE'
|
||||
},
|
||||
{
|
||||
partNumber: 'LABOR2',
|
||||
partType: 'NON_GLASS'
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -2507,14 +2503,38 @@ describe('Store', () => {
|
|||
store.updateSupportingItems(partsData);
|
||||
|
||||
// Assert
|
||||
expect.not.objectContaining({
|
||||
partNumber: 'RECYCLE FEE',
|
||||
partType: 'REPLACE FEE'
|
||||
});
|
||||
expect.not.objectContaining({
|
||||
partNumber: 'LABOR2',
|
||||
partType: 'NON_GLASS'
|
||||
});
|
||||
expect(store.order.lineItems.supportingItems).not.toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
partNumber: 'RECYCLE FEE',
|
||||
partType: 'REPLACE FEE'
|
||||
})
|
||||
])
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('updateGlassFees method', () => {
|
||||
it('updateGlassFees does not add Labor2 fee to feeItems', () => {
|
||||
// Arrange
|
||||
const feeData = [
|
||||
{
|
||||
partNumber: 'LABOR2',
|
||||
partType: 'LABOR FEE'
|
||||
}
|
||||
];
|
||||
|
||||
// Act
|
||||
store.updateGlassFees(feeData);
|
||||
|
||||
// Assert
|
||||
expect(store.order.lineItems.feeItems).not.toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
partNumber: 'LABOR2',
|
||||
partType: 'LABOR FEE'
|
||||
})
|
||||
])
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue