Merge branch 'develop' into feature/CASH-286
This commit is contained in:
commit
7b8af8dbf6
12 changed files with 203 additions and 102 deletions
|
|
@ -361,13 +361,16 @@ export default {
|
||||||
if (!this.customerQuestions.emailOrSms) {
|
if (!this.customerQuestions.emailOrSms) {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (vinPagesMixin.methods.isPhoneNumber(this.customerQuestions.emailOrSms)) {
|
if (vinPagesMixin.methods.isPhoneNumber(this.customerQuestions.emailOrSms)) {
|
||||||
const phone = this.customerQuestions.emailOrSms.replace(/[()]/g, "");
|
const phone = this.customerQuestions.emailOrSms.replace(/[()]/g, "");
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||||
} else {
|
} else {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.customerQuestions.emailOrSms, false);
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_EMAIL,
|
||||||
|
this.customerQuestions.emailOrSms,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,14 @@
|
||||||
import { shallowMount } from '@vue/test-utils';
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import InsuranceCompany from '@/layouts/insurance-company/insurance-company.vue';
|
import InsuranceCompany from "@/layouts/insurance-company/insurance-company.vue";
|
||||||
import { applicationConfig } from '@/constants/application-config.js';
|
import { applicationConfig } from "@/constants/application-config.js";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
||||||
|
jest.mock("@/store", () => ({
|
||||||
jest.mock('@/store', () => ({
|
|
||||||
getters: {
|
getters: {
|
||||||
order: {
|
order: {
|
||||||
payment: {
|
payment: {
|
||||||
parentAccountNumber: '12345',
|
parentAccountNumber: "12345",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -19,32 +18,31 @@ var mockRouter = {
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
};
|
};
|
||||||
|
|
||||||
jest.mock('@/mixins/base-mixin.js', () => ({
|
jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
methods: {
|
methods: {
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
navigationScenarios: {
|
navigationScenarios: {
|
||||||
CLICKED_BACK: 'clicked_back',
|
CLICKED_BACK: "clicked_back",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe("insurance-company.vue", () => {
|
describe("insurance-company.vue", () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// Reset the store's parentAccountNumber before each test
|
// Reset the store's parentAccountNumber before each test
|
||||||
store.getters.order.payment.parentAccountNumber = '12345';
|
store.getters.order.payment.parentAccountNumber = "12345";
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should return true when parentAccountNumber matches CASH_PARENT_ACCOUNT_NUMBER', () => {
|
test("should return true when parentAccountNumber matches CASH_PARENT_ACCOUNT_NUMBER", () => {
|
||||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER = "12345";
|
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER = "12345";
|
||||||
const wrapper = shallowMount(InsuranceCompany, {
|
const wrapper = shallowMount(InsuranceCompany, {
|
||||||
global: {
|
global: {
|
||||||
mocks: {
|
mocks: {
|
||||||
$store: store
|
$store: store,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -52,9 +50,9 @@ describe("insurance-company.vue", () => {
|
||||||
expect(wrapper.vm.isCashParentAccountNumber()).toBe(true);
|
expect(wrapper.vm.isCashParentAccountNumber()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should return false when parentAccountNumber does not match CASH_PARENT_ACCOUNT_NUMBER', () => {
|
test("should return false when parentAccountNumber does not match CASH_PARENT_ACCOUNT_NUMBER", () => {
|
||||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER = "12345";
|
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER = "12345";
|
||||||
store.getters.order.payment.parentAccountNumber = '67890';
|
store.getters.order.payment.parentAccountNumber = "67890";
|
||||||
const wrapper = shallowMount(InsuranceCompany, {
|
const wrapper = shallowMount(InsuranceCompany, {
|
||||||
global: {
|
global: {
|
||||||
mocks: {
|
mocks: {
|
||||||
|
|
@ -66,7 +64,7 @@ describe("insurance-company.vue", () => {
|
||||||
expect(wrapper.vm.isCashParentAccountNumber()).toBe(false);
|
expect(wrapper.vm.isCashParentAccountNumber()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should call navigateWithoutSaving with { isCashSelected: true } when forceCashSelection is true', () => {
|
test("should call navigateWithoutSaving with { isCashSelected: true } when forceCashSelection is true", () => {
|
||||||
const wrapper = shallowMount(InsuranceCompany, {
|
const wrapper = shallowMount(InsuranceCompany, {
|
||||||
global: {
|
global: {
|
||||||
mocks: {
|
mocks: {
|
||||||
|
|
@ -77,7 +75,6 @@ describe("insurance-company.vue", () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
wrapper.vm.backButtonAction(true);
|
wrapper.vm.backButtonAction(true);
|
||||||
expect(mockRouter.navigateWithoutSaving).toHaveBeenCalledWith(
|
expect(mockRouter.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||||
wrapper.vm.navigationScenarios.CLICKED_BACK,
|
wrapper.vm.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
@ -86,7 +83,7 @@ describe("insurance-company.vue", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should call navigateWithoutSaving with no extra parameter when forceCashSelection is false', () => {
|
test("should call navigateWithoutSaving with no extra parameter when forceCashSelection is false", () => {
|
||||||
const wrapper = shallowMount(InsuranceCompany, {
|
const wrapper = shallowMount(InsuranceCompany, {
|
||||||
global: {
|
global: {
|
||||||
mocks: {
|
mocks: {
|
||||||
|
|
|
||||||
|
|
@ -315,8 +315,7 @@ export default {
|
||||||
if (!this.emailOrSms) {
|
if (!this.emailOrSms) {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,9 @@ jest.mock("@/mixins/base-mixin", () => ({
|
||||||
filterOutFees(items) {
|
filterOutFees(items) {
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
filterOutServicePackageDiscountPart(items) {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
isFormValid(form) {
|
isFormValid(form) {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -361,16 +361,28 @@ export default {
|
||||||
)
|
)
|
||||||
: baseMixin.methods.filterOutFees(availableLineItems);
|
: baseMixin.methods.filterOutFees(availableLineItems);
|
||||||
|
|
||||||
|
const lineItemsNoDiscount =
|
||||||
|
baseMixin.methods.filterOutServicePackageDiscountPart(
|
||||||
|
lineItemsForCalculatingPrice
|
||||||
|
);
|
||||||
|
|
||||||
if (isInsuranceFromQueryString != null) {
|
if (isInsuranceFromQueryString != null) {
|
||||||
if (isInsuranceFromQueryString.toLowerCase() === "true") {
|
if (isInsuranceFromQueryString.toLowerCase() === "true") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
const tierOnePrice =
|
||||||
baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) >
|
baseMixin.methods.getTierOnePackagePrice(lineItemsNoDiscount);
|
||||||
insuranceThreshold
|
// prettier-ignore
|
||||||
); // compare base price vs arbitrary threshold (representing insurance price)
|
{
|
||||||
|
if (store.getters.applicationUser.loggingOption) {
|
||||||
|
console.log(new Date() + " quote tierOnePrice comparison: " + tierOnePrice + " > " + insuranceThreshold + "=" + (tierOnePrice > insuranceThreshold));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// compare base price vs arbitrary threshold (representing insurance price)
|
||||||
|
return tierOnePrice > insuranceThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -397,6 +409,12 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isExternalParameter === externalParameterStatus.NOT_SET) {
|
if (isExternalParameter === externalParameterStatus.NOT_SET) {
|
||||||
|
// prettier-ignore
|
||||||
|
{
|
||||||
|
if (store.getters.applicationUser.loggingOption) {
|
||||||
|
console.log(new Date() + "quote.vue tab select EXTERNAL not set");
|
||||||
|
}
|
||||||
|
}
|
||||||
// there are no active or inactive external parameters; use internal threshold
|
// there are no active or inactive external parameters; use internal threshold
|
||||||
if (internalThreshold) thresholdToUse = internalThreshold;
|
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||||
|
|
||||||
|
|
@ -408,6 +426,13 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
// user came from an external source, however, the externalParms may have been reset on service-zip, property-questions, etc...
|
// user came from an external source, however, the externalParms may have been reset on service-zip, property-questions, etc...
|
||||||
if (getBoolFromString(store.getters.externalParameterQuote?.isInsurance)) {
|
if (getBoolFromString(store.getters.externalParameterQuote?.isInsurance)) {
|
||||||
|
// prettier-ignore
|
||||||
|
{
|
||||||
|
if (store.getters.applicationUser.loggingOption) {
|
||||||
|
console.log(new Date() + "quote.vue tab select EXTERNAL ISINSURANCE");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// did user intentionally select insurance?
|
// did user intentionally select insurance?
|
||||||
vm.isInsuranceSelected = true;
|
vm.isInsuranceSelected = true;
|
||||||
vm.servicePackage = store.getters.externalParameterQuote.servicePackage;
|
vm.servicePackage = store.getters.externalParameterQuote.servicePackage;
|
||||||
|
|
@ -427,6 +452,13 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
if (externalThreshold) thresholdToUse = externalThreshold;
|
if (externalThreshold) thresholdToUse = externalThreshold;
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
{
|
||||||
|
if (store.getters.applicationUser.loggingOption) {
|
||||||
|
console.log(new Date() + "quote.vue tab select NOT EXTERNAL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||||
vm.availableLineItems,
|
vm.availableLineItems,
|
||||||
thresholdToUse
|
thresholdToUse
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,11 @@ import { nextTick } from "vue";
|
||||||
jest.mock("@/store", () => ({
|
jest.mock("@/store", () => ({
|
||||||
commit: jest.fn(),
|
commit: jest.fn(),
|
||||||
dispatch: jest.fn(),
|
dispatch: jest.fn(),
|
||||||
|
getters: {
|
||||||
|
applicationUser: {
|
||||||
|
loggingOption: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const mockExperimentSettings = experimentSettings;
|
const mockExperimentSettings = experimentSettings;
|
||||||
|
|
@ -846,6 +851,7 @@ function setupMocks({ mountOptionsMockData, props = mockProps }) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
mountOptionsMockData = Object.assign(mountOptionsMockDataDefault, mountOptionsMockData);
|
mountOptionsMockData = Object.assign(mountOptionsMockDataDefault, mountOptionsMockData);
|
||||||
const mountOptions = getMountOptions(mountOptionsMockData);
|
const mountOptions = getMountOptions(mountOptionsMockData);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const zipCodeData = await baseMixin.methods.getZipCodeData(serviceZipCode, pageNameToLog);
|
const zipCodeData = await getZipCodeData(serviceZipCode);
|
||||||
|
|
||||||
// Get the Mobile Fee Part
|
// Get the Mobile Fee Part
|
||||||
const mobileFeePart = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const mobileFeePart = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
|
@ -103,3 +103,7 @@ export async function getAvailabilityRating(
|
||||||
|
|
||||||
return shopStatus;
|
return shopStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getZipCodeData(serviceZipCode) {
|
||||||
|
return await baseMixin.methods.getZipCodeData(serviceZipCode, "service-location");
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,15 @@ jest.mock(
|
||||||
getShopProviderData: jest.fn((mockServiceZipCode) => {
|
getShopProviderData: jest.fn((mockServiceZipCode) => {
|
||||||
return mockGetShopProviderData(mockServiceZipCode);
|
return mockGetShopProviderData(mockServiceZipCode);
|
||||||
}),
|
}),
|
||||||
|
getZipCodeData: jest.fn().mockImplementation(() => {
|
||||||
|
return Promise.resolve({
|
||||||
|
containsMilitaryBase: false,
|
||||||
|
isServiceable: true,
|
||||||
|
isValid: true,
|
||||||
|
state: "testState",
|
||||||
|
zipCodeCtu: "testCTU",
|
||||||
|
});
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -424,6 +433,7 @@ describe("service-location.vue", () => {
|
||||||
},
|
},
|
||||||
selectedAppointmentType: "Mobile",
|
selectedAppointmentType: "Mobile",
|
||||||
providerData: { mobileProviderNumber: "01820" },
|
providerData: { mobileProviderNumber: "01820" },
|
||||||
|
isGlassServiceableMobile: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
||||||
|
|
@ -459,6 +469,7 @@ describe("service-location.vue", () => {
|
||||||
isVehicleProtected: true,
|
isVehicleProtected: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
// Act
|
// Act
|
||||||
|
|
||||||
// Trigger the event
|
// Trigger the event
|
||||||
|
|
@ -483,6 +494,7 @@ describe("service-location.vue", () => {
|
||||||
},
|
},
|
||||||
selectedAppointmentType: "Mobile",
|
selectedAppointmentType: "Mobile",
|
||||||
providerData: { mobileProviderNumber: "01820" },
|
providerData: { mobileProviderNumber: "01820" },
|
||||||
|
isGlassServiceableMobile: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
||||||
|
|
@ -532,6 +544,7 @@ describe("service-location.vue", () => {
|
||||||
zipCodeCtu: "01526",
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
// Act
|
// Act
|
||||||
|
|
||||||
// Trigger the event
|
// Trigger the event
|
||||||
|
|
@ -563,6 +576,7 @@ describe("service-location.vue", () => {
|
||||||
});
|
});
|
||||||
mobileLocationQuestionsComponent.resetComponent = jest.fn();
|
mobileLocationQuestionsComponent.resetComponent = jest.fn();
|
||||||
wrapper.vm.forwardButtonAction = jest.fn();
|
wrapper.vm.forwardButtonAction = jest.fn();
|
||||||
|
wrapper.vm.isServiceableMobile = true;
|
||||||
|
|
||||||
const serviceZipCodeComponent = wrapper.findComponent({
|
const serviceZipCodeComponent = wrapper.findComponent({
|
||||||
ref: "serviceZipCodeQuestion",
|
ref: "serviceZipCodeQuestion",
|
||||||
|
|
@ -580,6 +594,7 @@ describe("service-location.vue", () => {
|
||||||
isVehicleProtected: "YesAnswer",
|
isVehicleProtected: "YesAnswer",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
// Act
|
// Act
|
||||||
mobileLocationQuestionsComponent.vm.$emit(
|
mobileLocationQuestionsComponent.vm.$emit(
|
||||||
"setMobileLocationAndProceed",
|
"setMobileLocationAndProceed",
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,7 @@ import {
|
||||||
getPricedMobileFeePart,
|
getPricedMobileFeePart,
|
||||||
getServiceabilityDetails,
|
getServiceabilityDetails,
|
||||||
getShopProviderData,
|
getShopProviderData,
|
||||||
|
getZipCodeData,
|
||||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
import { applicationConfig } from "@/constants/application-config";
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
|
|
@ -206,10 +207,7 @@ 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 zipCodeDataPromise = baseMixin.methods.getZipCodeData(
|
const zipCodeDataPromise = getZipCodeData(serviceZipCode);
|
||||||
serviceZipCode,
|
|
||||||
"service-location"
|
|
||||||
);
|
|
||||||
|
|
||||||
const serviceabilityDetailsPromise = getServiceabilityDetails(
|
const serviceabilityDetailsPromise = getServiceabilityDetails(
|
||||||
serviceZipCode,
|
serviceZipCode,
|
||||||
|
|
@ -475,17 +473,31 @@ export default {
|
||||||
},
|
},
|
||||||
//creating async function as the computed property can not directly handle asynchronous operations or promises.
|
//creating async function as the computed property can not directly handle asynchronous operations or promises.
|
||||||
async setMobileLocationQuestions(newValue) {
|
async setMobileLocationQuestions(newValue) {
|
||||||
if (newValue.addressQuestions.zipCode !== this.zipCode) {
|
var newZipCode = newValue.addressQuestions.zipCode;
|
||||||
await getShopProviderData(newValue.addressQuestions.zipCode).then((result) => {
|
if (newZipCode !== this.zipCode) {
|
||||||
|
await getShopProviderData(newZipCode).then((result) => {
|
||||||
|
if (this.isServiceableMobile) {
|
||||||
this.shopProviderData = result.data;
|
this.shopProviderData = result.data;
|
||||||
this.selectedProvider = new Provider(
|
this.selectedProvider = new Provider(
|
||||||
this.shopProviderData.mobileProviderNumber
|
this.shopProviderData.mobileProviderNumber
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (this.isServiceableMobile) {
|
||||||
this.setMobileLocation(newValue);
|
this.setMobileLocation(newValue);
|
||||||
//proceed to next page
|
//proceed to next page
|
||||||
this.forwardButtonAction();
|
this.forwardButtonAction();
|
||||||
|
} else {
|
||||||
|
this.closeModalAction("mobileLocationQuestions");
|
||||||
|
await getZipCodeData(newZipCode).then((zipCodeData) => {
|
||||||
|
this.serviceZipCodeQuestion = {
|
||||||
|
state: zipCodeData.state,
|
||||||
|
zipCode: newZipCode,
|
||||||
|
zipCodeCtu: zipCodeData.zipCodeCtu,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getServiceAddressFromStore() {
|
getServiceAddressFromStore() {
|
||||||
return store.getters.order.serviceLocation.address;
|
return store.getters.order.serviceLocation.address;
|
||||||
|
|
@ -669,6 +681,9 @@ export default {
|
||||||
openModalAction(modalName) {
|
openModalAction(modalName) {
|
||||||
this.$refs[modalName].openModal();
|
this.$refs[modalName].openModal();
|
||||||
},
|
},
|
||||||
|
closeModalAction(modalName) {
|
||||||
|
this.$refs[modalName].closeModal();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
zipCode: {
|
zipCode: {
|
||||||
|
|
|
||||||
|
|
@ -334,13 +334,20 @@ export default {
|
||||||
if (!this.emailOrSms) {
|
if (!this.emailOrSms) {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_PHONE_NUMBER,
|
||||||
|
phone,
|
||||||
|
false
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_EMAIL,
|
||||||
|
this.emailOrSms,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -391,13 +398,20 @@ export default {
|
||||||
if (!this.emailOrSms) {
|
if (!this.emailOrSms) {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_PHONE_NUMBER,
|
||||||
|
phone,
|
||||||
|
false
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_EMAIL,
|
||||||
|
this.emailOrSms,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,13 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice, false);
|
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice, false);
|
||||||
|
// prettier-ignore
|
||||||
|
{
|
||||||
|
if (store.getters.applicationUser.loggingOption) {
|
||||||
|
console.log(new Date() + " base-mixin getTierOnePackagePrice lineItemsToPrice: " + JSON.stringify(lineItemsToPrice));
|
||||||
|
console.log(new Date() + " base-mixin getTierOnePackagePrice totalPrice: " + totalPrice);
|
||||||
|
}
|
||||||
|
}
|
||||||
return totalPrice;
|
return totalPrice;
|
||||||
},
|
},
|
||||||
filterOutFees(lineItems) {
|
filterOutFees(lineItems) {
|
||||||
|
|
@ -103,6 +110,12 @@ export default {
|
||||||
});
|
});
|
||||||
return filteredLineItems;
|
return filteredLineItems;
|
||||||
},
|
},
|
||||||
|
filterOutServicePackageDiscountPart(lineItems) {
|
||||||
|
const filteredLineItems = lineItems?.filter((item) => {
|
||||||
|
return !item?.partType?.includes(partTypeStrings.SERVICE_PACKAGE_DISCOUNT);
|
||||||
|
});
|
||||||
|
return filteredLineItems;
|
||||||
|
},
|
||||||
filterOutRecalibration(lineItems) {
|
filterOutRecalibration(lineItems) {
|
||||||
return getItemsWithoutRecalParts(lineItems);
|
return getItemsWithoutRecalParts(lineItems);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue