CASH-2025: add oem question and logic
This commit is contained in:
parent
c6e006020c
commit
e7e499ca46
1 changed files with 48 additions and 10 deletions
|
|
@ -93,6 +93,11 @@
|
|||
isInsuranceSelected ? isInsuranceContinueButtonText : ''
|
||||
" />
|
||||
|
||||
<oemGlassQuestion
|
||||
cmsWidgetName="OemGlassQuestionWidget"
|
||||
v-if="offerOem"
|
||||
v-model="isOemGlassSelected" />
|
||||
|
||||
<saveProgressModalQuestion
|
||||
modalWidgetName="SaveProgressModalWidget"
|
||||
modalName="SaveProgressModal"
|
||||
|
|
@ -136,6 +141,7 @@ import afterpayModalBanner from "@/layouts/quote/afterpay-modal-banner/afterpay-
|
|||
import recalDisclaimer from "@/layouts/quote/recal-disclaimer/recal-disclaimer.vue";
|
||||
import saveProgressModalQuestion from "@/fmg-components/save-progress-modal-question/save-progress-modal-question";
|
||||
import saveProgressPopupQuestion from "@/fmg-components/save-progress-popup-question/save-progress-popup-question";
|
||||
import oemGlassQuestion from "./oem-glass-question/oem-glass-question.vue";
|
||||
|
||||
// Supporting files
|
||||
import baseMixin from "@/mixins/base-mixin.js";
|
||||
|
|
@ -227,17 +233,16 @@ export default {
|
|||
);
|
||||
|
||||
// call API oem-after-market-parts method
|
||||
const offerOem = experimentMixin.methods.hasSettingEqualTo(
|
||||
experimentSettings.OFFER_OEM,
|
||||
"true"
|
||||
const experimentAllowsOfferOem = true;
|
||||
// const experimentAllowsOfferOem = experimentMixin.methods.hasSettingEqualTo(
|
||||
// experimentSettings.OFFER_OEM,
|
||||
// "true"
|
||||
// );
|
||||
const oemGlassCheckPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_OEM_AFTERMARKET_PARTS,
|
||||
null,
|
||||
"quote"
|
||||
);
|
||||
if (offerOem) {
|
||||
const oemAfterMarketParts = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_OEM_AFTERMARKET_PARTS,
|
||||
null,
|
||||
"quote"
|
||||
);
|
||||
}
|
||||
|
||||
const shouldExposeSkipQuote = store.getters.isRecalibrationOnOrder;
|
||||
const skipQuoteExperiment = store.getters.applicationUser.experiments.find(
|
||||
|
|
@ -311,6 +316,10 @@ export default {
|
|||
resultKey: "supportingItems",
|
||||
promise: supportingItemsPromise,
|
||||
},
|
||||
{
|
||||
resultKey: "oemGlassCheck",
|
||||
promise: oemGlassCheckPromise,
|
||||
},
|
||||
];
|
||||
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
|
@ -332,6 +341,24 @@ export default {
|
|||
lineItems.vaps = lineItems.vaps ?? [];
|
||||
const nullSafeGlassParts = lineItems.glassParts ?? [];
|
||||
|
||||
const oemGlassCheck = resultMap.oemGlassCheck;
|
||||
const offerOem = experimentAllowsOfferOem ? oemGlassCheck.offerOem : false;
|
||||
console.log("offerOem: ", offerOem);
|
||||
const oemGlassPieceParts = oemGlassCheck?.glassPieceParts;
|
||||
const oemGlassParts = oemGlassPieceParts ? oemGlassPieceParts[0].parts : null;
|
||||
|
||||
let alternateGlassPartsForOem;
|
||||
// if (oemGlassCheck.glassPieceParts[0].parts) {
|
||||
// // yes, it's a toyota or lexus
|
||||
// console.log("BRE yes, oem available: ", oemGlassCheck.glassPieceParts[0].parts)
|
||||
// alternateGlassPartsForOem = oemGlassCheck.glassPieceParts[0].parts;
|
||||
// }
|
||||
if (oemGlassParts) {
|
||||
// yes, it's a toyota or lexus
|
||||
alternateGlassPartsForOem = oemGlassParts;
|
||||
console.log("BRE yes, oem available: ", alternateGlassPartsForOem);
|
||||
}
|
||||
|
||||
const quotePageDiscountPartsInfo = getAvailableQuotePageDiscounts();
|
||||
|
||||
const quotePageDiscountParts = quotePageDiscountPartsInfo.map((partInfo) => ({
|
||||
|
|
@ -410,6 +437,8 @@ export default {
|
|||
vm.holdParentAccountNumber = holdParentAccountNumber;
|
||||
vm.holdBillToAccountNumber = holdBillToAccountNumber;
|
||||
vm.skipToInsurance = shouldSkipToInsurance;
|
||||
vm.offerOem = offerOem;
|
||||
vm.alternateGlassPartsForOem = alternateGlassPartsForOem; // oemParts
|
||||
|
||||
if (revalidatePromoResponse) {
|
||||
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
|
|
@ -577,6 +606,8 @@ export default {
|
|||
availableLineItems: null,
|
||||
lineItems: [],
|
||||
addableVaps: [],
|
||||
offerOem: null,
|
||||
alternateGlassPartsForOem: null,
|
||||
servicePackage: null,
|
||||
holdParentAccountNumber: null,
|
||||
holdBillToAccountNumber: null,
|
||||
|
|
@ -586,6 +617,7 @@ export default {
|
|||
packageNumber: null,
|
||||
skipToInsurance: null,
|
||||
servicePackageSelected: null,
|
||||
isOemGlassSelected: false,
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
|
|
@ -788,6 +820,11 @@ export default {
|
|||
},
|
||||
false
|
||||
);
|
||||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_IS_OEM_GLASS_SELECTED,
|
||||
this.isOemGlassSelected,
|
||||
false
|
||||
);
|
||||
|
||||
await savePageData(
|
||||
this.pageName,
|
||||
|
|
@ -922,6 +959,7 @@ export default {
|
|||
recalDisclaimer,
|
||||
saveProgressModalQuestion,
|
||||
saveProgressPopupQuestion,
|
||||
oemGlassQuestion,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue