Merge branch 'develop' into feature/CSR-1073

This commit is contained in:
Leah Schumann 2023-03-09 16:07:54 -05:00
commit bb8119785f
25 changed files with 241 additions and 215 deletions

View file

@ -9,7 +9,7 @@ const applicationConfig = {
APPLICATION_ABBREVIATION: "fmg", APPLICATION_ABBREVIATION: "fmg",
PAGE_QUERYSTRING: "fmgPage", PAGE_QUERYSTRING: "fmgPage",
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass",
CASH_ACCOUNT_NUMBER: 167132, CASH_PARENT_ACCOUNT_NUMBER: 167132,
}; };
export { applicationConfig }; export { applicationConfig };

View file

@ -68,7 +68,7 @@ const storeActions = {
SAVE_MOLDING_QUESTION_ANSWERS: "saveMoldingQuestionAnswers", SAVE_MOLDING_QUESTION_ANSWERS: "saveMoldingQuestionAnswers",
SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers", SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers",
SAVE_PAYMENT_TYPE: "savePaymentType", SAVE_PAYMENT_TYPE: "savePaymentType",
SAVE_ACCOUNT_NUMBER: "saveAccountNumber", SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber",
SAVE_SUPPORTING_ITEMS: "saveSupportingItems", SAVE_SUPPORTING_ITEMS: "saveSupportingItems",
SAVE_VAPS: "saveVaps", SAVE_VAPS: "saveVaps",
}; };

View file

@ -32,6 +32,7 @@ const tintMap = {
{ name: "gray tint", src: "Glass-NoShade-GrayTint.svg" }, { name: "gray tint", src: "Glass-NoShade-GrayTint.svg" },
{ name: "green tint", src: "Glass-NoShade-GreenTint.svg" }, { name: "green tint", src: "Glass-NoShade-GreenTint.svg" },
{ name: "gray tint privacy", src: "Glass-NoShade-GrayTint.svg" }, { name: "gray tint privacy", src: "Glass-NoShade-GrayTint.svg" },
{ name: "blue tint", src: "Glass-NoShade-BlueTint.svg" },
// No shade or tint // No shade or tint
{ name: "clear", src: "Glass-NoShade-NoTint.svg" }, { name: "clear", src: "Glass-NoShade-NoTint.svg" },

View file

@ -78,8 +78,9 @@ export default {
const validationResult = await this.form.validate(); const validationResult = await this.form.validate();
if (validationResult.valid) { if (validationResult.valid) {
this.$emit("footer-button-event"); this.$emit("footer-button-event");
} else {
this.resetButtonStyle();
} }
this.resetButtonStyle();
}, },
resetButtonStyle() { resetButtonStyle() {
this.$refs.buttonMain.resetButtonStyle(); this.$refs.buttonMain.resetButtonStyle();

View file

@ -350,7 +350,7 @@ describe("navigateToHeritageFunnel", () => {
const mockReferralNumber = "2"; const mockReferralNumber = "2";
const mockCorrelationId = "55"; const mockCorrelationId = "55";
const mockReferralDate = "2022"; const mockReferralDate = "2022";
const mockAccountNumber = "167132"; const mockParentAccountNumber = "167132";
const mockSavedSessionId = "xxx-xxx-xxx"; const mockSavedSessionId = "xxx-xxx-xxx";
const mockCrmCustomerId = "xxx-xxx-xxx"; const mockCrmCustomerId = "xxx-xxx-xxx";
@ -358,7 +358,7 @@ describe("navigateToHeritageFunnel", () => {
mockReferralNumber, mockReferralNumber,
mockCorrelationId, mockCorrelationId,
mockReferralDate, mockReferralDate,
mockAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId mockCrmCustomerId
); );
@ -395,7 +395,7 @@ describe("navigateToHeritageFunnel", () => {
const mockReferralNumber = "2"; const mockReferralNumber = "2";
const mockCorrelationId = "55"; const mockCorrelationId = "55";
const mockReferralDate = "2022"; const mockReferralDate = "2022";
const mockAccountNumber = "167132"; const mockParentAccountNumber = "167132";
const mockSavedSessionId = "xxx-xxx-xxx"; const mockSavedSessionId = "xxx-xxx-xxx";
const mockCrmCustomerId = "xxx-xxx-xxx"; const mockCrmCustomerId = "xxx-xxx-xxx";
@ -403,7 +403,7 @@ describe("navigateToHeritageFunnel", () => {
mockReferralNumber, mockReferralNumber,
mockCorrelationId, mockCorrelationId,
mockReferralDate, mockReferralDate,
mockAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId mockCrmCustomerId
); );

View file

@ -81,7 +81,7 @@ async function loadSession(
savedSessionId, savedSessionId,
referralNumber, referralNumber,
referralDate, referralDate,
accountNumber, parentAccountNumber,
referralCorrelationId, referralCorrelationId,
isConceptInsurance isConceptInsurance
) { ) {
@ -94,8 +94,8 @@ async function loadSession(
savedSessionId: savedSessionId?.toString(), savedSessionId: savedSessionId?.toString(),
referralNumber, referralNumber,
referralDate, referralDate,
accountNumber,
referralCorrelationId, referralCorrelationId,
parentAccountNumber,
isConceptInsurance, isConceptInsurance,
}, },
false false
@ -116,7 +116,7 @@ async function saveSessionHelper() {
referralNumber: savedSessionInfo.data.referralNumber?.toString(), referralNumber: savedSessionInfo.data.referralNumber?.toString(),
referralCorrelationId: savedSessionInfo.data.referralCorrelationId, referralCorrelationId: savedSessionInfo.data.referralCorrelationId,
referralDate: savedSessionInfo.data.referralDate, referralDate: savedSessionInfo.data.referralDate,
accountNumber: savedSessionInfo.data.accountNumber?.toString(), parentAccountNumber: savedSessionInfo.data.parentAccountNumber?.toString(),
savedSessionId: savedSessionInfo.data.savedSessionId, savedSessionId: savedSessionInfo.data.savedSessionId,
crmCustomerId: savedSessionInfo.data.crmCustomerId?.toString(), crmCustomerId: savedSessionInfo.data.crmCustomerId?.toString(),
eon: savedSessionInfo.data.eon, eon: savedSessionInfo.data.eon,

View file

@ -142,7 +142,7 @@ describe("saveSession", () => {
const mockReferralNumber = "2"; const mockReferralNumber = "2";
const mockCorrelationId = "55"; const mockCorrelationId = "55";
const mockReferralDate = "2022"; const mockReferralDate = "2022";
const mockAccountNumber = "167132"; const mockParentAccountNumber = "167132";
const mockSavedSessionId = "xxx-xxx-xxx"; const mockSavedSessionId = "xxx-xxx-xxx";
const mockCrmCustomerId = "xxx-xxx-xxx"; const mockCrmCustomerId = "xxx-xxx-xxx";
@ -150,7 +150,7 @@ describe("saveSession", () => {
mockReferralNumber, mockReferralNumber,
mockCorrelationId, mockCorrelationId,
mockReferralDate, mockReferralDate,
mockAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId mockCrmCustomerId
); );
@ -182,7 +182,7 @@ describe("saveSession", () => {
referralNumber: mockReferralNumber, referralNumber: mockReferralNumber,
referralDate: mockReferralDate, referralDate: mockReferralDate,
referralCorrelationId: mockCorrelationId, referralCorrelationId: mockCorrelationId,
accountNumber: mockAccountNumber, parentAccountNumber: mockParentAccountNumber,
savedSessionId: mockSavedSessionId, savedSessionId: mockSavedSessionId,
crmCustomerId: mockCrmCustomerId, crmCustomerId: mockCrmCustomerId,
}, },
@ -195,7 +195,7 @@ describe("saveSession", () => {
const mockReferralNumber = 1566818; const mockReferralNumber = 1566818;
const mockReferralDate = "2022-03-15T10:56:24.597"; const mockReferralDate = "2022-03-15T10:56:24.597";
const mockReferralCorrelationId = "404d2b04-f86e-45c3-b373-127b6217b060"; const mockReferralCorrelationId = "404d2b04-f86e-45c3-b373-127b6217b060";
const mockAccountNumber = "167132"; const mockParentAccountNumber = "167132";
const mockSavedSessionId = "xxx-xxx-xxx"; const mockSavedSessionId = "xxx-xxx-xxx";
const mockCrmCustomerId = "xxx-xxx-xxx"; const mockCrmCustomerId = "xxx-xxx-xxx";
@ -203,7 +203,7 @@ describe("saveSession", () => {
mockReferralNumber, mockReferralNumber,
mockReferralCorrelationId, mockReferralCorrelationId,
mockReferralDate, mockReferralDate,
mockAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId mockCrmCustomerId
); );

View file

@ -104,7 +104,7 @@ export function getMockOrderInfo(
mockReferralNumber, mockReferralNumber,
mockCorrelationId, mockCorrelationId,
mockReferralDate, mockReferralDate,
accountNumber = "0", parentAccountNumber = "0",
savedSessionId, savedSessionId,
crmCustomerId crmCustomerId
) { ) {
@ -112,7 +112,7 @@ export function getMockOrderInfo(
referralNumber: mockReferralNumber, referralNumber: mockReferralNumber,
referralCorrelationId: mockCorrelationId, referralCorrelationId: mockCorrelationId,
referralDate: mockReferralDate, referralDate: mockReferralDate,
accountNumber: accountNumber, parentAccountNumber: parentAccountNumber,
savedSessionId: savedSessionId, savedSessionId: savedSessionId,
crmCustomerId: crmCustomerId, crmCustomerId: crmCustomerId,
}; };

View file

@ -22,6 +22,7 @@
aria-live="polite"> aria-live="polite">
<div class="col"> <div class="col">
<textboxQuestion <textboxQuestion
customInputId="apartmentNumberOrBusinessName"
cmsWidgetName="ApartmentNumberOrBusinessNameQuestionWidget" cmsWidgetName="ApartmentNumberOrBusinessNameQuestionWidget"
v-model="addressModel.apartmentNumberOrBusinessName" v-model="addressModel.apartmentNumberOrBusinessName"
ref="apartmentNumberOrBusinessName" /> ref="apartmentNumberOrBusinessName" />
@ -32,6 +33,7 @@
<div class="row mb-4" v-show="showAddressFields" aria-live="polite"> <div class="row mb-4" v-show="showAddressFields" aria-live="polite">
<div class="col"> <div class="col">
<textboxQuestion <textboxQuestion
customInputId="city"
cmsWidgetName="CityQuestionWidget" cmsWidgetName="CityQuestionWidget"
v-model="addressModel.city" v-model="addressModel.city"
ref="city" ref="city"
@ -43,14 +45,17 @@
<div class="row mb-4" v-show="showAddressFields" aria-live="polite"> <div class="row mb-4" v-show="showAddressFields" aria-live="polite">
<div class="col"> <div class="col">
<dropdownQuestion <dropdownQuestion
customInputId="state"
cmsWidgetName="StateQuestionWidget" cmsWidgetName="StateQuestionWidget"
v-model="addressModel.state" v-model="addressModel.state"
ref="state" ref="state"
:options="stateOptions" :options="stateOptions"
initialValue="FL"
validationRules="state-required" /> validationRules="state-required" />
</div> </div>
<div class="col"> <div class="col">
<textboxQuestion <textboxQuestion
customInputId="zipCode"
cmsWidgetName="ZipQuestionWidget" cmsWidgetName="ZipQuestionWidget"
v-model="addressModel.zipCode" v-model="addressModel.zipCode"
ref="zipCode" ref="zipCode"

View file

@ -63,11 +63,11 @@ mockStoreActionResults[storeActions.GET_SUPPORTING_ITEMS] = Promise.resolve([
store.getters = { store.getters = {
order: { order: {
accountNumber: applicationConfig.CASH_ACCOUNT_NUMBER, payment: {
}, insuranceCoverage: {},
payment: { isInsurance: false,
insuranceCoverage: {}, parentAccountNumber: applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
isInsurance: false, },
}, },
}; };
@ -75,7 +75,9 @@ afterEach(() => {
// reset store after each test // reset store after each test
store.getters = { store.getters = {
order: { order: {
accountNumber: applicationConfig.CASH_ACCOUNT_NUMBER, payment: {
parentAccountNumber: applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
},
}, },
payment: { payment: {
insuranceCoverage: {}, insuranceCoverage: {},

View file

@ -184,13 +184,16 @@ export default {
); );
if (!this.isInsuranceSelected) { if (!this.isInsuranceSelected) {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_ACCOUNT_NUMBER, this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
applicationConfig.CASH_ACCOUNT_NUMBER, applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
false false
); );
} }
if (this.$store.getters.order.accountNumber != applicationConfig.CASH_ACCOUNT_NUMBER) { if (
this.$store.getters.order.payment.parentAccountNumber !=
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER
) {
this.supportingItems = this.filterOutFees(this.supportingItems); this.supportingItems = this.filterOutFees(this.supportingItems);
} }
if (this.pricedGlassParts.length > 0) { if (this.pricedGlassParts.length > 0) {

View file

@ -40,13 +40,6 @@
" "
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)" :data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
aria-label="Modal window" /> aria-label="Modal window" />
<!-- <textLink
linkType="text"
:text="getRouterLinkDisplayTextFromCopy(copy)"
href="#!"
data-bs-toggle="modal"
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
aria-label="Modal window" /> -->
</span> </span>
</template> </template>
</li> </li>

View file

@ -1,8 +1,13 @@
import { storeActions } from "@/constants/store-actions"; import { storeActions } from "@/constants/store-actions";
import baseMixin from "@/mixins/base-mixin.js"; import baseMixin from "@/mixins/base-mixin.js";
export async function getPricedMobileFeePart(serviceZipCode) { export async function getPricedMobileFeePart(
if (!serviceZipCode) { serviceZipCode,
serviceType,
parentAccountNumber,
billToAccountNumber
) {
if (!serviceZipCode || !serviceType || !parentAccountNumber) {
return Promise.resolve(null); return Promise.resolve(null);
} }
@ -11,7 +16,11 @@ export async function getPricedMobileFeePart(serviceZipCode) {
// Get the Mobile Fee Part // Get the Mobile Fee Part
const mobileFeePart = await baseMixin.methods.dispatchStoreAction( const mobileFeePart = await baseMixin.methods.dispatchStoreAction(
storeActions.GET_MOBILE_FEE_PART, storeActions.GET_MOBILE_FEE_PART,
null, {
serviceType: serviceType,
parentAccountNumber: parentAccountNumber,
billToAccountNumber: billToAccountNumber,
},
false false
); );
@ -21,7 +30,7 @@ export async function getPricedMobileFeePart(serviceZipCode) {
{ {
availableLineItems: [mobileFeePart.data], availableLineItems: [mobileFeePart.data],
serviceZipCode: serviceZipCode, serviceZipCode: serviceZipCode,
ctu: zipCodeData.zipCodeCtu, serviceZipCodeCtu: zipCodeData.zipCodeCtu,
}, },
false false
); );

View file

@ -48,10 +48,18 @@ describe("service-location-helper.js", () => {
it("Should return null if no service zip code is passed in", async () => { it("Should return null if no service zip code is passed in", async () => {
// Arrange // Arrange
const serviceZipCode = null; const serviceZipCode = null;
const serviceType = "Replace";
const parentAccountNumber = 167132;
const billToAccountNumber = 1234;
const expected = null; const expected = null;
// Act // Act
const result = await getPricedMobileFeePart(serviceZipCode); const result = await getPricedMobileFeePart(
serviceZipCode,
serviceType,
parentAccountNumber,
billToAccountNumber
);
// Assert // Assert
expect(result).toEqual(expected); expect(result).toEqual(expected);
@ -60,6 +68,10 @@ describe("service-location-helper.js", () => {
it("Should return the priced mobile fee part", async () => { it("Should return the priced mobile fee part", async () => {
// Arrange // Arrange
const serviceZipCode = "43235"; const serviceZipCode = "43235";
const serviceType = "Replace";
const parentAccountNumber = 167132;
const billToAccountNumber = 1234;
const expected = { const expected = {
partNumber: "MOBILE FEE", partNumber: "MOBILE FEE",
description: "MOBILE FEE", description: "MOBILE FEE",
@ -70,7 +82,12 @@ describe("service-location-helper.js", () => {
}; };
// Act // Act
const result = await getPricedMobileFeePart(serviceZipCode); const result = await getPricedMobileFeePart(
serviceZipCode,
serviceType,
parentAccountNumber,
billToAccountNumber
);
// Assert // Assert
expect(result).toEqual(expected); expect(result).toEqual(expected);

View file

@ -247,6 +247,7 @@ describe("mobile-location-modal-questions.vue", () => {
attachTo: document.body, attachTo: document.body,
}); });
wrapper.vm.$refs.MobileLocationModalWidget.closeModal = jest.fn(); wrapper.vm.$refs.MobileLocationModalWidget.closeModal = jest.fn();
wrapper.vm.resetModalButtonStyle = jest.fn();
// Act // Act
wrapper.vm.internalModel = newMobileLocationQuestions; wrapper.vm.internalModel = newMobileLocationQuestions;
@ -293,6 +294,7 @@ describe("mobile-location-modal-questions.vue", () => {
}); });
wrapper.vm.internalModel = newMobileLocationQuestions; wrapper.vm.internalModel = newMobileLocationQuestions;
wrapper.vm.resetModalButtonStyle = jest.fn();
// Act // Act
await wrapper.vm.setMobileLocation(); await wrapper.vm.setMobileLocation();
@ -300,40 +302,6 @@ describe("mobile-location-modal-questions.vue", () => {
// Assert // Assert
expect(wrapper.vm.displayInvalidZipAlert).toBe(true); expect(wrapper.vm.displayInvalidZipAlert).toBe(true);
}); });
it("Should clear the internal model when resetModel is called", async () => {
// Arrange
const mobileLocationQuestions = {
addressQuestions: {
streetAddress: "555 Some St",
apartmentNumberOrBusinessName: "Apt 1",
city: "Funkytown",
state: "OH",
zipCode: "55555",
},
isVehicleProtected: true,
serviceZipCode: "55555",
};
const { wrapper } = setupMocks({
mixins: [mockMixin],
props: {
modelValue: mobileLocationQuestions,
},
mountOptions: {
attachTo: document.body,
},
});
// Act
wrapper.vm.resetModel();
// Assert
expect(wrapper.vm.internalModel.addressQuestions.streetAddress).toEqual("");
expect(wrapper.vm.internalModel.addressQuestions.apartmentNumberOrBusinessName).toEqual("");
expect(wrapper.vm.internalModel.addressQuestions.city).toEqual("");
expect(wrapper.vm.internalModel.isVehicleProtected).toEqual(null);
});
}); });
function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) { function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) {

View file

@ -1,47 +1,51 @@
<template> <template>
<div class="text-center"> <transition name="fade" mode="out-in">
<label <div class="mobile-location-questions">
for="mobileLocationLinkPromptId" <div class="text-center">
:aria-label="mobileLocationLinkPromptText" <label
class="form-label fw-bold w-100 ps-4 pe-4 pt-4" for="mobileLocationLinkPromptId"
v-html="mobileLocationLinkPromptText"></label> :aria-label="mobileLocationLinkPromptText"
<div class="update-mobile-location-text-link"> class="form-label fw-bold w-100 ps-4 pe-4 pt-4"
<textLink v-html="mobileLocationLinkPromptText"></label>
ref="mobileLocationLink" <div class="update-mobile-location-text-link">
id="mobileLocationLinkPromptId" <textLink
linkType="text" ref="mobileLocationLink"
:text="mobileLocationLinkText" id="mobileLocationLinkPromptId"
href="#!" linkType="text"
@click-event="openModal" :text="mobileLocationLinkText"
aria-label="Modal window" /> href="#!"
@click-event="openModal"
aria-label="Modal window" />
</div>
<textBlock
:customText="mobileFeeText"
cmsWidgetName="MobileFeeDisclaimerWidget"
typeStyle="caption" />
</div>
<modal
:ref="modalName"
:headerText="modalHeaderText"
:footerButtonText="modalFooterText"
@footer-button-event="setMobileLocation">
<addressQuestions
ref="addressQuestions"
v-model="internalModel.addressQuestions"
captureApartmentNumberOrBusinessName="true" />
<vehicleProtectedQuestion
ref="vehicleProtectedQuestion"
v-model="internalModel.isVehicleProtected"
cmsWidgetName="VehicleProtectedQuestionWidget" />
<textBlock cmsWidgetName="WorkspaceRequirementsWidget" typeStyle="caption" />
<alert
ref="alertInvalidZip"
v-if="displayInvalidZipAlert"
class="my-4"
cmsWidgetName="AlertInvalidZipWidget"
alertClass="alert-danger"
v-bind:isDismissible="false" />
</modal>
</div> </div>
<textBlock </transition>
:customText="mobileFeeText"
cmsWidgetName="MobileFeeDisclaimerWidget"
typeStyle="caption" />
</div>
<modal
:ref="modalName"
:headerText="modalHeaderText"
:footerButtonText="modalFooterText"
@footer-button-event="setMobileLocation">
<addressQuestions
ref="addressQuestions"
v-model="internalModel.addressQuestions"
captureApartmentNumberOrBusinessName="true" />
<vehicleProtectedQuestion
ref="vehicleProtectedQuestion"
v-model="internalModel.isVehicleProtected"
cmsWidgetName="VehicleProtectedQuestionWidget" />
<textBlock cmsWidgetName="WorkspaceRequirementsWidget" typeStyle="caption" />
<alert
ref="alertInvalidZip"
v-if="displayInvalidZipAlert"
class="my-4"
cmsWidgetName="AlertInvalidZipWidget"
alertClass="alert-danger"
v-bind:isDismissible="false" />
</modal>
</template> </template>
<script> <script>
@ -54,7 +58,7 @@ import addressQuestions from "@/layouts/address-lookup/customer-questions/addres
import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question"; import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question";
// Helpers // Helpers
import { deepClone } from "@/helpers/object-cloning-helper"; import { deepClone } from "@/layouts/service-location/helpers/object-cloning-helper/object-cloning-helper";
export default { export default {
name: "mobile-location-modal-questions", name: "mobile-location-modal-questions",
@ -77,10 +81,12 @@ export default {
zipCode: "", zipCode: "",
}, },
isVehicleProtected: null, isVehicleProtected: null,
serviceZipCode: "",
mobileFeePart: null,
}), }),
}, },
mobileFeePart: {
type: Object,
default: () => ({}),
},
isZipServiceableMobile: Boolean, isZipServiceableMobile: Boolean,
isZipServiceableInShop: Boolean, isZipServiceableInShop: Boolean,
linkWidgetName: String, linkWidgetName: String,
@ -94,13 +100,13 @@ export default {
}, },
mobileLocationLinkText() { mobileLocationLinkText() {
if ( if (
this.addressModel.streetAddress !== null && this.addressModel.streetAddress &&
this.addressModel.streetAddress !== "" && this.addressModel.streetAddress !== "" &&
this.addressModel.city !== null && this.addressModel.city &&
this.addressModel.city !== "" && this.addressModel.city !== "" &&
this.addressModel.state !== null && this.addressModel.state &&
this.addressModel.state !== "" && this.addressModel.state !== "" &&
this.addressModel.zipCode !== null && this.addressModel.zipCode &&
this.addressModel.zipCode !== "" this.addressModel.zipCode !== ""
) { ) {
return `${this.addressModel.streetAddress}\n${this.addressModel.city}, ${this.addressModel.state} ${this.addressModel.zipCode}`; return `${this.addressModel.streetAddress}\n${this.addressModel.city}, ${this.addressModel.state} ${this.addressModel.zipCode}`;
@ -118,13 +124,14 @@ export default {
return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee); return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee);
}, },
mobileFee() { mobileFee() {
if (!this.modelValue.mobileFeePart) { if (!this.mobileFeePart) {
return 0; return 0;
} }
return ( return (
this.modelValue.mobileFeePart.laborAmount + this.mobileFeePart.laborAmount +
this.modelValue.mobileFeePart.sellingPrice + this.mobileFeePart.sellingPrice +
this.modelValue.mobileFeePart.kitPrice this.mobileFeePart.kitPrice
); );
}, },
modalFooterText() { modalFooterText() {
@ -143,23 +150,22 @@ export default {
closeModal() { closeModal() {
this.$refs[this.modalName].closeModal(); this.$refs[this.modalName].closeModal();
}, },
resetComponent() { resetComponent(updatedServiceZipCodeInfo) {
this.resetModel(); // Reset the validation form, setting the initial values
// for the state and zipCode to those that were entered
// Reset the validation form // on the service-zip-modal-question component
this.$refs[this.modalName].form.resetForm(); this.$refs[this.modalName].form.resetForm({
values: {
// Reinitialize the Address Auto Complete state: updatedServiceZipCodeInfo.state,
this.$refs.addressQuestions.setupAddressLookup(); zipCode: updatedServiceZipCodeInfo.zipCode,
},
});
}, },
resetModel() { resetModalButtonStyle() {
// Address this.$refs[this.modalName].resetButtonStyle();
this.internalModel.addressQuestions.streetAddress = ""; },
this.internalModel.addressQuestions.apartmentNumberOrBusinessName = ""; onAddressUpdated(updatedServiceZipCodeInfo) {
this.internalModel.addressQuestions.city = ""; this.resetComponent(updatedServiceZipCodeInfo);
// Is Vehicle Protected
this.internalModel.isVehicleProtected = null;
}, },
async setMobileLocation() { async setMobileLocation() {
// Validate the Zip Code // Validate the Zip Code
@ -169,6 +175,7 @@ export default {
if (!zipCodeData.isValid) { if (!zipCodeData.isValid) {
this.displayInvalidZipAlert = true; this.displayInvalidZipAlert = true;
this.resetModalButtonStyle();
} else { } else {
// Update the page level model // Update the page level model
this.$emit("update:modelValue", this.internalModel); this.$emit("update:modelValue", this.internalModel);
@ -180,6 +187,11 @@ export default {
modelValue: { modelValue: {
handler(newValue) { handler(newValue) {
this.internalModel = deepClone(newValue); this.internalModel = deepClone(newValue);
this.resetComponent({
state: newValue.state,
zipCode: newValue.zipCode,
});
}, },
deep: true, deep: true,
}, },

View file

@ -32,11 +32,14 @@ const mockGetPricedMobileFeePart = (mockServiceZipCode) => {
return Promise.resolve(mobileFeePart); return Promise.resolve(mobileFeePart);
}; };
jest.mock("@/helpers/service-location-helper", () => ({ jest.mock(
getPricedMobileFeePart: jest.fn((mockServiceZipCode) => { "@/layouts/service-location/helpers/service-location-helper/service-location-helper",
return mockGetPricedMobileFeePart(mockServiceZipCode); () => ({
}), getPricedMobileFeePart: jest.fn((mockServiceZipCode) => {
})); return mockGetPricedMobileFeePart(mockServiceZipCode);
}),
})
);
jest.mock("@/store", () => ({ jest.mock("@/store", () => ({
commit: jest.fn(), commit: jest.fn(),
@ -65,7 +68,6 @@ const mockMixin = {
if (zip === "43235" || zip === "55555") { if (zip === "43235" || zip === "55555") {
return Promise.resolve({ return Promise.resolve({
containsMilitaryBase: false, containsMilitaryBase: false,
isServiceable: true,
isValid: true, isValid: true,
state: "OH", state: "OH",
zipCodeCtu: "01820", zipCodeCtu: "01820",
@ -74,7 +76,6 @@ const mockMixin = {
return Promise.resolve({ return Promise.resolve({
containsMilitaryBase: false, containsMilitaryBase: false,
isServiceable: false,
isValid: false, isValid: false,
state: null, state: null,
zipCodeCtu: null, zipCodeCtu: null,
@ -109,6 +110,9 @@ const mockMixin = {
getTotalLineItemPrice: jest.fn((lineItem) => { getTotalLineItemPrice: jest.fn((lineItem) => {
return 49.99; return 49.99;
}), }),
onSubmit: jest.fn(),
onInvalidSubmit: jest.fn(),
}, },
}; };
@ -130,9 +134,11 @@ beforeEach(() => {
serviceLocation: { serviceLocation: {
zipCode: "43235", zipCode: "43235",
state: "OH", state: "OH",
isServiceable: true,
}, },
}, },
damage: {
isRepair: false,
},
payment: { payment: {
isInsurance: false, isInsurance: false,
}, },
@ -171,7 +177,7 @@ describe("service-location.vue", () => {
); );
// Assert // Assert
expect(wrapper.vm.mobileLocationQuestions.mobileFeePart).toStrictEqual(mobileFeePart); expect(wrapper.vm.mobileFeePart).toStrictEqual(mobileFeePart);
}); });
}); });
@ -220,13 +226,14 @@ describe("service-location.vue", () => {
describe("updating service zip", () => { describe("updating service zip", () => {
test("updates the page model after providing the service zip code", () => { test("updates the page model after providing the service zip code", () => {
// Arrange // Arrange
const { wrapper } = setupMocks({}); const { wrapper } = setupMocks({
mixins: [mockMixin],
});
wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn(); wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn();
const newServiceZipCodeQuestion = { const newServiceZipCodeQuestion = {
zipCode: "61606", zipCode: "61606",
state: "IL", state: "IL",
isServiceable: true,
}; };
const serviceZipCodeComponent = wrapper.findComponent({ const serviceZipCodeComponent = wrapper.findComponent({
@ -249,7 +256,6 @@ describe("service-location.vue", () => {
const newServiceZipCodeQuestion = { const newServiceZipCodeQuestion = {
zipCode: "61606", zipCode: "61606",
state: "IL", state: "IL",
isServiceable: true,
}; };
const mobileLocationQuestions = { const mobileLocationQuestions = {
@ -261,7 +267,6 @@ describe("service-location.vue", () => {
zipCode: "43054", zipCode: "43054",
}, },
isVehicleProtected: true, isVehicleProtected: true,
mobileFeePart: null,
}; };
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions; wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
@ -274,7 +279,6 @@ describe("service-location.vue", () => {
zipCode: "61606", zipCode: "61606",
}, },
isVehicleProtected: null, isVehicleProtected: null,
mobileFeePart: null,
}; };
const serviceZipCodeComponent = wrapper.findComponent({ const serviceZipCodeComponent = wrapper.findComponent({
@ -304,7 +308,6 @@ describe("service-location.vue", () => {
zipCode: "", zipCode: "",
}, },
isVehicleProtected: null, isVehicleProtected: null,
mobileFeePart: null,
}; };
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions; wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
@ -317,7 +320,6 @@ describe("service-location.vue", () => {
zipCode: "43054", zipCode: "43054",
}, },
isVehicleProtected: true, isVehicleProtected: true,
mobileFeePart: null,
}; };
const mobileLocationComponent = wrapper.findComponent({ const mobileLocationComponent = wrapper.findComponent({
@ -369,13 +371,11 @@ describe("service-location.vue", () => {
wrapper.vm.serviceZipCodeQuestion = { wrapper.vm.serviceZipCodeQuestion = {
zipCode: "61606", zipCode: "61606",
state: "IL", state: "IL",
isServiceable: true,
}; };
const newServiceZipCodeInfo = { const newServiceZipCodeInfo = {
state: "OH", state: "OH",
zipCode: "43081", zipCode: "43081",
isServiceable: true,
}; };
// Act // Act

View file

@ -7,8 +7,7 @@
<div class="fade-on-route-transition sub-container make-tall"> <div class="fade-on-route-transition sub-container make-tall">
<serviceZipModalQuestion <serviceZipModalQuestion
v-model="serviceZipCodeQuestion" v-model="serviceZipCodeQuestion"
@updated-service-zip-code="resetMobileLocation" ref="serviceZipCodeQuestion"
ref="serviceZipCodeQuestion"
linkWidgetName="ServiceZipLinkWidget" linkWidgetName="ServiceZipLinkWidget"
modalWidgetName="ServiceZipModalWidget" /> modalWidgetName="ServiceZipModalWidget" />
<serviceTypeQuestion <serviceTypeQuestion
@ -20,7 +19,8 @@
<mobileLocationModalQuestions <mobileLocationModalQuestions
v-if="selectedServiceType === 'Mobile'" v-if="selectedServiceType === 'Mobile'"
v-model="mobileLocationQuestions" v-model="mobileLocationQuestions"
ref="mobileLocationModalQuestions" :mobileFeePart="mobileFeePart"
ref="mobileLocationModalQuestions"
linkWidgetName="MobileLocationLinkWidget" linkWidgetName="MobileLocationLinkWidget"
modalWidgetName="MobileLocationModalWidget" /> modalWidgetName="MobileLocationModalWidget" />
<funnel-footer <funnel-footer
@ -48,7 +48,7 @@ import { Form } from "vee-validate";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper"; import { settleAllPromises } from "@/helpers/layout-helper";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
import { getPricedMobileFeePart } from "@/helpers/service-location-helper"; import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
import store from "@/store"; import store from "@/store";
export default { export default {
@ -60,7 +60,7 @@ export default {
city: this.getServiceCityFromStore(), city: this.getServiceCityFromStore(),
state: this.getServiceStateFromStore(), state: this.getServiceStateFromStore(),
zipCode: this.getServiceZipCodeFromStore(), zipCode: this.getServiceZipCodeFromStore(),
isServiceable: false, isVehicleProtected: null,
isZipServiceableMobile: null, isZipServiceableMobile: null,
isZipServiceableInShop: null, isZipServiceableInShop: null,
mobileFeePart: null, mobileFeePart: null,
@ -72,7 +72,16 @@ export default {
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
const serviceZipCode = store.getters.order.serviceLocation.zipCode; const serviceZipCode = store.getters.order.serviceLocation.zipCode;
const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode); const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace";
const parentAccountNumber = store.getters.payment.parentAccountNumber;
const billToAccountNumber = 0;
const mobileFeePartPromise = getPricedMobileFeePart(
serviceZipCode,
serviceType,
parentAccountNumber,
billToAccountNumber
);
// Settle promises and get results // Settle promises and get results
const promiseResultMap = [ const promiseResultMap = [
@ -100,19 +109,15 @@ export default {
return { return {
state: this.state, state: this.state,
zipCode: this.zipCode, zipCode: this.zipCode,
isServiceable: this.isServiceable,
}; };
}, },
set: function (newValue) { set: function (newValue) {
if (newValue.zipCode !== this.zipCode) { if (newValue.zipCode !== this.zipCode) {
this.resetMobileLocation(this.zipCode); this.resetMobileLocation(newValue);
} }
this.state = newValue.state; this.state = newValue.state;
this.zipCode = newValue.zipCode; this.zipCode = newValue.zipCode;
this.isServiceable = newValue.isServiceable;
console.log(this);
}, },
}, },
mobileLocationQuestions: { mobileLocationQuestions: {
@ -126,7 +131,6 @@ export default {
zipCode: this.zipCode, zipCode: this.zipCode,
}, },
isVehicleProtected: this.isVehicleProtected, isVehicleProtected: this.isVehicleProtected,
mobileFeePart: this.mobileFeePart,
}; };
}, },
set: function (newValue) { set: function (newValue) {
@ -137,7 +141,6 @@ export default {
this.state = newValue.addressQuestions.state; this.state = newValue.addressQuestions.state;
this.zipCode = newValue.addressQuestions.zipCode; this.zipCode = newValue.addressQuestions.zipCode;
this.isVehicleProtected = newValue.isVehicleProtected; this.isVehicleProtected = newValue.isVehicleProtected;
this.mobileFeePart = newValue.mobileFeePart;
}, },
}, },
}, },
@ -167,27 +170,28 @@ export default {
getServiceZipCodeFromStore() { getServiceZipCodeFromStore() {
return store.getters.order.serviceLocation.zipCode; return store.getters.order.serviceLocation.zipCode;
}, },
getIsServiceableFromStore() {
return store.getters.order.serviceLocation.isServiceable;
},
resetMobileFeePart(serviceZipCode) { resetMobileFeePart(serviceZipCode) {
getPricedMobileFeePart(serviceZipCode).then((pricedMobileFeePart) => { const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace";
const parentAccountNumber = store.getters.payment.parentAccountNumber;
const billToAccountNumber = 0;
getPricedMobileFeePart(
serviceZipCode,
serviceType,
parentAccountNumber,
billToAccountNumber
).then((pricedMobileFeePart) => {
this.mobileFeePart = pricedMobileFeePart; this.mobileFeePart = pricedMobileFeePart;
}); });
}, },
resetMobileLocation(updatedServiceZipCode) { resetMobileLocation(updatedServiceZipCode) {
if (!this.$refs.mobileLocationModalQuestions) {
return;
}
this.streetAddress = ""; this.streetAddress = "";
this.apartmentNumberOrBusinessName = ""; this.apartmentNumberOrBusinessName = "";
this.city = ""; this.city = "";
this.isVehicleProtected = null; this.isVehicleProtected = null;
this.$refs.mobileLocationModalQuestions.resetComponent(); this.resetMobileFeePart(updatedServiceZipCodeInfo.zipCode);
this.resetMobileFeePart(updatedServiceZipCode);
}, },
backButtonAction() { backButtonAction() {
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);

View file

@ -12,6 +12,7 @@ jest.mock("@/digital-components/textbox-question/textbox-question", () => ({
jest.mock("@/digital-components/modal/modal", () => ({ jest.mock("@/digital-components/modal/modal", () => ({
methods: { methods: {
closeModal: jest.fn(), closeModal: jest.fn(),
resetButtonStyle: jest.fn(),
}, },
})); }));
@ -44,7 +45,6 @@ const mockMixin = {
if (zip === "43235") { if (zip === "43235") {
return { return {
containsMilitaryBase: false, containsMilitaryBase: false,
isServiceable: true,
isValid: true, isValid: true,
state: "OH", state: "OH",
zipCodeCtu: "01820", zipCodeCtu: "01820",
@ -54,7 +54,6 @@ const mockMixin = {
if (zip === "61606") { if (zip === "61606") {
return { return {
containsMilitaryBase: false, containsMilitaryBase: false,
isServiceable: true,
isValid: true, isValid: true,
state: "IL", state: "IL",
zipCodeCtu: "01526", zipCodeCtu: "01526",
@ -63,7 +62,6 @@ const mockMixin = {
return { return {
containsMilitaryBase: false, containsMilitaryBase: false,
isServiceable: false,
isValid: false, isValid: false,
state: null, state: null,
zipCodeCtu: null, zipCodeCtu: null,
@ -77,7 +75,6 @@ describe("service-zip-modal-question.vue", () => {
let serviceZipCodeQuestion = { let serviceZipCodeQuestion = {
state: "", state: "",
zipCode: "", zipCode: "",
isServiceable: undefined,
}; };
// Arrange // Arrange
@ -100,7 +97,6 @@ describe("service-zip-modal-question.vue", () => {
let serviceZipCodeQuestion = { let serviceZipCodeQuestion = {
state: "OH", state: "OH",
zipCode: "43235", zipCode: "43235",
isServiceable: true,
}; };
const wrapper = mount(serviceZipModalQuestion, { const wrapper = mount(serviceZipModalQuestion, {
@ -122,7 +118,6 @@ describe("service-zip-modal-question.vue", () => {
let serviceZipCodeQuestion = { let serviceZipCodeQuestion = {
state: "IL", state: "IL",
zipCode: "61606", zipCode: "61606",
isServiceable: true,
}; };
const zip = "43235"; const zip = "43235";
@ -141,7 +136,7 @@ describe("service-zip-modal-question.vue", () => {
wrapper.vm.internalModel.zipCode = zip; wrapper.vm.internalModel.zipCode = zip;
await wrapper.vm.setZipCode(); await wrapper.vm.setZipCode();
let expectedEmit = [[{ isServiceable: true, state: "OH", zipCode: "43235" }]]; let expectedEmit = [[{ state: "OH", zipCode: "43235" }]];
// Assert // Assert
expect(wrapper.emitted("update:modelValue")).toEqual(expectedEmit); expect(wrapper.emitted("update:modelValue")).toEqual(expectedEmit);
@ -152,7 +147,6 @@ describe("service-zip-modal-question.vue", () => {
let serviceZipCodeQuestion = { let serviceZipCodeQuestion = {
state: "IL", state: "IL",
zipCode: "61606", zipCode: "61606",
isServiceable: true,
}; };
const zip = ""; const zip = "";
@ -180,7 +174,6 @@ describe("service-zip-modal-question.vue", () => {
let serviceZipCodeQuestion = { let serviceZipCodeQuestion = {
state: "IL", state: "IL",
zipCode: "61606", zipCode: "61606",
isServiceable: true,
}; };
const zip = "11111"; const zip = "11111";
@ -208,7 +201,6 @@ describe("service-zip-modal-question.vue", () => {
let serviceZipCodeQuestion = { let serviceZipCodeQuestion = {
state: "IL", state: "IL",
zipCode: "61606", zipCode: "61606",
isServiceable: true,
}; };
const zip = ""; const zip = "";
@ -237,7 +229,6 @@ describe("service-zip-modal-question.vue", () => {
let serviceZipCodeQuestion = { let serviceZipCodeQuestion = {
state: "IL", state: "IL",
zipCode: "61606", zipCode: "61606",
isServiceable: true,
}; };
const zip = "123"; const zip = "123";

View file

@ -54,7 +54,6 @@ export default {
default: () => ({ default: () => ({
state: "", state: "",
zipCode: "", zipCode: "",
isServiceable: null,
}), }),
}, },
linkWidgetName: String, linkWidgetName: String,
@ -104,7 +103,6 @@ export default {
return { return {
state: modelToCopy.state, state: modelToCopy.state,
zipCode: modelToCopy.zipCode, zipCode: modelToCopy.zipCode,
isServiceable: modelToCopy.isServiceable,
}; };
}, },
@ -116,6 +114,10 @@ export default {
this.$refs[this.modalName].closeModal(); this.$refs[this.modalName].closeModal();
}, },
resetModalButtonStyle() {
this.$refs[this.modalName].resetButtonStyle();
},
onInputIdAssigned(inputId) { onInputIdAssigned(inputId) {
this.serviceZipCodeTextInputId = inputId; this.serviceZipCodeTextInputId = inputId;
}, },
@ -134,13 +136,13 @@ export default {
this.resetAlerts(); this.resetAlerts();
const zipCodeData = await this.getZipCodeData(this.internalModel.zipCode); const zipCodeData = await this.getZipCodeData(this.internalModel.zipCode);
this.resetModalButtonStyle();
if (!zipCodeData.isValid) { if (!zipCodeData.isValid) {
this.displayInvalidZipAlert = true; this.displayInvalidZipAlert = true;
this.focusOnZipInput(); this.focusOnZipInput();
} else { } else {
this.internalModel.state = zipCodeData.state; this.internalModel.state = zipCodeData.state;
this.internalModel.isServiceable = zipCodeData.isServiceable;
// Update the page level model // Update the page level model
this.$emit("update:modelValue", this.internalModel); this.$emit("update:modelValue", this.internalModel);

View file

@ -67,11 +67,11 @@ const getDefaultState = () => {
isVerified: null, isVerified: null,
coverageStatus: null, coverageStatus: null,
}, },
parentAccountNumber: 0,
}, },
referralNumber: null, referralNumber: null,
referralDate: null, referralDate: null,
referralCorrelationId: null, referralCorrelationId: null,
accountNumber: 0,
eon: null, eon: null,
}, },
applicationUser: { applicationUser: {
@ -166,7 +166,7 @@ export const mutations = {
state.order.referralDate = referralDate; state.order.referralDate = referralDate;
}, },
updateParentAcctNumber(state, parentAcctNumber) { updateParentAcctNumber(state, parentAcctNumber) {
state.order.accountNumber = parentAcctNumber; state.order.payment.parentAccountNumber = parentAcctNumber;
}, },
updateEON(state, eon) { updateEON(state, eon) {
state.order.eon = eon; state.order.eon = eon;
@ -355,7 +355,8 @@ export const mutations = {
state.order.lineItems.supportingItems = sessionInformation.order.lineItems.supportingItems; state.order.lineItems.supportingItems = sessionInformation.order.lineItems.supportingItems;
state.order.lineItems.vaps = sessionInformation.order.lineItems.vaps; state.order.lineItems.vaps = sessionInformation.order.lineItems.vaps;
state.order.lineItems.serverData = sessionInformation.order.lineItems.serverData; state.order.lineItems.serverData = sessionInformation.order.lineItems.serverData;
state.order.accountNumber = sessionInformation.order.accountNumber; state.order.payment.parentAccountNumber =
sessionInformation.order.payment.parentAccountNumber;
state.order.providerNumber = sessionInformation.order.providerNumber; state.order.providerNumber = sessionInformation.order.providerNumber;
(state.order.serviceLocation.address = (state.order.serviceLocation.address =
sessionInformation.order.serviceLocation.streetAddress), sessionInformation.order.serviceLocation.streetAddress),
@ -425,7 +426,7 @@ export const getters = {
funnelServiceCity: state.order.serviceLocation.city, funnelServiceCity: state.order.serviceLocation.city,
funnelServiceState: state.order.serviceLocation.state, funnelServiceState: state.order.serviceLocation.state,
funnelServiceZipCode: state.order.serviceLocation.zipCode, funnelServiceZipCode: state.order.serviceLocation.zipCode,
funnelParentAccountNumber: state.order.accountNumber, funnelParentAccountNumber: state.order.payment.parentAccountNumber,
funnelIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified, funnelIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified,
funnelHasRecalibrationPart: getHasRecalibrationPart(state), funnelHasRecalibrationPart: getHasRecalibrationPart(state),
funnelSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1, funnelSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
@ -677,7 +678,7 @@ export const actions = {
referralDate, referralDate,
referralCorrelationId, referralCorrelationId,
eon, eon,
accountNumber, parentAccountNumber,
savedSessionId, savedSessionId,
crmCustomerId, crmCustomerId,
} }
@ -686,7 +687,7 @@ export const actions = {
context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate); context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId); context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId);
context.commit(storeMutations.UPDATE_EON, eon); context.commit(storeMutations.UPDATE_EON, eon);
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, accountNumber); context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber);
context.commit(storeMutations.UPDATE_SAVED_SESSION_ID, savedSessionId); context.commit(storeMutations.UPDATE_SAVED_SESSION_ID, savedSessionId);
context.commit(storeMutations.UPDATE_CRM_CUSTOMER_ID, crmCustomerId); context.commit(storeMutations.UPDATE_CRM_CUSTOMER_ID, crmCustomerId);
}, },
@ -933,7 +934,7 @@ export const actions = {
payload: { payload: {
carId: carId, carId: carId,
serviceType: isRepair ? "Repair" : "Replace", serviceType: isRepair ? "Repair" : "Replace",
parentAccountNumber: applicationConfig.CASH_ACCOUNT_NUMBER, parentAccountNumber: applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
parts: glassPartsArray, parts: glassPartsArray,
numberOfRepairChips: isRepair ? numberOfChips : 0, numberOfRepairChips: isRepair ? numberOfChips : 0,
}, },
@ -1029,8 +1030,8 @@ export const actions = {
isVerified: order.payment.insuranceCoverage.isVerified ?? false, isVerified: order.payment.insuranceCoverage.isVerified ?? false,
}, },
isInsurance: order.payment.isInsurance ?? false, isInsurance: order.payment.isInsurance ?? false,
parentAccountNumber: order.payment.parentAccountNumber,
}, },
accountNumber: order.accountNumber,
providerNumber: "", providerNumber: "",
serviceLocation: { serviceLocation: {
streetAddress: order.serviceLocation.address, streetAddress: order.serviceLocation.address,
@ -1055,8 +1056,8 @@ export const actions = {
savedSessionId, savedSessionId,
referralNumber, referralNumber,
referralDate, referralDate,
parentAccountNumber,
referralCorrelationId, referralCorrelationId,
accountNumber,
isConceptInsurance, isConceptInsurance,
} }
) { ) {
@ -1070,7 +1071,7 @@ export const actions = {
savedSessionId: savedSessionId?.toString(), savedSessionId: savedSessionId?.toString(),
referralNumber: referralNumber?.toString(), referralNumber: referralNumber?.toString(),
referralDate: referralDate?.toString(), referralDate: referralDate?.toString(),
accountNumber: accountNumber, parentAccountNumber: parentAccountNumber,
referralCorrelationId: referralCorrelationId, referralCorrelationId: referralCorrelationId,
}, },
}) })
@ -1420,8 +1421,8 @@ 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) { saveParentAccountNumber(context, parentAccountNumber) {
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, accountNumber); context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber);
}, },
saveSupportingItems(context, supportingItems) { saveSupportingItems(context, supportingItems) {
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems); context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
@ -1430,11 +1431,16 @@ export const actions = {
context.commit(storeMutations.UPDATE_VAPS, vaps); context.commit(storeMutations.UPDATE_VAPS, vaps);
}, },
// Price order actions // Price order actions
async priceOrderItemsAndSaveServerData(context, { availableLineItems, serviceZipCode, ctu }) { async priceOrderItemsAndSaveServerData(
context,
{ availableLineItems, serviceZipCode, serviceZipCodeCtu }
) {
const zipCodeToUse = serviceZipCode const zipCodeToUse = serviceZipCode
? serviceZipCode ? serviceZipCode
: context.getters.order.serviceLocation.zipCode; : context.getters.order.serviceLocation.zipCode;
const ctuToUse = ctu ? ctu : context.getters.order.serviceLocation.zipCodeCtu; const ctuToUse = serviceZipCodeCtu
? serviceZipCodeCtu
: context.getters.order.serviceLocation.zipCodeCtu;
const availableLineItemsFormattedForRequest = const availableLineItemsFormattedForRequest =
getLineItemQueryStringForPricing(availableLineItems); getLineItemQueryStringForPricing(availableLineItems);
@ -1442,7 +1448,7 @@ export const actions = {
const vehicle = context.getters.order.vehicle; const vehicle = context.getters.order.vehicle;
let queryString = let queryString =
`ParentAccountNumber=${applicationConfig.CASH_ACCOUNT_NUMBER}` + `ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` +
`&CTU=${ctuToUse}` + `&CTU=${ctuToUse}` +
`&CarId=${vehicle.carId}` + `&CarId=${vehicle.carId}` +
`&Make=${vehicle.make}` + `&Make=${vehicle.make}` +

View file

@ -235,9 +235,9 @@ describe("Mutations", () => {
isVerified: false, isVerified: false,
}, },
isInsurance: false, isInsurance: false,
parentAccountNumber: "123456789",
}, },
parts: [], parts: [],
accountNumber: "123456789",
insuranceInfo: {}, insuranceInfo: {},
serviceLocation: {}, serviceLocation: {},
customer: {}, customer: {},
@ -761,7 +761,7 @@ describe("Actions", () => {
referralNumber: "123", referralNumber: "123",
referralDate: new Date().toUTCString(), referralDate: new Date().toUTCString(),
referralCorrelationId: "xxx-xxx-xxx", referralCorrelationId: "xxx-xxx-xxx",
accountNumber: "167132", parentAccountNumber: "167132",
savedSessionId: "xxx-xxx-xxx", savedSessionId: "xxx-xxx-xxx",
crmCustomerId: "xxx-xxx-xxx", crmCustomerId: "xxx-xxx-xxx",
}); });

View file

@ -136,6 +136,18 @@ html {
} }
} }
} }
//Quote page radio button group
.package-main {
.package-wrapper {
.has-error {
input[type="radio"] {
+ .package-label {
border: 1px solid $red;
}
}
}
}
}
//Restore to default style if alert box is present //Restore to default style if alert box is present
.alertError { .alertError {
.has-error { .has-error {