Merge branch 'develop' into feature/CSR-1977-ajc

This commit is contained in:
Adam Caouette 2024-03-18 11:38:40 -04:00
commit 636f8476af
8 changed files with 42 additions and 8 deletions

View file

@ -103,6 +103,7 @@
class="small mt-4" class="small mt-4"
v-model="lineItems" v-model="lineItems"
:addableVaps="availableVaps" :addableVaps="availableVaps"
:pageName="pageName"
modalWidgetName="PromoModalWidget" /> modalWidgetName="PromoModalWidget" />
</div> </div>
</div> </div>
@ -145,6 +146,7 @@ export default {
damage: Object, damage: Object,
servicePackageOptionsCmsName: String, servicePackageOptionsCmsName: String,
availableVaps: Object, availableVaps: Object,
pageName: String,
allowItemRemoval: Boolean, allowItemRemoval: Boolean,
recyclingModalCmsWidgetName: String, recyclingModalCmsWidgetName: String,
showAsPaid: Boolean, showAsPaid: Boolean,

View file

@ -129,6 +129,11 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo
heritageParms["forceEndToEndInsurance"] = true; heritageParms["forceEndToEndInsurance"] = true;
} }
// if they are going to heritage and already have a policy number then this is a nav back flow
if (store.getters.policy.policyNumber) {
heritageParms["insuranceNavBack"] = true;
}
router.navigateToExternalUrl(externalUrls.HERITAGE_FUNNEL, heritageParms); router.navigateToExternalUrl(externalUrls.HERITAGE_FUNNEL, heritageParms);
} }

View file

@ -166,6 +166,7 @@ async function saveSessionHelper(
customerPortalLoginToken: savedSessionInfo.data.customerPortalLoginToken, customerPortalLoginToken: savedSessionInfo.data.customerPortalLoginToken,
lockToken: savedSessionInfo.data.lockToken, lockToken: savedSessionInfo.data.lockToken,
settledTenderAmount: savedSessionInfo.data.settledTenderAmount, settledTenderAmount: savedSessionInfo.data.settledTenderAmount,
billToAccountNumber: savedSessionInfo.data.billToAccountNumber,
}, },
false false
); );

View file

@ -119,6 +119,7 @@ export default {
return { return {
searchableInsuranceCompanyList: [], searchableInsuranceCompanyList: [],
originalList: [], originalList: [],
selectedParentAccount: "",
}; };
}, },
methods: { methods: {
@ -142,8 +143,11 @@ export default {
// Go back to Quote page // Go back to Quote page
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
}, },
forwardButtonAction() { async forwardButtonAction() {
this.dispatchStoreAction( // await any pending save-sessions. if you don't, we will save the new parent account into vuex and then a pending async save-session response overwrites it
await store.getters.applicationUser.saveSessionPromise;
await this.dispatchStoreAction(
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
this.selectedParentAccount, this.selectedParentAccount,
false false
@ -156,12 +160,12 @@ export default {
}); });
}, },
selectParentAccountNumber(parentAccountName) { selectParentAccountNumber(parentAccountName) {
if (!this.insuranceCompanyList) { if (!this.searchableInsuranceCompanyList) {
console.error("No insurance companies found"); console.error("No insurance companies found");
return; return;
} }
var selectedItem = this.insuranceCompanyList.filter((item) => { var selectedItem = this.searchableInsuranceCompanyList.filter((item) => {
return item.accountName === parentAccountName; return item.accountName === parentAccountName;
}); });

View file

@ -26,6 +26,7 @@
:availableVaps="availableVaps" :availableVaps="availableVaps"
:allowItemRemoval="true" :allowItemRemoval="true"
v-model="lineItems" v-model="lineItems"
pageName="payment-method"
servicePackageOptionsCmsName="ServicePackageTitle" servicePackageOptionsCmsName="ServicePackageTitle"
recyclingModalCmsWidgetName="RecycleModal" /> recyclingModalCmsWidgetName="RecycleModal" />

View file

@ -29,6 +29,8 @@
<script> <script>
import { splitCopyOnCMSPlaceHolder } from "@/helpers/cms-content-helper"; import { splitCopyOnCMSPlaceHolder } from "@/helpers/cms-content-helper";
import baseMixin from "@/mixins/base-mixin.js"; import baseMixin from "@/mixins/base-mixin.js";
import { getPromosThatMatchLineItemsOnOrder } from "@/helpers/promotions-helper";
import { getArrayOfAllLineItems } from "@/store";
const INLINE_IMAGE_TOKEN = "custom:inlineImage"; const INLINE_IMAGE_TOKEN = "custom:inlineImage";
const AFTERPAY_PRICE_TOKEN = "custom:afterpayPrice"; const AFTERPAY_PRICE_TOKEN = "custom:afterpayPrice";
@ -50,7 +52,9 @@ export default {
name: "afterpay-modal-banner", name: "afterpay-modal-banner",
props: { props: {
cmsWidgetName: String, cmsWidgetName: String,
availableLineItems: Array,
lineItems: Array, lineItems: Array,
activePromos: null,
}, },
data() { data() {
return {}; return {};
@ -62,7 +66,7 @@ export default {
}, },
computed: { computed: {
nullSafeLineItems() { nullSafeLineItems() {
return this.lineItems ?? []; return this.availableLineItems ?? [];
}, },
imageUrl() { imageUrl() {
return this.getCmsContent(this.cmsWidgetName, "Image"); return this.getCmsContent(this.cmsWidgetName, "Image");
@ -77,10 +81,23 @@ export default {
return this.getCmsContent(this.cmsWidgetName, "SubheaderText"); return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
}, },
afterpayPrice() { afterpayPrice() {
const price = baseMixin.methods.getTierOnePackagePrice( let price = baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(this.nullSafeLineItems) baseMixin.methods.filterOutFees(this.nullSafeLineItems)
); );
let vapsLineItemsForSelectedPackage = this.lineItems.vaps;
vapsLineItemsForSelectedPackage.forEach((lineItem) => {
price += baseMixin.methods.getTotalLineItemPrice(lineItem);
});
if (this.activePromos) {
let allLineItems = getArrayOfAllLineItems(this.lineItems);
const promos = getPromosThatMatchLineItemsOnOrder(this.activePromos, allLineItems);
promos.forEach((promo) => {
price += baseMixin.methods.getTotalLineItemPrice(promo);
});
}
const adjusted = (price / 4).toFixed(2); const adjusted = (price / 4).toFixed(2);
return `$${adjusted}`; return `$${adjusted}`;

View file

@ -37,7 +37,9 @@
<afterpayModalBanner <afterpayModalBanner
v-if="!isInsuranceSelected" v-if="!isInsuranceSelected"
cmsWidgetName="AfterpayModalWidget" cmsWidgetName="AfterpayModalWidget"
:lineItems="availableLineItems" /> :activePromos="lineItems.promos"
:availableLineItems="availableLineItems"
:lineItems="lineItems" />
<promoModalQuestion <promoModalQuestion
class="small mt-4" class="small mt-4"

View file

@ -1069,6 +1069,7 @@ export const actions = {
customerPortalLoginToken, customerPortalLoginToken,
lockToken, lockToken,
settledTenderAmount, settledTenderAmount,
billToAccountNumber,
} }
) { ) {
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
@ -1084,6 +1085,7 @@ export const actions = {
context.commit(storeMutations.LOCK_TOKEN, lockToken); context.commit(storeMutations.LOCK_TOKEN, lockToken);
context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken); context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken);
context.commit(storeMutations.UPDATE_SETTLED_TENDER_AMOUNT, settledTenderAmount); context.commit(storeMutations.UPDATE_SETTLED_TENDER_AMOUNT, settledTenderAmount);
context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber);
}, },
logPageView( logPageView(
@ -2827,7 +2829,7 @@ export function mapTaxedLineItemsToStoreFormat(availableLineItems, storeLineItem
return lineItems; return lineItems;
} }
function getArrayOfAllLineItems(lineItems) { export function getArrayOfAllLineItems(lineItems) {
let consolidatedLineItemsArray = []; let consolidatedLineItemsArray = [];
if (lineItems.glassParts != null) if (lineItems.glassParts != null)