WIP
This commit is contained in:
parent
dd35ef9ca2
commit
99f6ef3a4e
5 changed files with 39 additions and 26 deletions
|
|
@ -39,17 +39,3 @@ export async function getPricedMobileFeePart(
|
||||||
return Promise.resolve(pricingResults[0]);
|
return Promise.resolve(pricingResults[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetMobileFeePart(serviceZipCode) {
|
|
||||||
const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace";
|
|
||||||
const parentAccountNumber = store.getters.payment.parentAccountNumber;
|
|
||||||
const billToAccountNumber = 1;
|
|
||||||
|
|
||||||
getPricedMobileFeePart(
|
|
||||||
serviceZipCode,
|
|
||||||
serviceType,
|
|
||||||
parentAccountNumber,
|
|
||||||
billToAccountNumber
|
|
||||||
).then((pricedMobileFeePart) => {
|
|
||||||
this.mobileFeePart = pricedMobileFeePart;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,11 @@ import modal from "@/digital-components/modal/modal";
|
||||||
import alert from "@/ux-components/alert/alert";
|
import alert from "@/ux-components/alert/alert";
|
||||||
import addressQuestions from "@/layouts/address-lookup/customer-questions/address-questions/address-questions";
|
import addressQuestions from "@/layouts/address-lookup/customer-questions/address-questions/address-questions";
|
||||||
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";
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { deepClone } from "@/layouts/service-location/helpers/object-cloning-helper/object-cloning-helper";
|
import { deepClone } from "@/layouts/service-location/helpers/object-cloning-helper/object-cloning-helper";
|
||||||
|
import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "mobile-location-modal-questions",
|
name: "mobile-location-modal-questions",
|
||||||
|
|
@ -165,9 +167,6 @@ export default {
|
||||||
resetModalButtonStyle() {
|
resetModalButtonStyle() {
|
||||||
this.$refs[this.modalName].resetButtonStyle();
|
this.$refs[this.modalName].resetButtonStyle();
|
||||||
},
|
},
|
||||||
onAddressUpdated(updatedServiceZipCodeInfo) {
|
|
||||||
this.resetComponent(updatedServiceZipCodeInfo);
|
|
||||||
},
|
|
||||||
async setMobileLocation() {
|
async setMobileLocation() {
|
||||||
// Validate the Zip Code
|
// Validate the Zip Code
|
||||||
const zipCodeData = await this.getZipCodeData(
|
const zipCodeData = await this.getZipCodeData(
|
||||||
|
|
@ -178,6 +177,17 @@ export default {
|
||||||
this.displayInvalidZipAlert = true;
|
this.displayInvalidZipAlert = true;
|
||||||
this.resetModalButtonStyle();
|
this.resetModalButtonStyle();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// retrieve mobile fee part
|
||||||
|
const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace";
|
||||||
|
const parentAccountNumber = store.getters.payment.parentAccountNumber;
|
||||||
|
const billToAccountNumber = 1;
|
||||||
|
|
||||||
|
const mobileFeePart = await getPricedMobileFeePart(this.internalModel.addressQuestions.zipCode, serviceType, parentAccountNumber, billToAccountNumber);
|
||||||
|
|
||||||
|
// emit it to parent
|
||||||
|
this.$emit("set-mobile-fee-part", mobileFeePart);
|
||||||
|
|
||||||
// Update the page level model
|
// Update the page level model
|
||||||
this.$emit("update:modelValue", this.internalModel);
|
this.$emit("update:modelValue", this.internalModel);
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,14 @@
|
||||||
<serviceZipModalQuestion
|
<serviceZipModalQuestion
|
||||||
v-model="serviceZipCodeQuestion"
|
v-model="serviceZipCodeQuestion"
|
||||||
ref="serviceZipCodeQuestion"
|
ref="serviceZipCodeQuestion"
|
||||||
|
:mobileFeePart="mobileFeePart"
|
||||||
|
@set-mobile-fee-part="setMobileFeePart"
|
||||||
linkWidgetName="ServiceZipLinkWidget"
|
linkWidgetName="ServiceZipLinkWidget"
|
||||||
modalWidgetName="ServiceZipModalWidget" />
|
modalWidgetName="ServiceZipModalWidget" />
|
||||||
<mobileLocationModalQuestions
|
<mobileLocationModalQuestions
|
||||||
v-model="mobileLocationQuestions"
|
v-model="mobileLocationQuestions"
|
||||||
:mobileFeePart="mobileFeePart"
|
:mobileFeePart="mobileFeePart"
|
||||||
|
@set-mobile-fee-part="setMobileFeePart"
|
||||||
ref="mobileLocationModalQuestions"
|
ref="mobileLocationModalQuestions"
|
||||||
linkWidgetName="MobileLocationLinkWidget"
|
linkWidgetName="MobileLocationLinkWidget"
|
||||||
modalWidgetName="MobileLocationModalWidget" />
|
modalWidgetName="MobileLocationModalWidget" />
|
||||||
|
|
@ -37,10 +40,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 {
|
import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
getPricedMobileFeePart,
|
|
||||||
resetMobileFeePart,
|
|
||||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -104,7 +104,7 @@ export default {
|
||||||
},
|
},
|
||||||
set: function (newValue) {
|
set: function (newValue) {
|
||||||
if (newValue.zipCode !== this.zipCode) {
|
if (newValue.zipCode !== this.zipCode) {
|
||||||
this.resetMobileLocation(newValue);
|
this.resetMobileLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.state = newValue.state;
|
this.state = newValue.state;
|
||||||
|
|
@ -160,14 +160,15 @@ export default {
|
||||||
getServiceZipCodeFromStore() {
|
getServiceZipCodeFromStore() {
|
||||||
return store.getters.order.serviceLocation.zipCode;
|
return store.getters.order.serviceLocation.zipCode;
|
||||||
},
|
},
|
||||||
resetMobileLocation(updatedServiceZipCodeInfo) {
|
setMobileFeePart(mobileFeePart) {
|
||||||
|
this.mobileFeePart = mobileFeePart;
|
||||||
|
},
|
||||||
|
resetMobileLocation() {
|
||||||
this.streetAddress = "";
|
this.streetAddress = "";
|
||||||
this.apartmentNumberOrBusinessName = "";
|
this.apartmentNumberOrBusinessName = "";
|
||||||
this.city = "";
|
this.city = "";
|
||||||
|
|
||||||
this.isVehicleProtected = null;
|
this.isVehicleProtected = null;
|
||||||
|
|
||||||
this.resetMobileFeePart(updatedServiceZipCodeInfo.zipCode);
|
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ import textLink from "@/ux-components/text-link/text-link";
|
||||||
import serviceZipQuestion from "@/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question";
|
import serviceZipQuestion from "@/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question";
|
||||||
import modal from "@/digital-components/modal/modal";
|
import modal from "@/digital-components/modal/modal";
|
||||||
import alert from "@/ux-components/alert/alert";
|
import alert from "@/ux-components/alert/alert";
|
||||||
|
import store from "@/store";
|
||||||
|
import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "service-zip-modal-question",
|
name: "service-zip-modal-question",
|
||||||
|
|
@ -56,6 +58,10 @@ export default {
|
||||||
zipCode: "",
|
zipCode: "",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
mobileFeePart: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
linkWidgetName: String,
|
linkWidgetName: String,
|
||||||
modalWidgetName: String,
|
modalWidgetName: String,
|
||||||
},
|
},
|
||||||
|
|
@ -144,6 +150,16 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.internalModel.state = zipCodeData.state;
|
this.internalModel.state = zipCodeData.state;
|
||||||
|
|
||||||
|
// retrieve mobile fee part
|
||||||
|
const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace";
|
||||||
|
const parentAccountNumber = store.getters.payment.parentAccountNumber;
|
||||||
|
const billToAccountNumber = 1;
|
||||||
|
|
||||||
|
const mobileFeePart = await getPricedMobileFeePart(this.internalModel.zipCode, serviceType, parentAccountNumber, billToAccountNumber);
|
||||||
|
|
||||||
|
// emit it to parent
|
||||||
|
this.$emit("set-mobile-fee-part", mobileFeePart);
|
||||||
|
|
||||||
// Update the page level model
|
// Update the page level model
|
||||||
this.$emit("update:modelValue", this.internalModel);
|
this.$emit("update:modelValue", this.internalModel);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -918,7 +918,7 @@ export const actions = {
|
||||||
getMobileFeePart(context) {
|
getMobileFeePart(context) {
|
||||||
return globalMethods.callMockHttpClient({
|
return globalMethods.callMockHttpClient({
|
||||||
method: endpoints.GetMobileFeePart.method,
|
method: endpoints.GetMobileFeePart.method,
|
||||||
endpoint: "https://run.mocky.io/v3/795de4cb-d014-48b4-9338-dab33261adce", //TODO: Remove Mocky Endpoint
|
endpoint: "https://run.mocky.io/v3/795de4cb-d014-48b4-9338-dab33261adce?mocky-delay=3000ms", //TODO: Remove Mocky Endpoint
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue