Merge branch 'develop' into feature/CSR-1994
This commit is contained in:
commit
e0f9d26338
24 changed files with 229 additions and 134 deletions
|
|
@ -1,20 +0,0 @@
|
|||
const coverageStatus = {
|
||||
PENDING: "Pending",
|
||||
NOCOMP: "NoComp",
|
||||
VERIFIED: "Verified",
|
||||
};
|
||||
|
||||
export function coverageStatusValue(intCoverageStatus) {
|
||||
switch (intCoverageStatus) {
|
||||
case 0:
|
||||
return coverageStatus.PENDING;
|
||||
case 1:
|
||||
return coverageStatus.NOCOMP;
|
||||
case 2:
|
||||
return coverageStatus.VERIFIED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { coverageStatus };
|
||||
|
|
@ -4,7 +4,6 @@ const experimentUniverses = {
|
|||
|
||||
const experimentSettings = {
|
||||
GOOGLE_CUSTOM_DIMENSION_INDEX: "Google Custom Dimension Index",
|
||||
SUPPRESS_VIN_CAPTURE: "SuppressVinCapture",
|
||||
DISPLAY_AVAILABILITY_INDICATORS: "DisplayAvailabilityIndicators",
|
||||
PIA_EXPERIENCE: "PIA Experience",
|
||||
PIA_INSURANCE: "DisplayPIAInsurance",
|
||||
|
|
|
|||
30
src/constants/insurance.js
Normal file
30
src/constants/insurance.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { cartItemTypes } from "@/constants/cart-item-types";
|
||||
|
||||
export const payWithInsuranceStates = ["AZ", "CT", "FL", "KY", "MA", "MN", "NY", "SC"];
|
||||
|
||||
export const cartItemTypesCoveredByInsurance = [
|
||||
cartItemTypes.GLASS_PARTS,
|
||||
cartItemTypes.SUPPORTING_ITEMS,
|
||||
cartItemTypes.RECYCLE_FEE,
|
||||
cartItemTypes.REPLACE_FEE,
|
||||
cartItemTypes.SUPPLIES_REPAIR,
|
||||
];
|
||||
|
||||
export const coverageStatus = {
|
||||
PENDING: "Pending",
|
||||
NOCOMP: "NoComp",
|
||||
VERIFIED: "Verified",
|
||||
};
|
||||
|
||||
export function coverageStatusValue(intCoverageStatus) {
|
||||
switch (intCoverageStatus) {
|
||||
case 0:
|
||||
return coverageStatus.PENDING;
|
||||
case 1:
|
||||
return coverageStatus.NOCOMP;
|
||||
case 2:
|
||||
return coverageStatus.VERIFIED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
export const payWithInsuranceStates = ["AZ", "CT", "FL", "KY", "MA", "MN", "NY", "SC"];
|
||||
|
|
@ -33,6 +33,7 @@ const tintMap = {
|
|||
{ name: "green tint", src: "Glass-NoShade-GreenTint.svg" },
|
||||
{ name: "gray tint privacy", src: "Glass-NoShade-GrayTint.svg" },
|
||||
{ name: "blue tint", src: "Glass-NoShade-BlueTint.svg" },
|
||||
{ name: "green tint privacy", src: "Glass-NoShade-Privacy.svg" },
|
||||
|
||||
// No shade or tint
|
||||
{ name: "clear", src: "Glass-NoShade-NoTint.svg" },
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@
|
|||
class="col d-flex justify-content-between py-0">
|
||||
<span class="label">{{ amountDueText }}</span>
|
||||
<span class="label amount-due">{{
|
||||
showCoverageAsPending
|
||||
? verifyingCoverageText
|
||||
: getFormattedAmount("", amountDue)
|
||||
getLineItemAmount(amountDue, showCoverageAsPending)
|
||||
}}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -24,9 +22,10 @@
|
|||
<textBlock cmsWidgetName="DeductibleTextWidget" />
|
||||
<span>
|
||||
{{
|
||||
showCoverageAsPending
|
||||
? verifyingCoverageText
|
||||
: getFormattedAmount("", deductibleLineItem.subTotal)
|
||||
getLineItemAmount(
|
||||
deductibleLineItem.subTotal,
|
||||
showCoverageAsPending
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -35,12 +34,12 @@
|
|||
<div class="service-type">
|
||||
<textBlock :cmsWidgetName="servicePackageTitleWidget" />
|
||||
<span>
|
||||
{{ getFormattedAmount("", packagePrice) }}
|
||||
{{ getLineItemAmount(packagePrice) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="packagePriceWithoutDiscount > packagePrice"
|
||||
class="struck-out-price">
|
||||
{{ getFormattedAmount("", packagePriceWithoutDiscount) }}
|
||||
{{ getLineItemAmount(packagePriceWithoutDiscount) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
@ -101,7 +100,7 @@
|
|||
(showCoverageAsVerified && !cartItem.isCoveredByInsurance)
|
||||
"
|
||||
>{{
|
||||
getFormattedAmount(cartItem.category, Math.abs(cartItem.subTotal))
|
||||
getLineItemAmount(cartItem.subTotal, null, cartItem.category)
|
||||
}}</span
|
||||
>
|
||||
</div>
|
||||
|
|
@ -109,27 +108,19 @@
|
|||
<!-- Sub total, sales tax, total columns -->
|
||||
<div class="sub-total">
|
||||
<span>{{ subtotalText }}</span>
|
||||
<span>{{
|
||||
showCoverageAsPending
|
||||
? verifyingCoverageText
|
||||
: getFormattedAmount("", subTotal)
|
||||
}}</span>
|
||||
<span>{{ getLineItemAmount(subTotal, showCoverageAsPending) }}</span>
|
||||
</div>
|
||||
<div class="sales-tax">
|
||||
<span>{{ salesTaxText }}</span>
|
||||
<span>{{ getFormattedAmount("", salesTax) }}</span>
|
||||
<span>{{ getLineItemAmount(salesTax) }}</span>
|
||||
</div>
|
||||
<div v-if="showAsPaid" class="amount-paid">
|
||||
<span>{{ amountPaidText }}</span
|
||||
><span>{{ getFormattedAmount("", amountPaid) }}</span>
|
||||
<span>{{ amountPaidText }}</span>
|
||||
<span>{{ getLineItemAmount(amountPaid) }}</span>
|
||||
</div>
|
||||
<div class="amount-due">
|
||||
<span>{{ amountDueText }}</span>
|
||||
<span>{{
|
||||
showCoverageAsPending
|
||||
? verifyingCoverageText
|
||||
: getFormattedAmount("", amountDue)
|
||||
}}</span>
|
||||
<span>{{ getLineItemAmount(amountDue, showCoverageAsPending) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
|
@ -179,7 +170,7 @@ import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper
|
|||
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||
import { cartItemCategories } from "@/constants/cart-item-categories";
|
||||
import { cartItemTypes } from "@/constants/cart-item-types";
|
||||
import { coverageStatus } from "@/constants/coverage-status";
|
||||
import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance";
|
||||
|
||||
export default {
|
||||
name: "cart",
|
||||
|
|
@ -278,11 +269,14 @@ export default {
|
|||
|
||||
return vapsTypeName.Text;
|
||||
},
|
||||
getFormattedAmount(category, amount) {
|
||||
|
||||
getLineItemAmount(amount, useVerifyingText, category) {
|
||||
if (useVerifyingText) return this.verifyingCoverageText;
|
||||
return category == "promos"
|
||||
? "(" + this.currencyFormatter.format(amount * -1) + ")"
|
||||
: this.currencyFormatter.format(amount);
|
||||
},
|
||||
|
||||
removeItem(cartItemType, category) {
|
||||
this.lineItems[category] = this.lineItems[category].filter(
|
||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||
|
|
@ -535,7 +529,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: false,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.FRONT_WIPERS
|
||||
),
|
||||
};
|
||||
|
||||
frontWiperLineItems.forEach((lineItem) => {
|
||||
|
|
@ -573,7 +569,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: false,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.REAR_WIPERS
|
||||
),
|
||||
};
|
||||
|
||||
rearWiperLineItems.forEach((lineItem) => {
|
||||
|
|
@ -611,7 +609,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: false,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.RAIN_DEFENSE
|
||||
),
|
||||
};
|
||||
|
||||
rainDefenseLineItem.cartItemType = cartItem.cartItemType;
|
||||
|
|
@ -632,7 +632,7 @@ export default {
|
|||
|
||||
if (this.glassParts.length > 0) {
|
||||
this.glassParts.forEach((lineItem) => {
|
||||
let glassPartCartItem = {
|
||||
let cartItem = {
|
||||
name: null,
|
||||
category: cartItemCategories.GLASS_PARTS,
|
||||
cartItemType: cartItemTypes.GLASS_PARTS,
|
||||
|
|
@ -642,24 +642,25 @@ export default {
|
|||
(lineItem.kitPrice ?? 0) +
|
||||
(lineItem.laborAmount ?? 0) +
|
||||
(lineItem.sellingPrice ?? 0),
|
||||
|
||||
salesTax: lineItem.salesTax ?? 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: true,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.GLASS_PARTS
|
||||
),
|
||||
};
|
||||
|
||||
if (lineItem.childParts?.length > 0) {
|
||||
lineItem.childParts.forEach((childPartLineItem) => {
|
||||
glassPartCartItem.subTotal +=
|
||||
cartItem.subTotal +=
|
||||
(childPartLineItem.kitPrice ?? 0) +
|
||||
(childPartLineItem.laborAmount ?? 0) +
|
||||
(childPartLineItem.sellingPrice ?? 0);
|
||||
|
||||
glassPartCartItem.salesTax += childPartLineItem.salesTax;
|
||||
cartItem.salesTax += childPartLineItem.salesTax;
|
||||
});
|
||||
}
|
||||
|
||||
glassPartCartItems.push(glassPartCartItem);
|
||||
glassPartCartItems.push(cartItem);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -685,7 +686,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: true,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.REPLACE_FEE
|
||||
),
|
||||
};
|
||||
|
||||
recycleFeeLineItem.cartItemType = cartItem.cartItemType;
|
||||
|
|
@ -723,7 +726,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: true,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.SUPPLIES_REPAIR
|
||||
),
|
||||
};
|
||||
|
||||
suppliesRepairLineItem.cartItemType = cartItem.cartItemType;
|
||||
|
|
@ -759,7 +764,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: false,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.MOBILE_FEE
|
||||
),
|
||||
};
|
||||
|
||||
mobileFeeLineItem.cartItemType = cartItem.cartItemType;
|
||||
|
|
@ -838,7 +845,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: true,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.SUPPORTING_ITEMS
|
||||
),
|
||||
};
|
||||
|
||||
otherSupportingItemsLineItems.forEach((lineItem) => {
|
||||
|
|
@ -876,7 +885,9 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: false,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.EARLY_BIRD
|
||||
),
|
||||
};
|
||||
|
||||
premiumAppointmentDiscountLineItem.cartItemType = cartItem.cartItemType;
|
||||
|
|
@ -922,7 +933,7 @@ export default {
|
|||
subTotal: 0,
|
||||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: false,
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(promoCode),
|
||||
};
|
||||
|
||||
promoLineItems.forEach((promoLineItem) => {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js"
|
|||
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||
import { storeActions } from "@/constants/store-actions.js";
|
||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||
import experimentMixin from "@/mixins/experiment-mixin";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
import { includesWindshieldReplacement } from "@/helpers/damage-helper";
|
||||
import store from "@/store";
|
||||
import router from "@/router";
|
||||
|
|
@ -33,7 +30,7 @@ export async function getDirectNavigation(toRoute) {
|
|||
// vehicle -> vehicle-damage
|
||||
// quote -> vin-lookup/estimate
|
||||
// insurance-company -> vin-lookup/estimate
|
||||
if (store.getters.payment.insuranceCoverage.isVerified) {
|
||||
if (store.getters.requiresVerifiedRedirecting) {
|
||||
if (fmgPageValue === fmgPageValues.VEHICLE) {
|
||||
return fmgPageValues.VEHICLE_DAMAGE;
|
||||
}
|
||||
|
|
@ -77,7 +74,7 @@ export async function getImplicitNavigation(toRoute) {
|
|||
|
||||
if (quoteComponent.methods.arePagePrerequisitesValid()) {
|
||||
// Do not send to quote if verified insurance user.
|
||||
if (store.getters.payment.insuranceCoverage.isVerified) {
|
||||
if (store.getters.requiresVerifiedRedirecting) {
|
||||
return fmgPageValues.HERITAGE;
|
||||
} else {
|
||||
return fmgPageValues.QUOTE;
|
||||
|
|
@ -142,11 +139,7 @@ export async function skipVinLookup() {
|
|||
? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE)
|
||||
: false;
|
||||
|
||||
return (
|
||||
isVinOptionalVehicle ||
|
||||
!includesWindshieldReplacement() ||
|
||||
experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true")
|
||||
);
|
||||
return isVinOptionalVehicle || !includesWindshieldReplacement();
|
||||
}
|
||||
|
||||
export async function skipVinLookupNotRepair() {
|
||||
|
|
@ -158,11 +151,7 @@ export async function skipVinLookupNotRepair() {
|
|||
? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE)
|
||||
: false;
|
||||
|
||||
return (
|
||||
isVinOptionalVehicle ||
|
||||
!includesWindshieldReplacement() ||
|
||||
experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true")
|
||||
);
|
||||
return isVinOptionalVehicle || !includesWindshieldReplacement();
|
||||
}
|
||||
|
||||
async function getLazyLoadedComponent(pageName) {
|
||||
|
|
|
|||
|
|
@ -115,16 +115,6 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
const mockExperimentsList = [
|
||||
{
|
||||
universeName: "ConceptFunnel",
|
||||
settings: {
|
||||
SuppressVinCapture: false,
|
||||
},
|
||||
},
|
||||
];
|
||||
store.commit(storeMutations.UPDATE_EXPERIMENTS, mockExperimentsList);
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
[fmgPageValues.VEHICLE]: true,
|
||||
|
|
@ -371,6 +361,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666");
|
||||
|
||||
// Act
|
||||
const result = await getPageToRouteExistingOrderTo(toRoute);
|
||||
|
|
@ -389,6 +380,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666");
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, true);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
|
|
@ -408,6 +400,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666");
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, true);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
|
|
@ -429,6 +422,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666");
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, [
|
||||
|
|
@ -451,6 +445,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666");
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, [
|
||||
|
|
@ -476,6 +471,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, false);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "55555");
|
||||
|
||||
// Act
|
||||
const result = await getPageToRouteExistingOrderTo(toRoute);
|
||||
|
|
@ -493,6 +489,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, false);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "55555");
|
||||
|
||||
// Act
|
||||
const result = await getPageToRouteExistingOrderTo(toRoute);
|
||||
|
|
@ -510,6 +507,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
};
|
||||
|
||||
store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, false);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "55555");
|
||||
|
||||
// Act
|
||||
const result = await getPageToRouteExistingOrderTo(toRoute);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ import { convertDateStringToDate } from "@/layouts/schedule/helpers/schedule-hel
|
|||
import { deepClone } from "@/helpers/object-helper";
|
||||
import { Form } from "vee-validate";
|
||||
import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-helper";
|
||||
import { coverageStatus } from "@/constants/coverage-status";
|
||||
import { coverageStatus } from "@/constants/insurance";
|
||||
|
||||
export default {
|
||||
name: "confirmation",
|
||||
|
|
|
|||
|
|
@ -112,8 +112,6 @@ import {
|
|||
skipVinLookup,
|
||||
skipVinLookupNotRepair,
|
||||
} from "@/helpers/heritage-integration/navigation-helper";
|
||||
import experimentMixin from "@/mixins/experiment-mixin";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||
|
|
|
|||
|
|
@ -96,15 +96,29 @@ export default {
|
|||
findMatches(request, response) {
|
||||
const matches = [];
|
||||
const term = request?.term?.toUpperCase();
|
||||
const nonPriorityMatches = [];
|
||||
|
||||
this.searchableInsuranceCompanyList.forEach((company, index) => {
|
||||
if (
|
||||
company.accountName.indexOf(term) !== -1 ||
|
||||
company.altTerms.indexOf(term) !== -1
|
||||
company.accountName.toUpperCase().indexOf(term) !== -1 ||
|
||||
company.altTerms.toUpperCase().indexOf(term) !== -1
|
||||
) {
|
||||
matches.push(company.accountName);
|
||||
}
|
||||
});
|
||||
response(matches);
|
||||
|
||||
// Prioritize matched typed entries to top of list
|
||||
const priorityMatches = matches.filter((companyName, index) => {
|
||||
if (companyName.toUpperCase().indexOf(term) === 0) {
|
||||
return companyName;
|
||||
} else {
|
||||
nonPriorityMatches.push(companyName);
|
||||
}
|
||||
});
|
||||
|
||||
const prioritizedMatches = [...priorityMatches, ...nonPriorityMatches];
|
||||
|
||||
response(prioritizedMatches);
|
||||
},
|
||||
selectInsuranceCompany(parentAccountName) {
|
||||
// this runs upon user selection within jQueryUI Autocomplete
|
||||
|
|
@ -112,9 +126,14 @@ export default {
|
|||
console.error("No insurance companies found");
|
||||
return;
|
||||
}
|
||||
const parentAccountNumber = this.getParentAccountNumber(parentAccountName);
|
||||
this.selectedAccountNumber = parentAccountNumber;
|
||||
this.selectedAccountName = this.getParentAccountName(parentAccountNumber);
|
||||
if (parentAccountName) {
|
||||
const parentAccountNumber = this.getParentAccountNumber(parentAccountName);
|
||||
this.selectedAccountNumber = parentAccountNumber;
|
||||
this.selectedAccountName = this.getParentAccountName(parentAccountNumber);
|
||||
} else {
|
||||
this.selectedAccountNumber = "";
|
||||
this.selectedAccountName = "";
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -131,20 +150,12 @@ export default {
|
|||
},
|
||||
minLength: 0, // Necessary to display fmenu when clearing input
|
||||
|
||||
// Bold matching letters as you type in the input
|
||||
search: function (event, ui) {
|
||||
setTimeout(() => {
|
||||
let w = $(this).autocomplete("widget").find("div");
|
||||
let regExpString = "(" + this.value + ")";
|
||||
let re = new RegExp(regExpString, "i");
|
||||
w.html((i, html) =>
|
||||
html.replace(re, "<span style='font-weight: bold;'>$1</span>")
|
||||
);
|
||||
}, 5);
|
||||
},
|
||||
select: function (event, ui) {
|
||||
select(ui.item.value);
|
||||
},
|
||||
change: function (event, ui) {
|
||||
select(ui?.item?.value);
|
||||
},
|
||||
});
|
||||
}, 0);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<navbar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="navbar"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
:isForwardActionDisabled="!meta.valid || !isParentAccountNumber"
|
||||
@back-clicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction" />
|
||||
</div>
|
||||
|
|
@ -44,7 +44,7 @@ import { storeActions } from "@/constants/store-actions";
|
|||
import { Form, defineRule } from "vee-validate";
|
||||
import baseMixin from "@/mixins/base-mixin.js";
|
||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
|
||||
import { applicationConfig } from "@/constants/application-config";
|
||||
import store from "@/store";
|
||||
|
||||
export default {
|
||||
|
|
@ -84,9 +84,22 @@ export default {
|
|||
originalList: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isParentAccountNumber() {
|
||||
return !!this.parentAccountNumber;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isCashParentAccountNumber() {
|
||||
return (
|
||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER.toString() ===
|
||||
store.getters.order?.payment?.parentAccountNumber.toString()
|
||||
);
|
||||
},
|
||||
parentAccountNumberFromStore() {
|
||||
const accountNumber = store.getters.order?.payment?.parentAccountNumber.toString();
|
||||
const accountNumber = !this.isCashParentAccountNumber()
|
||||
? store.getters.order?.payment?.parentAccountNumber.toString()
|
||||
: "";
|
||||
return accountNumber;
|
||||
},
|
||||
arePagePrerequisitesValid() {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ import { errorMessages } from "@/constants/error-messages";
|
|||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||
import { mapTaxedLineItemsToStoreFormat } from "../../store";
|
||||
import { coverageStatus } from "@/constants/coverage-status";
|
||||
import { coverageStatus } from "@/constants/insurance";
|
||||
|
||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||
|
||||
|
|
@ -559,10 +559,12 @@ export default {
|
|||
const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE);
|
||||
const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE);
|
||||
|
||||
const isEnabled =
|
||||
piaExperience === "PIA Optional" ||
|
||||
piaExperience === "PIA Required" ||
|
||||
piaInsurance === "true";
|
||||
var isEnabled = false;
|
||||
if (this.isInsurance) {
|
||||
isEnabled = piaInsurance === "true" && this.currentDeductible !== 0;
|
||||
} else {
|
||||
isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required";
|
||||
}
|
||||
|
||||
return !isEnabled;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ import { deepClone } from "@/helpers/object-helper";
|
|||
import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js";
|
||||
import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js";
|
||||
import { routerParams } from "@/router/router-constants/router-params";
|
||||
import { coverageStatus } from "@/constants/coverage-status";
|
||||
import { coverageStatus } from "@/constants/insurance";
|
||||
|
||||
export default {
|
||||
name: "payment",
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ import { required } from "@/helpers/validation-rules";
|
|||
import { errorMessages } from "@/constants/error-messages";
|
||||
import { Form, defineRule } from "vee-validate";
|
||||
import { applicationConfig } from "@/constants/application-config";
|
||||
import { payWithInsuranceStates } from "@/constants/pay-with-insurance-states";
|
||||
import { payWithInsuranceStates } from "@/constants/insurance";
|
||||
import {
|
||||
revalidatePromosAndValidateQueryStringPromo,
|
||||
buildToastMessagesFromRevalidateOrValidatePromoResponse,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ export default {
|
|||
cmsWidgetName: String,
|
||||
isServiceableMobile: Boolean,
|
||||
isServiceableInshop: Boolean,
|
||||
mobileFeeApplies: Boolean,
|
||||
},
|
||||
computed: {
|
||||
questionText() {
|
||||
|
|
@ -45,7 +46,8 @@ export default {
|
|||
const shouldShowInshop = this.isServiceableInshop;
|
||||
const shouldShowDropoff =
|
||||
this.isServiceableInshop && !this.$store.getters.damage.isRepair;
|
||||
return this.answersFromCms
|
||||
|
||||
var answers = this.answersFromCms
|
||||
? this.answersFromCms.filter((answer) => {
|
||||
return (
|
||||
(answer.Name == AppointmentTypeStrings.IN_SHOP && shouldShowInshop) ||
|
||||
|
|
@ -54,6 +56,15 @@ export default {
|
|||
);
|
||||
})
|
||||
: [];
|
||||
|
||||
if (!this.mobileFeeApplies) {
|
||||
answers.forEach((item) => {
|
||||
if (item.Name.toLowerCase() === "mobile") {
|
||||
item.SubText = item.SubText.replace("*", "");
|
||||
}
|
||||
});
|
||||
}
|
||||
return answers;
|
||||
},
|
||||
selectedValue: {
|
||||
get: function () {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
</span>
|
||||
</div>
|
||||
<textBlock
|
||||
v-if="mobileFeeApplies"
|
||||
:customText="mobileFeeText"
|
||||
cmsWidgetName="MobileFeeDisclaimerWidget"
|
||||
typeStyle="caption" />
|
||||
|
|
@ -153,6 +154,7 @@ export default {
|
|||
alertInvalidZipWidgetName: String,
|
||||
customComponentId: String,
|
||||
validationRules: String,
|
||||
mobileFeeApplies: Boolean,
|
||||
},
|
||||
computed: {
|
||||
mobileLocationLinkPromptText() {
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@
|
|||
:isServiceableMobile="isServiceableMobile"
|
||||
:isServiceableInshop="isServiceableInshop"
|
||||
:isDisplayed="isAppointmentTypeDisplayed"
|
||||
:mobileFeeApplies="mobileFeeApplies"
|
||||
ref="appointmentTypeQuestion"
|
||||
groupName="appointmentTypeQuestion"
|
||||
cmsWidgetName="AppointmentTypeQuestionWidget"
|
||||
|
|
@ -80,6 +81,7 @@
|
|||
v-if="selectedAppointmentType === 'Mobile'"
|
||||
v-model="mobileLocationQuestions"
|
||||
:mobileFeePart="mobileFeePart"
|
||||
:mobileFeeApplies="mobileFeeApplies"
|
||||
@updated-mobile-fee-part="setMobileFeePart"
|
||||
@updated-serviceability="setServiceabilityDetails"
|
||||
@updated-contains-military-base="setContainsMilitaryBase"
|
||||
|
|
@ -139,7 +141,7 @@ import {
|
|||
getShopProviderData,
|
||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
|
||||
import { applicationConfig } from "@/constants/application-config";
|
||||
import { Provider } from "@/layouts/service-location/classes/provider";
|
||||
|
||||
import store from "@/store";
|
||||
|
|
@ -300,6 +302,13 @@ export default {
|
|||
return this.isGlassServiceableMobile;
|
||||
}
|
||||
},
|
||||
mobileFeeApplies() {
|
||||
if (this.mobileFeePart) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
isServiceableInshop() {
|
||||
if (this.isRecalibrationServiceableInshop !== null) {
|
||||
return this.isGlassServiceableInshop && this.isRecalibrationServiceableInshop;
|
||||
|
|
@ -350,17 +359,26 @@ export default {
|
|||
methods: {
|
||||
arePagePrerequisitesValid() {
|
||||
// insurance drops the recycle fee on replace orders so it won't be in supportingItems
|
||||
if (store.getters.payment.isInsurance && !store.getters.order.damage.isRepair) {
|
||||
return (
|
||||
store.getters.order.serviceLocation.zipCode !== null &&
|
||||
store.getters.payment.isInsurance !== null
|
||||
);
|
||||
if (store.getters.payment.isInsurance) {
|
||||
if (
|
||||
store.getters.payment.parentAccountNumber !==
|
||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER &&
|
||||
store.getters.order.policy.policyNumber &&
|
||||
store.getters.order.serviceLocation.zipCode
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return (
|
||||
store.getters.lineItems.supportingItems !== null &&
|
||||
store.getters.order.serviceLocation.zipCode !== null &&
|
||||
store.getters.payment.isInsurance !== null
|
||||
);
|
||||
if (
|
||||
store.getters.lineItems.supportingItems &&
|
||||
store.getters.order.serviceLocation.zipCode
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
setData(zipCodeData, serviceabilityDetails, mobileFeePart, shopProviderData) {
|
||||
|
|
|
|||
|
|
@ -728,6 +728,7 @@ describe("vehicle-damage.vue", () => {
|
|||
getters: {
|
||||
vehicle: {},
|
||||
payment: { insuranceCoverage: { isVerified: true } },
|
||||
requiresVerifiedRedirecting: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ export default {
|
|||
return this.$route.params[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT];
|
||||
},
|
||||
shouldHideBackButton() {
|
||||
return this.$store.getters.payment.insuranceCoverage.isVerified;
|
||||
return this.$store.getters.requiresVerifiedRedirecting;
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ export default {
|
|||
isDisabled(options) {
|
||||
if (
|
||||
!options.length ||
|
||||
store.getters.payment?.insuranceCoverage?.isVerified ||
|
||||
store.getters.requiresVerifiedRedirecting ||
|
||||
getFunnelCookie()?.HasDelayedClaimRegistration
|
||||
) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ jest.mock("@/store", () => ({
|
|||
customer: {
|
||||
emailAddress: "builddigitaltest@safelite.com",
|
||||
},
|
||||
referralNumber: "666666",
|
||||
},
|
||||
payment: {
|
||||
insuranceCoverage: {
|
||||
|
|
|
|||
|
|
@ -116,6 +116,22 @@ const routes = [
|
|||
}
|
||||
}
|
||||
|
||||
// Reroute around pages that should not be available.
|
||||
|
||||
// Exception 1: Integrated Users should not see vehicle or quote pages.
|
||||
if (store.getters.requiresVerifiedRedirecting) {
|
||||
if (to.query.fmgPage === fmgPageValues.VEHICLE) {
|
||||
to.query.fmgPage = fmgPageValues.VEHICLE_DAMAGE;
|
||||
} else if (
|
||||
to.query.fmgPage === fmgPageValues.QUOTE ||
|
||||
to.query.fmgPage === fmgPageValues.INSURANCE_COMPANY
|
||||
) {
|
||||
// Push to heritage if going to quote & integrated.
|
||||
await navigateToHeritageFunnel({ shouldSaveSession: false });
|
||||
return next(false);
|
||||
}
|
||||
}
|
||||
|
||||
await runExperiments(to.query.fmgPage);
|
||||
|
||||
// Process funnel cookie.
|
||||
|
|
@ -144,6 +160,7 @@ const routes = [
|
|||
if (!isExistingFmgPageName(to.query.fmgPage)) {
|
||||
console.log("Not an existing fmg page name:" + to.query.fmgPage);
|
||||
GoToFunnelStartOn404(next);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get route info for the given url. Names will have a 1:1 relationship with names in the Cms.
|
||||
|
|
@ -228,7 +245,7 @@ router.beforeEach(async (to, from, next) => {
|
|||
// Refresh page if navigating to self to prevent locking.
|
||||
// For now only carved out for vehicle; all modals are opened through anchor tags at the moment,
|
||||
// which also self navigate, but relied on the page remaining the same on self-navigation.
|
||||
} else if (toQueryPage === fromQueryPage && toQueryPage === funnelStartPageName) {
|
||||
} else if (toQueryPage === fromQueryPage && toQueryPage === getRedirectedStartPage()) {
|
||||
router.go(0);
|
||||
} else {
|
||||
next();
|
||||
|
|
@ -477,7 +494,7 @@ async function DisplayPageError() {
|
|||
// we use the pageError querystring as a counter to how many times a user has experienced an error and been routed here.
|
||||
// once they receive more than 1 pageerrors, we'll reset their state to hopefully correct any issues they may be having.
|
||||
var navPage = fmgPageValues.VEHICLE;
|
||||
if (store.getters.payment.insuranceCoverage.isVerified) {
|
||||
if (store.getters.requiresVerifiedRedirecting) {
|
||||
navPage = fmgPageValues.VEHICLE_DAMAGE;
|
||||
}
|
||||
|
||||
|
|
@ -542,4 +559,12 @@ async function runExperiments(nextPage) {
|
|||
);
|
||||
}
|
||||
|
||||
function getRedirectedStartPage() {
|
||||
if (store.getters.requiresVerifiedRedirecting) {
|
||||
return fmgPageValues.VEHICLE_DAMAGE;
|
||||
} else {
|
||||
return funnelStartPageName;
|
||||
}
|
||||
}
|
||||
|
||||
export default router;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ import {
|
|||
} from "@/helpers/promotions-helper";
|
||||
import { getDateDifferenceInDays } from "@/helpers/date-helper";
|
||||
import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations";
|
||||
import { coverageStatus, coverageStatusValue } from "@/constants/coverage-status";
|
||||
import { coverageStatus, coverageStatusValue } from "@/constants/insurance";
|
||||
|
||||
// Export State
|
||||
const getDefaultState = () => {
|
||||
return {
|
||||
|
|
@ -775,6 +776,9 @@ export const getters = {
|
|||
}
|
||||
return false;
|
||||
},
|
||||
requiresVerifiedRedirecting: (state) => {
|
||||
return state.order?.referralNumber?.length === 6;
|
||||
},
|
||||
};
|
||||
|
||||
function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) {
|
||||
|
|
@ -1382,7 +1386,9 @@ export const actions = {
|
|||
getMobileFeePart(context, { pageNameToLog }) {
|
||||
const damageType = context.getters.damage.isRepair ? "Repair" : "Replace";
|
||||
const parentAccountNumber = context.getters.payment.parentAccountNumber;
|
||||
const billToAccountNumber = context.getters.payment.billToAccountNumber;
|
||||
const billToAccountNumber = context.getters.payment.billToAccountNumber
|
||||
? context.getters.payment.billToAccountNumber
|
||||
: applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER;
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.GetMobileFeePart.method,
|
||||
|
|
|
|||
Loading…
Reference in a new issue