Merging from develop

This commit is contained in:
Leah Schumann 2024-05-28 09:37:32 -04:00
commit 77615bc69a
5 changed files with 33 additions and 2 deletions

View file

@ -91,6 +91,7 @@ const storeActions = {
SAVE_SERVICE_LOCATION_TECH_NOTES: "saveServiceLocationTechNotes", SAVE_SERVICE_LOCATION_TECH_NOTES: "saveServiceLocationTechNotes",
SAVE_CCTOKEN: "saveCCToken", SAVE_CCTOKEN: "saveCCToken",
SAVE_PAYPAL_TOKEN: "savePaypalToken", SAVE_PAYPAL_TOKEN: "savePaypalToken",
SAVE_NEXTGEN_SETTLED_AMOUNT: "saveNextGenSettledAmount",
CREATE_SUBMITTED_ORDER: "createSubmittedOrder", CREATE_SUBMITTED_ORDER: "createSubmittedOrder",
RESET_SUBMITTED_ORDER: "resetSubmittedOrder", RESET_SUBMITTED_ORDER: "resetSubmittedOrder",

View file

@ -2,6 +2,7 @@ const storeMutations = {
// PAYMENT MUTATIONS // PAYMENT MUTATIONS
UPDATE_CCTOKEN: "updateCCToken", UPDATE_CCTOKEN: "updateCCToken",
UPDATE_PAYPAL_TOKEN: "updatePaypalToken", UPDATE_PAYPAL_TOKEN: "updatePaypalToken",
UPDATE_NEXTGEN_SETTLED_AMOUNT: "updateNextGenSettledAmount",
// VEHICLE MUTATIONS // VEHICLE MUTATIONS
UPDATE_YEAR: "updateYear", UPDATE_YEAR: "updateYear",

View file

@ -527,7 +527,11 @@ export default {
? this.$store.getters.submittedOrder.policy.isNoComp ? this.$store.getters.submittedOrder.policy.isNoComp
: this.$store.getters.policy.isNoComp; : this.$store.getters.policy.isNoComp;
}, },
isItac() {
return this.hasSubmittedOrder()
? this.$store.getters.submittedOrder.policy.isItac
: this.$store.getters.policy.isItac;
},
hasVapsInCart() { hasVapsInCart() {
if (this.lineItems?.vaps?.length > 0) { if (this.lineItems?.vaps?.length > 0) {
return true; return true;
@ -536,7 +540,7 @@ export default {
}, },
showInsuranceCoverageAs() { showInsuranceCoverageAs() {
if (!this.isInsurance) return null; if (!this.isInsurance) return null;
if (this.isNoComp) { if (this.isNoComp || this.isItac) {
return coverageStatus.NOCOMP; return coverageStatus.NOCOMP;
} else { } else {
return this.hasSubmittedOrder() return this.hasSubmittedOrder()

View file

@ -72,7 +72,13 @@ export default {
async processPaypalResponse() { async processPaypalResponse() {
const token = getQuerystringParameter(queryStrings.TOKEN); const token = getQuerystringParameter(queryStrings.TOKEN);
const payerId = getQuerystringParameter(queryStrings.PAYERID); const payerId = getQuerystringParameter(queryStrings.PAYERID);
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_PAYPAL_TOKEN, token, false); baseMixin.methods.dispatchStoreAction(storeActions.SAVE_PAYPAL_TOKEN, token, false);
baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT,
this.getAmountDue(),
false
);
await this.saveAndSubmitWorkOrder(); await this.saveAndSubmitWorkOrder();
}, },
@ -122,10 +128,19 @@ export default {
transReferenceNumber: transReferenceNumber, transReferenceNumber: transReferenceNumber,
lastFour: lastFour, lastFour: lastFour,
}; };
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_CCTOKEN, ccToken, false); baseMixin.methods.dispatchStoreAction(storeActions.SAVE_CCTOKEN, ccToken, false);
baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT,
this.getAmountDue(),
false
);
await this.saveAndSubmitWorkOrder(); await this.saveAndSubmitWorkOrder();
} }
}, },
getAmountDue() {
return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
},
async saveAndSubmitWorkOrder() { async saveAndSubmitWorkOrder() {
// Final work order submit after returning from PIA. // Final work order submit after returning from PIA.
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);

View file

@ -112,6 +112,7 @@ const getDefaultState = () => {
piaType: null, piaType: null,
inactivePromos: null, inactivePromos: null,
paypalToken: null, paypalToken: null,
nextGenSettledAmount: 0,
ccToken: { ccToken: {
subscriptionId: null, subscriptionId: null,
expMonth: null, expMonth: null,
@ -304,6 +305,9 @@ export const mutations = {
updatePaypalToken(state, ppToken) { updatePaypalToken(state, ppToken) {
state.order.payment.paypalToken = ppToken; state.order.payment.paypalToken = ppToken;
}, },
updateNextGenSettledAmount(state, nextGenSettledAmount) {
state.order.payment.nextGenSettledAmount = nextGenSettledAmount;
},
updateInsuranceVerifiedStatus(state, isVerified) { updateInsuranceVerifiedStatus(state, isVerified) {
state.order.payment.insuranceCoverage.isVerified = isVerified; state.order.payment.insuranceCoverage.isVerified = isVerified;
}, },
@ -1729,6 +1733,7 @@ export const actions = {
isPaypal: order.payment.piaType == paymentMethods.PAYPAL ? true : false, isPaypal: order.payment.piaType == paymentMethods.PAYPAL ? true : false,
isAfterPay: order.payment.piaType == paymentMethods.AFTERPAY ? true : false, isAfterPay: order.payment.piaType == paymentMethods.AFTERPAY ? true : false,
paypalToken: order.payment.paypalToken, paypalToken: order.payment.paypalToken,
nextGenSettledAmount: order.payment.nextGenSettledAmount,
ccToken: { ccToken: {
subscriptionId: order.payment.ccToken.subscriptionId, subscriptionId: order.payment.ccToken.subscriptionId,
expMonth: order.payment.ccToken.expMonth, expMonth: order.payment.ccToken.expMonth,
@ -1861,6 +1866,11 @@ export const actions = {
saveCCToken(context, ccToken) { saveCCToken(context, ccToken) {
context.commit(storeMutations.UPDATE_CCTOKEN, ccToken); context.commit(storeMutations.UPDATE_CCTOKEN, ccToken);
}, },
saveNextGenSettledAmount(context, nextGenSettledAmount) {
context.commit(storeMutations.UPDATE_NEXTGEN_SETTLED_AMOUNT, nextGenSettledAmount);
},
savePaypalToken(context, ppToken) { savePaypalToken(context, ppToken) {
context.commit(storeMutations.UPDATE_PAYPAL_TOKEN, ppToken); context.commit(storeMutations.UPDATE_PAYPAL_TOKEN, ppToken);
}, },