commit
01af819aa1
3 changed files with 54 additions and 9 deletions
|
|
@ -28,3 +28,25 @@ export function coverageStatusValue(intCoverageStatus) {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export const coverageType = {
|
||||
NONE: "None",
|
||||
DEDUCTIBLE: "Deductible",
|
||||
ITAC: "Itac",
|
||||
NOCOMP: "NoComp",
|
||||
};
|
||||
|
||||
export function coverageTypeValue(intCoverageType) {
|
||||
switch (intCoverageType) {
|
||||
case 0:
|
||||
return coverageType.NONE;
|
||||
case 1:
|
||||
return coverageType.DEDUCTIBLE;
|
||||
case 2:
|
||||
return coverageType.ITAC;
|
||||
case 3:
|
||||
return coverageType.NOCOMP;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,12 @@ import {
|
|||
} from "@/helpers/promotions-helper";
|
||||
import { getDateDifferenceInDays } from "@/helpers/date-helper";
|
||||
import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations";
|
||||
import { coverageStatus, coverageStatusValue } from "@/constants/insurance";
|
||||
import {
|
||||
coverageStatus,
|
||||
coverageStatusValue,
|
||||
coverageType,
|
||||
coverageTypeValue,
|
||||
} from "@/constants/insurance";
|
||||
|
||||
// Export State
|
||||
const getDefaultState = () => {
|
||||
|
|
@ -104,6 +109,7 @@ const getDefaultState = () => {
|
|||
insuranceCoverage: {
|
||||
isVerified: null,
|
||||
coverageStatus: null,
|
||||
coverageType: null,
|
||||
coverageVerificationType: null,
|
||||
},
|
||||
parentAccountNumber: 0,
|
||||
|
|
@ -576,12 +582,18 @@ export const mutations = {
|
|||
|
||||
state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance;
|
||||
state.order.payment.insuranceCoverage.isVerified =
|
||||
sessionInformation?.order.payment.insuranceCoverage.isVerified;
|
||||
coverageStatusValue(sessionInformation?.order.insuranceCoverage.coverageStatus) ===
|
||||
coverageStatus.VERIFIED
|
||||
? true
|
||||
: false;
|
||||
state.order.payment.insuranceCoverage.coverageStatus = coverageStatusValue(
|
||||
sessionInformation?.order.payment.insuranceCoverage.coverageStatus
|
||||
sessionInformation?.order.insuranceCoverage.coverageStatus
|
||||
);
|
||||
state.order.payment.insuranceCoverage.coverageType = coverageTypeValue(
|
||||
sessionInformation?.order.insuranceCoverage.coverageType
|
||||
);
|
||||
state.order.payment.insuranceCoverage.coverageVerificationType =
|
||||
sessionInformation?.order.payment.insuranceCoverage.coverageVerificationType;
|
||||
sessionInformation?.order.insuranceCoverage.coverageVerificationType;
|
||||
|
||||
state.order.customer.emailAddress = sessionInformation.order.customer.emailAddress;
|
||||
state.order.customer.firstName = sessionInformation.order.customer.firstName;
|
||||
|
|
@ -608,11 +620,20 @@ export const mutations = {
|
|||
|
||||
state.order.policy.currentDeductible = sessionInformation.order.policy?.currentDeductible;
|
||||
state.order.policy.additionalAuthFlag = sessionInformation.order.policy?.additionalAuthFlag;
|
||||
state.order.policy.isItac = sessionInformation.order.policy?.isItac;
|
||||
state.order.policy.isItac =
|
||||
coverageTypeValue(sessionInformation?.order.insuranceCoverage.coverageType) ===
|
||||
coverageType.ITAC
|
||||
? true
|
||||
: false;
|
||||
state.order.policy.policyNumber = sessionInformation.order.policy?.policyNumber;
|
||||
state.order.policy.insuranceCompanyName =
|
||||
sessionInformation.order.policy?.insuranceCompanyName;
|
||||
state.order.policy.isNoComp = sessionInformation.order.policy?.noComprehensive;
|
||||
state.order.policy.isNoComp =
|
||||
coverageTypeValue(sessionInformation?.order.insuranceCoverage.coverageType) ===
|
||||
coverageType.NOCOMP
|
||||
? true
|
||||
: false;
|
||||
sessionInformation.order.policy?.noComprehensive;
|
||||
},
|
||||
updateExperiments(state, experiments) {
|
||||
state.applicationUser.experiments = experiments;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { storeActions } from "@/constants/store-actions";
|
|||
import { experimentTriggers } from "@/constants/experiments";
|
||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||
import { coverageStatus } from "../constants/insurance";
|
||||
|
||||
// Mock global method
|
||||
globalMethods.callHttpClient = jest.fn();
|
||||
|
|
@ -234,12 +235,13 @@ describe("Mutations", () => {
|
|||
glassParts: null,
|
||||
},
|
||||
payment: {
|
||||
insuranceCoverage: {
|
||||
isVerified: false,
|
||||
},
|
||||
isInsurance: false,
|
||||
parentAccountNumber: "123456789",
|
||||
},
|
||||
insuranceCoverage: {
|
||||
isVerified: false,
|
||||
coverageStatus: "Pending",
|
||||
},
|
||||
parts: [],
|
||||
insuranceInfo: {},
|
||||
serviceLocation: {},
|
||||
|
|
|
|||
Loading…
Reference in a new issue