Merge branch 'develop' into feature/jzimmerman/INSR-9277

This commit is contained in:
Jeremy-Z 2026-04-21 09:26:44 -04:00
commit 98b39a7c65
5 changed files with 41 additions and 6 deletions

View file

@ -0,0 +1,6 @@
const endorsementCodes_LibertyMutual = Object.freeze({
EDUCATOR: '001',
PARKING_GUARD: '003'
});
export default endorsementCodes_LibertyMutual;

View file

@ -1,4 +1,5 @@
import endorsementOptions from '@/constants/endorsement-options'; import endorsementOptions from '@/constants/endorsement-options';
import endorsementCodes_LibertyMutual from '@/constants/endorsement-codes';
export function noCoverageForSelectedVehicle(vehicle) { export function noCoverageForSelectedVehicle(vehicle) {
return (vehicle?.coverages?.length ?? 0) === 0; return (vehicle?.coverages?.length ?? 0) === 0;
@ -18,6 +19,20 @@ export function endorsementsForSelectedVehicle(vehicle) {
} }
return []; return [];
} }
export function endorsementCodesForSelectedVehicle(vehicle) {
if (!Array.isArray(vehicle?.endorsements) || vehicle.endorsements.length === 0) {
return '';
}
let codes = [];
if (vehicle.endorsements.includes(endorsementOptions.EDUCATOR)) {
codes.push(endorsementCodes_LibertyMutual.EDUCATOR);
}
if (vehicle.endorsements.includes(endorsementOptions.PARKING_GUARD)) {
codes.push(endorsementCodes_LibertyMutual.PARKING_GUARD);
}
return codes.join(',');
}
export function repairWaivedForSelectedVehicle(vehicle) { export function repairWaivedForSelectedVehicle(vehicle) {
return vehicle?.endorsements?.includes(endorsementOptions.REPAIR_WAIVED) ?? false; return vehicle?.endorsements?.includes(endorsementOptions.REPAIR_WAIVED) ?? false;
} }

View file

@ -125,7 +125,8 @@ describe('policy-vehicles.vue', () => {
noCoverage: true, noCoverage: true,
deductible: 0, deductible: 0,
repairWaived: false, repairWaived: false,
endorsements: [] endorsements: [],
cvrgEndorsementCode: ""
}; };
// Act // Act
@ -180,7 +181,8 @@ describe('policy-vehicles.vue', () => {
noCoverage: true, noCoverage: true,
deductible: 0, deductible: 0,
repairWaived: false, repairWaived: false,
endorsements endorsements,
cvrgEndorsementCode: "001"
}; };
// Act // Act
@ -233,7 +235,8 @@ describe('policy-vehicles.vue', () => {
noCoverage: true, noCoverage: true,
deductible: 0, deductible: 0,
repairWaived: false, repairWaived: false,
endorsements endorsements,
cvrgEndorsementCode: "003"
}; };
// Act // Act

View file

@ -55,6 +55,7 @@ import { useMainStore } from '@/store/index.js';
import { import {
deductibleForSelectedVehicle, deductibleForSelectedVehicle,
endorsementsForSelectedVehicle, endorsementsForSelectedVehicle,
endorsementCodesForSelectedVehicle,
noCoverageForSelectedVehicle, noCoverageForSelectedVehicle,
repairWaivedForSelectedVehicle repairWaivedForSelectedVehicle
} from '@/helpers/policy-vehicle-helper'; } from '@/helpers/policy-vehicle-helper';
@ -132,6 +133,9 @@ export default {
endorsementsForSelectedVehicle() { endorsementsForSelectedVehicle() {
return endorsementsForSelectedVehicle(this.selectedPolicyVehicle); return endorsementsForSelectedVehicle(this.selectedPolicyVehicle);
}, },
endorsementCodesForSelectedVehicle() {
return endorsementCodesForSelectedVehicle(this.selectedPolicyVehicle);
},
repairWaivedForSelectedVehicle() { repairWaivedForSelectedVehicle() {
return repairWaivedForSelectedVehicle(this.selectedPolicyVehicle); return repairWaivedForSelectedVehicle(this.selectedPolicyVehicle);
} }
@ -202,7 +206,8 @@ export default {
noCoverage: this.noCoverageForSelectedVehicle, noCoverage: this.noCoverageForSelectedVehicle,
deductible: this.deductibleForSelectedVehicle, deductible: this.deductibleForSelectedVehicle,
repairWaived: this.repairWaivedForSelectedVehicle, repairWaived: this.repairWaivedForSelectedVehicle,
endorsements: this.endorsementsForSelectedVehicle endorsements: this.endorsementsForSelectedVehicle,
cvrgEndorsementCode: this.endorsementCodesForSelectedVehicle
}); });
this.pushEventToGA("policy_vehicle", "submitted", useMainStore().order.vehicle.make + "_" + useMainStore().order.vehicle.model + " " + useMainStore().order.vehicle.carId, true); this.pushEventToGA("policy_vehicle", "submitted", useMainStore().order.vehicle.make + "_" + useMainStore().order.vehicle.model + " " + useMainStore().order.vehicle.carId, true);

View file

@ -4,6 +4,7 @@ import bailoutCode from '@/constants/bailoutCode';
import coverageStatuses from '@/constants/coverage-statuses'; import coverageStatuses from '@/constants/coverage-statuses';
import coverageType from '@/constants/coverage-type'; import coverageType from '@/constants/coverage-type';
import damageLocationsSelected from '@/constants/damage-locations-selected'; import damageLocationsSelected from '@/constants/damage-locations-selected';
import endorsementOptions from '@/constants/endorsement-options';
import endpoints from '@/constants/endpoints'; import endpoints from '@/constants/endpoints';
import { experimentSettings, experimentTriggers, experimentUniverses } from '@/constants/experiments'; import { experimentSettings, experimentTriggers, experimentUniverses } from '@/constants/experiments';
import partNumberStrings from '@/constants/part-number-strings'; import partNumberStrings from '@/constants/part-number-strings';
@ -17,7 +18,7 @@ import { convertDateStringToDate, getDateDifferenceInDays, militaryToTwelveHourT
import { getExperimentSettingValue, getFeatureTogglesPayloadObject } from '@/helpers/experiment-helper'; import { getExperimentSettingValue, getFeatureTogglesPayloadObject } from '@/helpers/experiment-helper';
import { findLineItemIndex, getLineItemsFlattened } from '@/helpers/line-items-helper'; import { findLineItemIndex, getLineItemsFlattened } from '@/helpers/line-items-helper';
import { import {
deductibleForSelectedVehicle, endorsementsForSelectedVehicle, deductibleForSelectedVehicle, endorsementsForSelectedVehicle, endorsementCodesForSelectedVehicle,
noCoverageForSelectedVehicle, noCoverageForSelectedVehicle,
repairWaivedForSelectedVehicle repairWaivedForSelectedVehicle
} from '@/helpers/policy-vehicle-helper'; } from '@/helpers/policy-vehicle-helper';
@ -109,6 +110,7 @@ export const getDefaultState = () => ({
vehicles: [], vehicles: [],
endorsements: [], endorsements: [],
endorsementQuestionAnswers: [], endorsementQuestionAnswers: [],
cvrgEndorsementCode: null,
status: null, status: null,
policyData: null, policyData: null,
policyLookupErrorCode: 0 policyLookupErrorCode: 0
@ -1479,7 +1481,9 @@ export const useMainStore = defineStore({
currentDeductible: this.currentDeductible, currentDeductible: this.currentDeductible,
OemEndorsement: this.hasOemEndorsement, OemEndorsement: this.hasOemEndorsement,
noCoverage: this.isNoComp, noCoverage: this.isNoComp,
isItac: this.isITAC isItac: this.isITAC,
cvrgEndorsementCode: policy.cvrgEndorsementCode ?? endorsementCodesForSelectedVehicle(vehicle),
endorsementQuestionAnswers: policy.endorsementQuestionAnswers
}, },
customer: { customer: {
address: { address: {
@ -2081,6 +2085,7 @@ export const useMainStore = defineStore({
this.order.policy.deductible.replace = coverage.deductible; this.order.policy.deductible.replace = coverage.deductible;
this.order.policy.deductible.repair = coverage?.repairWaived ?? false ? 0 : coverage.deductible; this.order.policy.deductible.repair = coverage?.repairWaived ?? false ? 0 : coverage.deductible;
this.order.policy.endorsements = coverage?.endorsements; this.order.policy.endorsements = coverage?.endorsements;
this.order.policy.cvrgEndorsementCode = coverage?.cvrgEndorsementCode;
this.order.originalDeductible.replace = this.order.policy.deductible.replace; this.order.originalDeductible.replace = this.order.policy.deductible.replace;
this.order.currentDeductible.replace = this.order.policy.deductible.replace; this.order.currentDeductible.replace = this.order.policy.deductible.replace;
@ -2122,6 +2127,7 @@ export const useMainStore = defineStore({
this.order.policy.vehicles = []; this.order.policy.vehicles = [];
this.order.policy.endorsements = []; this.order.policy.endorsements = [];
this.order.policy.endorsementQuestionAnswers = []; this.order.policy.endorsementQuestionAnswers = [];
this.order.policy.cvrgEndorsementCode = null;
this.order.policy.policyData = null; this.order.policy.policyData = null;
this.order.policy.policyLookupErrorCode = 0; this.order.policy.policyLookupErrorCode = 0;
this.order.policy.deductible.repair = null; this.order.policy.deductible.repair = null;