Merge branch 'release/end-to-end-insurance' into feature/CSR-1072

This commit is contained in:
CarlNation 2024-02-07 05:47:13 -05:00
commit e6b4831770
10 changed files with 37 additions and 24 deletions

View file

@ -11,6 +11,7 @@ const applicationConfig = {
PAGE_QUERYSTRING: "fmgPage", PAGE_QUERYSTRING: "fmgPage",
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass",
CASH_PARENT_ACCOUNT_NUMBER: 167132, CASH_PARENT_ACCOUNT_NUMBER: 167132,
CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER: "87291",
MY_ACCOUNT: process.env.VUE_APP_MY_ACCOUNT, MY_ACCOUNT: process.env.VUE_APP_MY_ACCOUNT,
PIA_RESPONSE_URL: PIA_RESPONSE_URL:
location.protocol + location.protocol +

View file

@ -80,6 +80,7 @@ const storeActions = {
SAVE_PAYMENT_TYPE: "savePaymentType", SAVE_PAYMENT_TYPE: "savePaymentType",
SAVE_PAYMENT_METHOD_CHOICE: "savePaymentMethodChoice", SAVE_PAYMENT_METHOD_CHOICE: "savePaymentMethodChoice",
SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber", SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber",
SAVE_BILL_TO_ACCOUNT_NUMBER: "saveBillToAccountNumber",
SAVE_SUPPORTING_ITEMS: "saveSupportingItems", SAVE_SUPPORTING_ITEMS: "saveSupportingItems",
SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING: SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING:
"saveSupportingItemsSuppressingStateResetting", "saveSupportingItemsSuppressingStateResetting",

View file

@ -46,6 +46,7 @@ const storeMutations = {
UPDATE_REFERRAL_DATE: "updateReferralDate", UPDATE_REFERRAL_DATE: "updateReferralDate",
UPDATE_REFERRAL_CORRELATION_ID: "updateReferralCorrelationId", UPDATE_REFERRAL_CORRELATION_ID: "updateReferralCorrelationId",
UPDATE_PARENT_ACCT_NUMBER: "updateParentAcctNumber", UPDATE_PARENT_ACCT_NUMBER: "updateParentAcctNumber",
UPDATE_BILL_TO_ACCT_NUMBER: "updateBillToAcctNumber",
UPDATE_EON: "updateEON", UPDATE_EON: "updateEON",
UPDATE_IS_INSURANCE: "updateIsInsurance", UPDATE_IS_INSURANCE: "updateIsInsurance",
UPDATE_SAVED_SESSION_ID: "updateSavedSessionId", UPDATE_SAVED_SESSION_ID: "updateSavedSessionId",

View file

@ -244,7 +244,7 @@ export default {
const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
{ {
billToAccountNumber: "87291", billToAccountNumber: store.getters.payment.billToAccountNumber,
providerNumber: store.getters.order.serviceLocation.provider.providerNumber, providerNumber: store.getters.order.serviceLocation.provider.providerNumber,
appointmentType: store.getters.order.serviceLocation.appointmentType, appointmentType: store.getters.order.serviceLocation.appointmentType,
serviceLocationCity: store.getters.order.serviceLocation.city, serviceLocationCity: store.getters.order.serviceLocation.city,
@ -405,7 +405,7 @@ export default {
await baseMixin.methods.dispatchStoreActionWithLogging( await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
{ {
billToAccountNumber: "87291", billToAccountNumber: store.getters.payment.billToAccountNumber,
providerNumber: providerNumber:
this.$store.getters.order.serviceLocation.provider.providerNumber, this.$store.getters.order.serviceLocation.provider.providerNumber,
appointmentType: this.$store.getters.order.serviceLocation.appointmentType, appointmentType: this.$store.getters.order.serviceLocation.appointmentType,

View file

@ -255,14 +255,13 @@ export default {
this.availableVaps, this.availableVaps,
"payment-method" "payment-method"
); );
if (promoCodeData.isValid) { if (promoCodeData.isValid) {
const pricedLineItemsToTax = []; const pricedLineItemsToTax = [];
pricedLineItemsToTax.push(...promoCodeData.promoCode); pricedLineItemsToTax.push(...promoCodeData.promoCode);
const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
{ {
billToAccountNumber: "87291", billToAccountNumber: store.getters.payment.billToAccountNumber,
providerNumber: providerNumber:
store.getters.order.serviceLocation.provider.providerNumber, store.getters.order.serviceLocation.provider.providerNumber,
appointmentType: store.getters.order.serviceLocation.appointmentType, appointmentType: store.getters.order.serviceLocation.appointmentType,

View file

@ -356,7 +356,7 @@ export default {
const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging( const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
{ {
billToAccountNumber: "87291", billToAccountNumber: store.getters.payment.billToAccountNumber,
providerNumber: store.getters.order.serviceLocation.provider.providerNumber, providerNumber: store.getters.order.serviceLocation.provider.providerNumber,
appointmentType: store.getters.order.serviceLocation.appointmentType, appointmentType: store.getters.order.serviceLocation.appointmentType,
serviceLocationCity: store.getters.order.serviceLocation.city, serviceLocationCity: store.getters.order.serviceLocation.city,

View file

@ -276,6 +276,11 @@ export default {
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER, applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
false false
); );
this.dispatchStoreAction(
this.storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER,
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
false
);
} }
if ( if (

View file

@ -153,11 +153,11 @@ const MOBILE_FEE_PART_TYPE = "MOBILE FEE";
// DEFINE VALIDATION RULES // DEFINE VALIDATION RULES
defineRule("mobile-location-required", (value) => { defineRule("mobile-location-required", (value) => {
if ( if (
value.addressQuestions.streetAddress == "" || !value.addressQuestions.streetAddress ||
value.addressQuestions.city == "" || !value.addressQuestions.city ||
value.addressQuestions.state == "" || !value.addressQuestions.state ||
value.addressQuestions.zipCode == "" || !value.addressQuestions.zipCode ||
value.isVehicleProtected == null !value.isVehicleProtected
) { ) {
return errorMessages.MOBILE_LOCATION_REQUIRED; return errorMessages.MOBILE_LOCATION_REQUIRED;
} }

View file

@ -155,10 +155,9 @@ export default {
...(lineItems.vaps ?? []), ...(lineItems.vaps ?? []),
...(lineItems.promos ?? []), ...(lineItems.promos ?? []),
]; ];
const subtotal = baseMixin.methods.getTotalPriceOfAllLineItemsAndChildParts( const subtotal = baseMixin.methods
combinedLineItems, .getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false)
false .toFixed(2);
);
// // get correct zip code // // get correct zip code
const providerZip = order.serviceLocation.provider.address.zipCode; const providerZip = order.serviceLocation.provider.address.zipCode;
@ -168,26 +167,25 @@ export default {
: providerZip; : providerZip;
// // calculate total // // calculate total
const total = baseMixin.methods.getTotalPriceOfAllLineItemsAndChildParts( const total = baseMixin.methods
combinedLineItems, .getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, true)
true .toFixed(2);
);
const payload = { const payload = {
serviceZipCode: serviceZip, serviceZipCode: serviceZip,
damageType: order.damage.isRepair ? "repair" : "replace", damageType: order.damage.isRepair ? "repair" : "replace",
accountType: order.payment.isInsurance ? "insurance" : "cash", accountType: order.payment.isInsurance ? "insurance" : "cash",
promoCodes: promoString, promoCodes: promoString,
vehicleYear: order.vehicle.year, vehicleYear: `${order.vehicle.year}`,
vehicleMake: order.vehicle.make, vehicleMake: order.vehicle.make,
vehicleModel: order.vehicle.model, vehicleModel: order.vehicle.model,
vehicleStyle: order.vehicle.style, vehicleStyle: order.vehicle.style,
glassToReplace: glassString, glassToReplace: glassString,
workOrderId: order.workOrderId, workOrderId: parseInt(order.workOrderId),
providerCtu: order.serviceLocation.zipCodeCtu, providerCtu: parseInt(order.serviceLocation.zipCodeCtu),
orderNumber: order.workOrderNumber, orderNumber: order.workOrderNumber,
priceTotal: total, priceTotal: parseFloat(total),
priceSubTotal: subtotal, priceSubTotal: parseFloat(subtotal),
isRecalibrationOnOrder: store.getters.isRecalibrationOnSubmittedOrder, isRecalibrationOnOrder: store.getters.isRecalibrationOnSubmittedOrder,
appointmentType: order.serviceLocation.appointmentType, appointmentType: order.serviceLocation.appointmentType,
}; };

View file

@ -249,6 +249,9 @@ export const mutations = {
updateParentAcctNumber(state, parentAcctNumber) { updateParentAcctNumber(state, parentAcctNumber) {
state.order.payment.parentAccountNumber = parentAcctNumber; state.order.payment.parentAccountNumber = parentAcctNumber;
}, },
updateBillToAcctNumber(state, billToAcctNumber) {
state.order.payment.billToAccountNumber = billToAcctNumber;
},
updateEON(state, eon) { updateEON(state, eon) {
state.order.eon = eon; state.order.eon = eon;
}, },
@ -518,7 +521,7 @@ export const mutations = {
state.order.lineItems.glassParts = sessionInformation.order.lineItems.glassParts; state.order.lineItems.glassParts = sessionInformation.order.lineItems.glassParts;
state.order.lineItems.supportingItems = sessionInformation.order.lineItems.supportingItems; state.order.lineItems.supportingItems = sessionInformation.order.lineItems.supportingItems;
state.order.lineItems.vaps = sessionInformation.order.lineItems.vaps; state.order.lineItems.vaps = sessionInformation.order.lineItems.vaps ?? [];
state.order.lineItems.promos = sessionInformation.order.lineItems.promos; state.order.lineItems.promos = sessionInformation.order.lineItems.promos;
state.order.lineItems.serverData = sessionInformation.order.lineItems.serverData; state.order.lineItems.serverData = sessionInformation.order.lineItems.serverData;
@ -1489,6 +1492,7 @@ export const actions = {
lineItems: lineItems, lineItems: lineItems,
glassPieces: glassPieces, glassPieces: glassPieces,
eon: order.eon, eon: order.eon,
billToAccountNumber: context.getters.payment.billToAccountNumber,
coverage: { coverage: {
status: payment.insuranceCoverage.coverageStatus, status: payment.insuranceCoverage.coverageStatus,
deductible: order.policy.currentDeductible, deductible: order.policy.currentDeductible,
@ -1554,6 +1558,7 @@ export const actions = {
lineItems: lineItems, lineItems: lineItems,
glassPieces: glassPieces, glassPieces: glassPieces,
eon: order.eon, eon: order.eon,
billToAccountNumber: context.getters.payment.billToAccountNumber,
coverage: { coverage: {
status: payment.insuranceCoverage.coverageStatus, status: payment.insuranceCoverage.coverageStatus,
deductible: order.policy.currentDeductible, deductible: order.policy.currentDeductible,
@ -2128,6 +2133,9 @@ export const actions = {
saveParentAccountNumber(context, parentAccountNumber) { saveParentAccountNumber(context, parentAccountNumber) {
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber); context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber);
}, },
saveBillToAccountNumber(context, billToAccountNumber) {
context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber);
},
saveSupportingItems(context, supportingItems) { saveSupportingItems(context, supportingItems) {
if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) { if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) {