Merge branch 'develop' into feature/CSR-934

This commit is contained in:
Leah Schumann 2022-12-20 08:02:06 -05:00
commit d1db4a4787
21 changed files with 295 additions and 93 deletions

View file

@ -1,6 +1,9 @@
<template> <template>
<label <label
:class="[buttonWrapperClasses, { 'has-error': errors.length > 0, selected: isChecked }]" :class="[
buttonWrapperClasses,
{ 'has-error': errors.length > 0 && !suppressError, selected: isChecked },
]"
:for="buttonId" :for="buttonId"
@focusin="handleFocus" @focusin="handleFocus"
@focusout="handleBlur" @focusout="handleBlur"

View file

@ -27,4 +27,5 @@ export const inputButtonProps = {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
suppressError: Boolean,
}; };

View file

@ -51,6 +51,7 @@
:additionalButtonStyling="additionalButtonStyling" :additionalButtonStyling="additionalButtonStyling"
:lastValuePushedToGa="lastValuePushedToGa" :lastValuePushedToGa="lastValuePushedToGa"
:setLastValuePushedToGa="setLastValuePushedToGa" :setLastValuePushedToGa="setLastValuePushedToGa"
:suppressError="suppressError"
v-model="selectedValues" /> v-model="selectedValues" />
<!-- For nested questions --> <!-- For nested questions -->
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">

View file

@ -2,7 +2,8 @@
<!-- Modal --> <!-- Modal -->
<div <div
class="modal fade modal-component" class="modal fade modal-component"
:id="this.cmsWidgetName" v-on="{ 'hidden.bs.modal': resetButtonStyle }"
:id="cmsWidgetName"
tabindex="-1" tabindex="-1"
aria-labelledby="ModalComponentLabel" aria-labelledby="ModalComponentLabel"
aria-hidden="true"> aria-hidden="true">
@ -16,10 +17,14 @@
aria-label="Close"></button> aria-label="Close"></button>
</div> </div>
<div class="modal-body ps-4 pe-4 pt-5 pb-4"> <div class="modal-body ps-4 pe-4 pt-5 pb-4">
<img :src="this.ModalImage" class="mw-100 d-flex mx-auto mb-4" alt="" /> <img :src="ModalImage" class="mw-100 d-flex mx-auto mb-4" alt="" />
<h5 class="mb-4" v-html="this.ModalHeadline"></h5> <h5 class="mb-4" v-html="ModalHeadline"></h5>
<p class="fw-bold mb-2 subheader-text" v-html="this.ModalSubheadertext"></p> <p class="fw-bold mb-2 subheader-text" v-html="ModalSubheadertext"></p>
<p class="mb-0" v-html="this.ModalBodyText"></p> <p class="mb-0" v-html="ModalBodyText"></p>
<p
class="my-4 caption modal-sub-body"
v-if="ModalSubBodyText"
v-html="ModalSubBodyText"></p>
</div> </div>
<div class="modal-footer px-5 py-4"> <div class="modal-footer px-5 py-4">
<buttonMain <buttonMain
@ -53,6 +58,9 @@ export default {
ModalBodyText() { ModalBodyText() {
return this.getCmsContent(this.cmsWidgetName, "BodyText"); return this.getCmsContent(this.cmsWidgetName, "BodyText");
}, },
ModalSubBodyText() {
return this.getCmsContent(this.cmsWidgetName, "BodyText2");
},
ModalImage() { ModalImage() {
return this.getCmsContent(this.cmsWidgetName, "Image"); return this.getCmsContent(this.cmsWidgetName, "Image");
}, },
@ -61,16 +69,10 @@ export default {
}, },
}, },
methods: { methods: {
setupModalEventListener() { resetButtonStyle() {
const modal = document.querySelector("#" + this.cmsWidgetName); this.$refs.buttonMain.resetButtonStyle();
modal.addEventListener("hidden.bs.modal", (event) => {
this.$refs.buttonMain.resetButtonStyle();
});
}, },
}, },
mounted() {
this.setupModalEventListener();
},
components: { components: {
buttonMain, buttonMain,
}, },
@ -102,6 +104,9 @@ export default {
box-shadow: 0px 16px 48px -16px rgba(0, 0, 0, 0.25); box-shadow: 0px 16px 48px -16px rgba(0, 0, 0, 0.25);
border-radius: 1.5rem 1.5rem 0 0; border-radius: 1.5rem 1.5rem 0 0;
.modal-body { .modal-body {
.modal-sub-body {
color: $gray-600;
}
ul { ul {
margin-bottom: 0; margin-bottom: 0;
} }

View file

@ -6,7 +6,12 @@
class="form-label" class="form-label"
:class="[questionAlignment === 'center' ? 'text-center w-100 mb-5' : '']" :class="[questionAlignment === 'center' ? 'text-center w-100 mb-5' : '']"
v-html="labelText"></label> v-html="labelText"></label>
<div class="input-wrapper" :class="[includeSearchIcon ? 'has-search-icon' : '']"> <div
class="input-wrapper"
:class="[
includeSearchIcon ? 'has-search-icon' : '',
includeCameraIcon ? 'has-camera-icon' : '',
]">
<input <input
class="form-control" class="form-control"
v-model.trim="value" v-model.trim="value"
@ -31,6 +36,14 @@
:maxlength="maxLength ? maxLength : '999'" :maxlength="maxLength ? maxLength : '999'"
@focus="$emit('focus', $event.target.value)" /> @focus="$emit('focus', $event.target.value)" />
<button v-if="includeSearchIcon" type="submit" aria-label="Search button" /> <button v-if="includeSearchIcon" type="submit" aria-label="Search button" />
<label class="camera-icon-input" v-if="includeCameraIcon">
<input
type="file"
id="vin-input"
accept="image/*"
aria-label="Camera icon/button"
@change="submitImage" />
</label>
</div> </div>
<div v-show="errorMessage" class="row my-2 form-test-error"> <div v-show="errorMessage" class="row my-2 form-test-error">
<span class="d-inline-flex mt-0" role="alert">{{ errorMessage }}</span> <span class="d-inline-flex mt-0" role="alert">{{ errorMessage }}</span>
@ -40,6 +53,7 @@
<script> <script>
import { useField, validate } from "vee-validate"; import { useField, validate } from "vee-validate";
import { storeActions } from "@/constants/store-actions";
export default { export default {
name: "textbox-question", name: "textbox-question",
@ -69,6 +83,7 @@ export default {
questionAlignment: String, // Left or center. Left is default. questionAlignment: String, // Left or center. Left is default.
cornerStyle: String, // Rounded or square. Square is default. cornerStyle: String, // Rounded or square. Square is default.
includeSearchIcon: Boolean, includeSearchIcon: Boolean,
includeCameraIcon: Boolean,
}, },
setup(props) { setup(props) {
const propsClone = Object.assign({}, props); const propsClone = Object.assign({}, props);
@ -105,6 +120,18 @@ export default {
errors, errors,
}; };
}, },
methods: {
async submitImage(e) {
await this.dispatchStoreAction(storeActions.LOOKUP_VIN_BY_IMAGE, e.target.files[0])
.then((response) => {
document.getElementById(this.inputId).value = response.data;
})
.catch((error) => {
console.log(error);
});
e.target.value = null;
},
},
computed: { computed: {
questionText() { questionText() {
return this.getCmsContent(this.cmsWidgetName, "QuestionText"); return this.getCmsContent(this.cmsWidgetName, "QuestionText");
@ -182,6 +209,31 @@ export default {
display: flex; display: flex;
} }
} }
&.has-camera-icon {
label {
&.camera-icon-input {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 1rem;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 40 36' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.9774 16.5228C17.3559 16.5228 15.1864 18.6621 15.1864 21.3476C15.1864 24.0331 17.3107 26.1724 19.9774 26.1724C22.6441 26.1724 24.7684 24.0331 24.7684 21.3476C24.7684 18.6621 22.6441 16.5228 19.9774 16.5228Z' fill='%231574A1'/%3E%3Cpath d='M38.4181 7.23725H29.8701C29.1469 2.64 24.7684 0 19.9774 0C15.1864 0 10.8531 2.64 10.0847 7.23725H1.58192C0.723164 7.23725 0 7.96553 0 8.83035V33.7738C0 34.6387 0.723164 35.3669 1.58192 35.3669H38.4181C39.2768 35.3669 40 34.6387 40 33.7738V8.83035C40 7.96553 39.2768 7.23725 38.4181 7.23725ZM19.9774 29.7683C15.3672 29.7683 11.5706 25.9904 11.5706 21.3021C11.5706 16.6138 15.3672 12.8814 19.9774 12.8814C24.5876 12.8814 28.3842 16.6593 28.3842 21.3476C28.3842 26.0359 24.6328 29.7683 19.9774 29.7683ZM36.565 14.5655H33.0395V11.0152H36.565V14.5655Z' fill='%231574A1'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-position: center;
width: 2rem;
height: 100%;
display: flex;
border: none;
background-color: transparent;
&:hover {
cursor: pointer;
}
input[type="file"] {
position: absolute;
left: -9999px;
}
}
}
}
} }
input { input {
&.has-icon { &.has-icon {

View file

@ -88,7 +88,7 @@ const endpoints = {
}, },
LoadSession: { LoadSession: {
url: "/order/api/v1/order/load-session", url: "/order/api/v1/order/load-session",
method: "GET", method: "POST",
}, },
ValidateZip: { ValidateZip: {
url: "/location/api/v1/location/zip", url: "/location/api/v1/location/zip",
@ -96,7 +96,7 @@ const endpoints = {
}, },
PriceOrderItems: { PriceOrderItems: {
url: "/price/api/v1/price/order-items", url: "/price/api/v1/price/order-items",
method: "POST", method: "GET",
}, },
LogExperimentExposureIfAssigned: { LogExperimentExposureIfAssigned: {
url: "/experiments/api/v1/experiments/log-exposure", url: "/experiments/api/v1/experiments/log-exposure",
@ -122,6 +122,10 @@ const endpoints = {
url: "/experiments/api/v1/experiments/run", url: "/experiments/api/v1/experiments/run",
method: "POST", method: "POST",
}, },
LookupVinByImage: {
url: "https://slimagetovin.azurewebsites.net/home/FindVIN",
method: "POST",
},
}; };
export { endpoints }; export { endpoints };

View file

@ -19,6 +19,7 @@ const storeActions = {
LOOKUP_VEHICLE_BY_VIN: "lookupVehicleByVin", LOOKUP_VEHICLE_BY_VIN: "lookupVehicleByVin",
LOOKUP_VIN_BY_PLATE: "lookupVinByPlate", LOOKUP_VIN_BY_PLATE: "lookupVinByPlate",
LOOKUP_VIN_BY_ADDRESS: "lookupVinByAddress", LOOKUP_VIN_BY_ADDRESS: "lookupVinByAddress",
LOOKUP_VIN_BY_IMAGE: "lookupVinByImage",
GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions", GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions",
GET_PARTS: "getParts", GET_PARTS: "getParts",
GET_WIPERS: "getWipers", GET_WIPERS: "getWipers",
@ -67,6 +68,7 @@ const storeActions = {
SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers", SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers",
SAVE_QUOTE_PAGE_SELECTIONS: "saveQuotePageSelections", SAVE_QUOTE_PAGE_SELECTIONS: "saveQuotePageSelections",
SAVE_PAYMENT_TYPE: "savePaymentType", SAVE_PAYMENT_TYPE: "savePaymentType",
SAVE_ACCOUNT_NUMBER: "saveAccountNumber",
SAVE_SUPPORTING_ITEMS: "saveSupportingItems", SAVE_SUPPORTING_ITEMS: "saveSupportingItems",
SAVE_VAPS: "saveVaps", SAVE_VAPS: "saveVaps",
}; };

View file

@ -21,6 +21,7 @@ const storeMutations = {
UPDATE_GLASS_PARTS: "updateGlassParts", UPDATE_GLASS_PARTS: "updateGlassParts",
UPDATE_VAPS: "updateVaps", UPDATE_VAPS: "updateVaps",
UPDATE_SUPPORTING_ITEMS: "updateSupportingItems", UPDATE_SUPPORTING_ITEMS: "updateSupportingItems",
UPDATE_LINE_ITEMS_SERVER_DATA: "updateLineItemsServerData",
UPDATE_REGISTRATION_LICENSE_PLATE: "updateRegistrationLicensePlate", UPDATE_REGISTRATION_LICENSE_PLATE: "updateRegistrationLicensePlate",
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress", UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",

View file

@ -53,6 +53,25 @@ export default {
}); });
}, },
callSimpleHttpClient({ method, endpoint, payload }) {
return new Promise((resolve, reject) => {
axios({
method: method,
url: endpoint,
data: payload,
crossDomain: true,
headers: { "Access-Control-Allow-Origin": "*" },
}).then(
(response) => {
return resolve(response);
},
(error) => {
return reject(error.response);
}
);
});
},
/* istanbul ignore next */ /* istanbul ignore next */
callMockHttpClient({ method, endpoint }) { callMockHttpClient({ method, endpoint }) {
// For Mock use only! // For Mock use only!

View file

@ -69,7 +69,7 @@ export async function skipVinLookup() {
return ( return (
store.getters.damage.isRepair || store.getters.damage.isRepair ||
isVinOptionalVehicle || isVinOptionalVehicle ||
experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, true) experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true")
); );
} }
@ -83,7 +83,7 @@ export async function skipVinLookupNotRepair() {
(isVinOptionalVehicle || (isVinOptionalVehicle ||
experimentMixin.methods.hasSettingEqualTo( experimentMixin.methods.hasSettingEqualTo(
experimentSettings.SUPPRESS_VIN_CAPTURE, experimentSettings.SUPPRESS_VIN_CAPTURE,
true "true"
)) ))
); );
} }

View file

@ -14,11 +14,16 @@ import { storeMutations } from "@/constants/store-mutations";
it will reset the state and go back to the start of the funnel. it will reset the state and go back to the start of the funnel.
*/ */
export async function loadSessionIfPresent() { export async function loadSessionIfPresent(isConceptInsurance) {
const funnelCookie = getFunnelCookie(); const funnelCookie = getFunnelCookie();
// Do nothing if there is no cookie or session to use for loading. // Do nothing if there is no cookie or session to use for loading.
if (funnelCookie == null || funnelCookie.SavedSessionId == null) { if (
funnelCookie == null ||
funnelCookie.SavedSessionId == null ||
funnelCookie.ReferralCorrelationId == null ||
!funnelCookie.ReferralNumber
) {
return null; return null;
} }
@ -34,8 +39,10 @@ export async function loadSessionIfPresent() {
await loadSession( await loadSession(
funnelCookie.SavedSessionId, funnelCookie.SavedSessionId,
funnelCookie.ReferralNumber, funnelCookie.ReferralNumber,
funnelCookie.ReferralDate,
funnelCookie.ReferralParentAccountNumber, funnelCookie.ReferralParentAccountNumber,
funnelCookie.ReferralCorrelationId funnelCookie.ReferralCorrelationId,
isConceptInsurance
) )
).data; ).data;
} }
@ -68,16 +75,26 @@ export async function saveSession() {
Calls API to load session given the referral number, referralDate, and referralCorrelationId Calls API to load session given the referral number, referralDate, and referralCorrelationId
and returns the response. and returns the response.
*/ */
async function loadSession(savedSessionId, referralNumber, accountNumber, referralCorrelationId) { async function loadSession(
savedSessionId,
referralNumber,
referralDate,
accountNumber,
referralCorrelationId,
isConceptInsurance
) {
// await the saveSessionPromise in the store to make sure we're loading up to date information // await the saveSessionPromise in the store to make sure we're loading up to date information
await store.getters.applicationUser.saveSessionPromise; await store.getters.applicationUser.saveSessionPromise;
const response = await baseMixin.methods.dispatchStoreAction( const response = await baseMixin.methods.dispatchStoreAction(
storeActions.LOAD_SESSION, storeActions.LOAD_SESSION,
{ {
savedSessionId: savedSessionId?.toString(), savedSessionId: savedSessionId?.toString(),
referralNumber, referralNumber,
referralDate,
accountNumber, accountNumber,
referralCorrelationId, referralCorrelationId,
isConceptInsurance,
}, },
false false
); );
@ -100,6 +117,7 @@ async function saveSessionHelper() {
accountNumber: savedSessionInfo.data.accountNumber?.toString(), accountNumber: savedSessionInfo.data.accountNumber?.toString(),
savedSessionId: savedSessionInfo.data.savedSessionId, savedSessionId: savedSessionInfo.data.savedSessionId,
crmCustomerId: savedSessionInfo.data.crmCustomerId?.toString(), crmCustomerId: savedSessionInfo.data.crmCustomerId?.toString(),
eon: savedSessionInfo.data.eon,
}, },
false false
); );

View file

@ -149,10 +149,7 @@ export default {
const glassPartsForStore = partsLookup.data.glassPieceParts; const glassPartsForStore = partsLookup.data.glassPieceParts;
// this.navigateForward(glassPartsForStore); this.navigateForward(glassPartsForStore);
// TODO KO delete for quote mvp
this.navigateForward(glassPartsForStore, null, this.shouldGoToHeritageQuote);
}, },
}, },
components: { components: {

View file

@ -25,17 +25,19 @@
groupName="ServicePackageQuestion" groupName="ServicePackageQuestion"
:availableLineItems="availableLineItems" :availableLineItems="availableLineItems"
:isInsuranceSelected="isInsuranceSelected" :isInsuranceSelected="isInsuranceSelected"
@vapsItemsSelected="vapsItemsSelectedAction" /> @vapsItemsSelected="vapsItemsSelectedAction"
validationRules="option-required"
isRequired />
<textBlock <textBlock
cmsWidgetName="quoteDisclaimer" cmsWidgetName="quoteDisclaimer"
justifyText="left" justifyText="left"
typeStyle="caption" typeStyle="caption"
class="mt-4" /> class="mt-4" />
<modal cmsWidgetName="EstimateRainDefenseModal" /> <modal cmsWidgetName="RainDefenseModal" />
<modal cmsWidgetName="EstimateFrontWiperModal" /> <modal cmsWidgetName="FrontWiperModal" />
<modal cmsWidgetName="EstimateRearWiperModal" /> <modal cmsWidgetName="RearWiperModal" />
<modal cmsWidgetName="EstimateRecalModal" /> <modal cmsWidgetName="RecalModal" />
<funnel-footer <funnel-footer
cmsWidgetName="FunnelFooterWidget" cmsWidgetName="FunnelFooterWidget"
:isForwardActionDisabled="!meta.valid" :isForwardActionDisabled="!meta.valid"
@ -64,14 +66,19 @@ import { settleAllPromises } from "@/helpers/layout-helper";
import { storeActions } from "@/constants/store-actions"; import { storeActions } from "@/constants/store-actions";
import store from "@/store"; import store from "@/store";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { Form } from "vee-validate"; import { required } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
import { Form, defineRule } from "vee-validate";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
import { applicationConfig } from "@/constants/application-config";
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
export default { export default {
name: "quote", name: "quote",
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
// Call APIs // Call APIs
const cmsContent = await fetchCmsContentForPage(to.query.fmgPage); const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
const wipersPromise = baseMixin.methods.dispatchStoreAction(storeActions.GET_WIPERS); const wipersPromise = baseMixin.methods.dispatchStoreAction(storeActions.GET_WIPERS);
const rainDefensePromise = baseMixin.methods.dispatchStoreAction( const rainDefensePromise = baseMixin.methods.dispatchStoreAction(
storeActions.GET_RAIN_DEFENSE storeActions.GET_RAIN_DEFENSE
@ -81,6 +88,10 @@ export default {
); );
const promiseResultMap = [ const promiseResultMap = [
{
resultKey: "cmsContent",
promise: cmsContentPromise,
},
{ {
resultKey: "wipers", resultKey: "wipers",
promise: wipersPromise, promise: wipersPromise,
@ -112,11 +123,10 @@ export default {
// Call the "next" function to complete the transition to this page. // Call the "next" function to complete the transition to this page.
next((vm) => { next((vm) => {
vm.setCmsContent(cmsContent); vm.setCmsContent(resultMap.cmsContent);
vm.supportingItems = resultMap.supportingItems; vm.supportingItems = resultMap.supportingItems;
vm.availableLineItems = pricingResults; vm.availableLineItems = pricingResults;
vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue(); vm.isInsuranceSelected = vm.getDefaultIsInsuranceSelectedValue(vm.availableLineItems);
}); });
}, },
data() { data() {
@ -137,19 +147,33 @@ export default {
store.getters.order.lineItems.glassParts.length > 0)) store.getters.order.lineItems.glassParts.length > 0))
); );
}, },
getDefaultIsInsuranceSelectedValue() { getDefaultIsInsuranceSelectedValue(availableLineItems) {
// Override if coming back from QuoteDetails. Remove override after Quote release
const isInsuranceOverrideValue = this.$route.query?.isInsurance;
const defaultIsInsuranceSelectedValue = this.$store.getters.order.payment.isInsurance; const defaultIsInsuranceSelectedValue = this.$store.getters.order.payment.isInsurance;
if (defaultIsInsuranceSelectedValue != null) { if (isInsuranceOverrideValue != null) {
return isInsuranceOverrideValue == "true";
} else if (defaultIsInsuranceSelectedValue != null) {
return defaultIsInsuranceSelectedValue; return defaultIsInsuranceSelectedValue;
} else { } else {
return this.availableLineItems return availableLineItems
? baseMixin.methods.getTierOnePackagePrice(this.availableLineItems) > 500 ? baseMixin.methods.getTierOnePackagePrice(availableLineItems) > 500
: null; : null;
} }
}, },
vapsItemsSelectedAction(vapsItemsSelected) { vapsItemsSelectedAction(vapsItemsSelected) {
this.selectedVaps = vapsItemsSelected; this.selectedVaps = vapsItemsSelected;
}, },
filterOutFees(currentSupportingItems) {
const filteredSupportingItems = currentSupportingItems.filter((item) => {
return (
!item.partType.includes("FEE") ||
(item.partType === "REPAIR FEE" && item.partNumber != "SUPPLIES-REPAIR")
);
});
return filteredSupportingItems;
},
backButtonAction() { backButtonAction() {
vehicleQuestionsMixin.methods.navigateBack(this); vehicleQuestionsMixin.methods.navigateBack(this);
}, },
@ -159,6 +183,16 @@ export default {
this.isInsuranceSelected, this.isInsuranceSelected,
false false
); );
if (!this.isInsuranceSelected) {
this.dispatchStoreAction(
this.storeActions.SAVE_ACCOUNT_NUMBER,
applicationConfig.CASH_ACCOUNT_NUMBER,
false
);
}
if (this.$store.getters.order.accountNumber != applicationConfig.CASH_ACCOUNT_NUMBER) {
this.supportingItems = this.filterOutFees(this.supportingItems);
}
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS, this.storeActions.SAVE_SUPPORTING_ITEMS,
this.supportingItems, this.supportingItems,

View file

@ -5,7 +5,8 @@
buttonTypeString="servicePackageRadio" buttonTypeString="servicePackageRadio"
:buttonTypeObject="servicePackageRadio" :buttonTypeObject="servicePackageRadio"
v-model="selectedPackageName" v-model="selectedPackageName"
isRequired /> :validationRules="validationRules"
:isRequired="isRequired" />
</template> </template>
<script> <script>
@ -28,6 +29,8 @@ export default {
groupName: String, groupName: String,
cashCmsWidgetName: String, cashCmsWidgetName: String,
insuranceCmsWidgetName: String, insuranceCmsWidgetName: String,
validationRules: String,
isRequired: Boolean,
isInsuranceSelected: Boolean, isInsuranceSelected: Boolean,
availableLineItems: null, availableLineItems: null,
}, },
@ -115,29 +118,24 @@ export default {
}, },
rearWiperApplicableForTierThree() { rearWiperApplicableForTierThree() {
const rearWiperIsAvailable = this.lineItemsContainsPartType(partTypeStrings.REAR_WIPER); const rearWiperIsAvailable = this.lineItemsContainsPartType(partTypeStrings.REAR_WIPER);
return (
this.glassToReplaceContainsGlassLocation(glassLocations.REAR) &&
rearWiperIsAvailable
);
},
rainDefenseApplicableForTierThree() {
const frontWipersAreAvailable = this.lineItemsContainsPartType( const frontWipersAreAvailable = this.lineItemsContainsPartType(
partTypeStrings.FRONT_WIPER partTypeStrings.FRONT_WIPER
); );
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation( return (
glassLocations.WINDSHIELD rearWiperIsAvailable &&
(this.glassToReplaceContainsGlassLocation(glassLocations.REAR) ||
!frontWipersAreAvailable)
); );
const glassToReplaceContainsRearGlass = this.glassToReplaceContainsGlassLocation( },
glassLocations.REAR rainDefenseApplicableForTierThree() {
); if (
if (this.frontWipersApplicableForTierTwo) { this.rearWiperApplicableForTierTwo &&
return true; !this.frontWipersApplicableForTierTwo &&
} else if (!frontWipersAreAvailable) { this.frontWipersApplicableForTierThree
return true; ) {
} else if (!glassToReplaceContainsWindshield && !glassToReplaceContainsRearGlass) {
return true;
} else {
return false; return false;
} else {
return true;
} }
}, },
shouldDisplayTierTwoPackage() { shouldDisplayTierTwoPackage() {
@ -185,7 +183,7 @@ export default {
item.partType.toUpperCase() === partTypeStrings.FRONT_WIPER) || item.partType.toUpperCase() === partTypeStrings.FRONT_WIPER) ||
(priceRearWipers && item.partType.toUpperCase() === partTypeStrings.REAR_WIPER) (priceRearWipers && item.partType.toUpperCase() === partTypeStrings.REAR_WIPER)
) { ) {
vapsPrice += item.price; vapsPrice += baseMixin.methods.getTotalLineItemPrice(item);
} }
}); });
return vapsPrice; return vapsPrice;
@ -204,7 +202,7 @@ export default {
(priceRainDefense && (priceRainDefense &&
item.partType.toUpperCase() === partTypeStrings.RAIN_DEFENSE) item.partType.toUpperCase() === partTypeStrings.RAIN_DEFENSE)
) { ) {
vapsPrice += item.price; vapsPrice += baseMixin.methods.getTotalLineItemPrice(item);
} }
}); });
return vapsPrice; return vapsPrice;

View file

@ -19,6 +19,7 @@
validationRules="vin-required|vin-format" validationRules="vin-required|vin-format"
:isDisabled="vinPopulatedOnPageLoad" :isDisabled="vinPopulatedOnPageLoad"
maxLength="17" maxLength="17"
includeCameraIcon
:mask="vinMask" /> :mask="vinMask" />
</div> </div>
</div> </div>
@ -325,10 +326,13 @@ export default {
// If a VIN has already been found. Validate the Service Zip (in case of changes) // If a VIN has already been found. Validate the Service Zip (in case of changes)
const zipCodeData = await this.getZipCodeData(this.serviceZipCode); const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
// Check if Service Zip entered is serviceable // Check if Service Zip entered is serviceable then save the ZIP info and email address
if (zipCodeData.isServiceable) { if (zipCodeData.isServiceable) {
// If the Service Zip entered is serviceable then save the Zip Info and Email Address and navigate forward //Only save the service location if the zip changed or we lack zipCodeCtu
if (this.$store.getters.order.serviceLocation.zipCode != this.serviceZipCode) { if (
this.$store.getters.order.serviceLocation.zipCode != this.serviceZipCode ||
!this.$store.getters.order.serviceLocation.zipCodeCtu
) {
const vehicleRegistrationInfo = this.$store.getters.vehicle.registration; const vehicleRegistrationInfo = this.$store.getters.vehicle.registration;
if (vehicleRegistrationInfo.zipCode == this.serviceZipCode) { if (vehicleRegistrationInfo.zipCode == this.serviceZipCode) {
await this.dispatchStoreAction( await this.dispatchStoreAction(
@ -338,6 +342,7 @@ export default {
city: vehicleRegistrationInfo.city, city: vehicleRegistrationInfo.city,
zipCode: vehicleRegistrationInfo.zipCode, zipCode: vehicleRegistrationInfo.zipCode,
state: vehicleRegistrationInfo.state, state: vehicleRegistrationInfo.state,
zipCodeCtu: zipCodeData.zipCodeCtu,
}, },
false false
); );

View file

@ -72,11 +72,14 @@ export default {
partType != partTypeStrings.REAR_WIPER && partType != partTypeStrings.REAR_WIPER &&
partType != partTypeStrings.RAIN_DEFENSE partType != partTypeStrings.RAIN_DEFENSE
) { ) {
totalPrice += lineItem.price; totalPrice += this.getTotalLineItemPrice(lineItem);
} }
}); });
return totalPrice; return totalPrice;
}, },
getTotalLineItemPrice(lineItem) {
return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice;
},
}, },
computed: { computed: {
storeActions() { storeActions() {

View file

@ -42,7 +42,9 @@ export default {
requiresCapabilityQuestions: singlePart.requiresCapabilityQuestions, requiresCapabilityQuestions: singlePart.requiresCapabilityQuestions,
recalibrationType: singlePart.recalibrationType, recalibrationType: singlePart.recalibrationType,
childParts: singlePart.childParts, childParts: singlePart.childParts,
price: singlePart.price, kitPrice: singlePart.kitPrice,
sellingPrice: singlePart.sellingPrice,
laborAmount: singlePart.laborAmount,
}); });
} }
}); });

View file

@ -67,7 +67,15 @@ const routes = [
// the saveSessionPromise will no longer point to a valid promise // the saveSessionPromise will no longer point to a valid promise
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
const loadSessionResponse = await loadSessionIfPresent(); // Remove the parameter after quote release
const loadSessionResponse = await loadSessionIfPresent(
to.query.isInsurance != null
? to.query.isInsurance == "true"
? true
: false
: null
);
const pageToRedirectTo = await getPageToRouteExistingOrderTo( const pageToRedirectTo = await getPageToRouteExistingOrderTo(
to, to,
loadSessionResponse loadSessionResponse

View file

@ -149,6 +149,9 @@ export const mutations = {
updateSupportingItems(state, partsData) { updateSupportingItems(state, partsData) {
state.order.lineItems.supportingItems = partsData; state.order.lineItems.supportingItems = partsData;
}, },
updateLineItemsServerData(state, serverData) {
state.order.lineItems.serverData = serverData;
},
updatePageData(state, pageData) { updatePageData(state, pageData) {
state.applicationUser.pageData[pageData.page] = pageData.data; state.applicationUser.pageData[pageData.page] = pageData.data;
}, },
@ -519,6 +522,15 @@ export const actions = {
}, },
}); });
}, },
lookupVinByImage(context, image) {
const data = new FormData();
data.append("file", image);
return globalMethods.callSimpleHttpClient({
method: endpoints.LookupVinByImage.method,
endpoint: endpoints.LookupVinByImage.url,
payload: data,
});
},
getVehicleMakes(context, { year }) { getVehicleMakes(context, { year }) {
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetVehicleMakes.method, method: endpoints.GetVehicleMakes.method,
@ -1022,25 +1034,35 @@ export const actions = {
referralDate: order.referralDate, referralDate: order.referralDate,
referralNumber: order.referralNumber?.toString(), // TODO It'd be nice to save these as strings in the first place referralNumber: order.referralNumber?.toString(), // TODO It'd be nice to save these as strings in the first place
referralSequenceNumber: order.referralNumber?.toString(), // TODO Pass the referralSequence number once insurance flow creates it referralSequenceNumber: order.referralNumber?.toString(), // TODO Pass the referralSequence number once insurance flow creates it
eon: order.eon,
}, },
}, },
}); });
}, },
loadSession(context, { savedSessionId, referralNumber, referralCorrelationId, accountNumber }) { loadSession(
context,
{
savedSessionId,
referralNumber,
referralDate,
referralCorrelationId,
accountNumber,
isConceptInsurance,
}
) {
const order = context.state.order; const order = context.state.order;
return globalMethods return globalMethods
.callHttpClient({ .callHttpClient({
method: endpoints.LoadSession.method, method: endpoints.LoadSession.method,
endpoint: `${ endpoint: endpoints.LoadSession.url,
endpoints.LoadSession.url payload: {
}?savedSessionId=${savedSessionId?.toString()}&referralNumber=${ savedSessionId: savedSessionId?.toString(),
referralNumber && referralNumber !== "" ? referralNumber : order.referralNumber referralNumber: referralNumber?.toString(),
}&accountNumber=${accountNumber}&referralCorrelationId=${ referralDate: referralDate?.toString(),
referralCorrelationId !== "" accountNumber: accountNumber,
? referralCorrelationId referralCorrelationId: referralCorrelationId,
: order.referralCorrelationId },
}`,
}) })
.then((response) => { .then((response) => {
// Flatten location and name properties // Flatten location and name properties
@ -1379,6 +1401,9 @@ export const actions = {
savePaymentType(context, isInsurance) { savePaymentType(context, isInsurance) {
context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsurance); context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsurance);
}, },
saveAccountNumber(context, accountNumber) {
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, accountNumber);
},
saveSupportingItems(context, supportingItems) { saveSupportingItems(context, supportingItems) {
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems); context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
}, },
@ -1386,11 +1411,34 @@ export const actions = {
context.commit(storeMutations.UPDATE_VAPS, vaps); context.commit(storeMutations.UPDATE_VAPS, vaps);
}, },
// Price order actions // Price order actions
// PLACEHOLDER, WILL CHANGE WHEN PRICING END POINT IS IMPLEMENTED async priceOrderItems(context, availableLineItems) {
priceOrderItems(context, availableLineItems) { const availableLineItemsFormattedForRequest = availableLineItems
availableLineItems.forEach((lineItem) => { .map((lineItem) => `&LineItems=${lineItem.partNumber}`)
lineItem["price"] = parseFloat((Math.random() * 100).toFixed(2)); .join("");
const vehicle = context.getters.order.vehicle;
let queryString =
`ParentAccountNumber=${applicationConfig.CASH_ACCOUNT_NUMBER}` +
`&CTU=${context.getters.order.serviceLocation.zipCodeCtu}` +
`&CarId=${vehicle.carId}` +
`&Make=${vehicle.make}` +
`&Model=${vehicle.model}` +
`&Year=${vehicle.year}` +
`&EON=${context.getters.order.eon}` +
`&ZipCode=${context.getters.order.serviceLocation.zipCode}` +
`${availableLineItemsFormattedForRequest}`;
const lineItemServerData = context.getters.order.lineItems.serverData;
if (lineItemServerData) {
queryString += `&ServerData=${lineItemServerData}`;
}
const response = await globalMethods.callHttpClient({
method: endpoints.PriceOrderItems.method,
endpoint: `${endpoints.PriceOrderItems.url}?${queryString}`,
}); });
context.commit(storeMutations.UPDATE_LINE_ITEMS_SERVER_DATA, response.data.serverData);
availableLineItems = addPricesToLineItems(availableLineItems, response.data.lineItems);
return availableLineItems; return availableLineItems;
}, },
// Misc order actions // Misc order actions
@ -1540,3 +1588,15 @@ function convertGlassPieceNamingFromApi(glassArray) {
}); });
return glassArray; return glassArray;
} }
function addPricesToLineItems(lineItems, pricingLineItems) {
lineItems.forEach((lineItem) => {
let pricedLineItem = pricingLineItems.find(
(pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber
);
lineItem.laborAmount = pricedLineItem.laborAmount;
lineItem.sellingPrice = pricedLineItem.sellingPrice;
lineItem.kitPrice = pricedLineItem.kitPrice;
});
return lineItems;
}

View file

@ -55,9 +55,6 @@ export default {
this.isLoaderDisplayed = false; this.isLoaderDisplayed = false;
}, },
}, },
mounted() {
this.isLoaderDisplayed = false;
},
components: { components: {
loader, loader,
}, },

View file

@ -53,14 +53,6 @@ export default {
&:focus { &:focus {
box-shadow: 0 0 0 2.5px $blue; box-shadow: 0 0 0 2.5px $blue;
} }
&,
& + .form-check-label {
margin-top: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
} }
&:hover { &:hover {