serviceability details method
This commit is contained in:
parent
09ed0819ff
commit
8ab399e918
2 changed files with 12 additions and 31 deletions
|
|
@ -1,36 +1,7 @@
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
||||||
export async function getPricedMobileFeePart(serviceZipCode) {
|
|
||||||
if (!serviceZipCode) {
|
|
||||||
return Promise.resolve(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
const zipCodeData = await baseMixin.methods.getZipCodeData(serviceZipCode);
|
|
||||||
|
|
||||||
// Get the Mobile Fee Part
|
|
||||||
const mobileFeePart = await baseMixin.methods.dispatchStoreAction(
|
|
||||||
useMainStore.GET_MOBILE_FEE_PART,
|
|
||||||
null,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
// Get the Mobile Fee Part Price
|
|
||||||
const pricingResults = await baseMixin.methods.dispatchStoreAction(
|
|
||||||
useMainStore.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
|
||||||
{
|
|
||||||
availableLineItems: [mobileFeePart.data],
|
|
||||||
serviceZipCode: serviceZipCode,
|
|
||||||
serviceZipCodeCtu: zipCodeData.zipCodeCtu,
|
|
||||||
},
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
return Promise.resolve(pricingResults[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getServiceabilityDetails(serviceZipCode, lineItems) {
|
export async function getServiceabilityDetails(serviceZipCode, lineItems) {
|
||||||
// Get the Mobile Fee Part
|
|
||||||
const serviceabilityDetails = await baseMixin.methods.dispatchStoreAction(
|
const serviceabilityDetails = await baseMixin.methods.dispatchStoreAction(
|
||||||
useMainStore.GET_SERVICEABILITY_DETAILS,
|
useMainStore.GET_SERVICEABILITY_DETAILS,
|
||||||
{
|
{
|
||||||
|
|
@ -39,6 +10,5 @@ export async function getServiceabilityDetails(serviceZipCode, lineItems) {
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
return Promise.resolve(serviceabilityDetails);
|
return Promise.resolve(serviceabilityDetails);
|
||||||
}
|
}
|
||||||
|
|
@ -433,7 +433,18 @@ export const useMainStore = defineStore({
|
||||||
capabilityAnswerResults: capabilityQuestionAnswersForPart,
|
capabilityAnswerResults: capabilityQuestionAnswersForPart,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getServiceabilityDetails({ serviceZipCode }) {
|
||||||
|
const lineItems = this.order.lineItems;
|
||||||
|
const lineItemsToSend = [...lineItems.supportingItems];
|
||||||
|
const encodedLineItems = encodeURIComponent(JSON.stringify(lineItemsToSend));
|
||||||
|
return globalMethods.callHttpClient({
|
||||||
|
method: endpoints.GetServiceabilityDetails.method,
|
||||||
|
endpoint: `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&lineItems=${encodedLineItems}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
lookupVehicleByVin(vin) {
|
lookupVehicleByVin(vin) {
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.LookupVehicleByVin.method,
|
method: endpoints.LookupVehicleByVin.method,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue