CASH-2844 persisting fields for insurance-details
CASH-2844 persisting fields for insurance-details
This commit is contained in:
parent
3834b3730e
commit
f4e864ed0d
9 changed files with 211 additions and 80 deletions
|
|
@ -82,9 +82,6 @@ export function coverageTypeEnum(strCoverageType) {
|
||||||
export const parentAccountNumbers = {
|
export const parentAccountNumbers = {
|
||||||
CONNECT: "560636",
|
CONNECT: "560636",
|
||||||
};
|
};
|
||||||
export const NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS = [
|
|
||||||
{ name: "KentuckyFarmBureau", value: "223499" },
|
|
||||||
];
|
|
||||||
|
|
||||||
export const PARENT_ACCOUNT_NUMBERS = {
|
export const PARENT_ACCOUNT_NUMBERS = {
|
||||||
STATE_FARM: "711310",
|
STATE_FARM: "711310",
|
||||||
|
|
|
||||||
|
|
@ -52,3 +52,80 @@ const stateOptions = {
|
||||||
WY: "Wyoming",
|
WY: "Wyoming",
|
||||||
};
|
};
|
||||||
export { stateOptions };
|
export { stateOptions };
|
||||||
|
|
||||||
|
const stateOptionsInternational = {
|
||||||
|
AL: "Alabama",
|
||||||
|
AK: "Alaska",
|
||||||
|
AZ: "Arizona",
|
||||||
|
AR: "Arkansas",
|
||||||
|
CA: "California",
|
||||||
|
CO: "Colorado",
|
||||||
|
CT: "Connecticut",
|
||||||
|
DE: "Delaware",
|
||||||
|
DC: "District Of Columbia",
|
||||||
|
FL: "Florida",
|
||||||
|
GA: "Georgia",
|
||||||
|
GU: "Guam",
|
||||||
|
HI: "Hawaii",
|
||||||
|
ID: "Idaho",
|
||||||
|
IL: "Illinois",
|
||||||
|
IN: "Indiana",
|
||||||
|
IA: "Iowa",
|
||||||
|
KS: "Kansas",
|
||||||
|
KY: "Kentucky",
|
||||||
|
LA: "Louisiana",
|
||||||
|
ME: "Maine",
|
||||||
|
MD: "Maryland",
|
||||||
|
MA: "Massachusetts",
|
||||||
|
MI: "Michigan",
|
||||||
|
MN: "Minnesota",
|
||||||
|
MS: "Mississippi",
|
||||||
|
MO: "Missouri",
|
||||||
|
MT: "Montana",
|
||||||
|
NE: "Nebraska",
|
||||||
|
NV: "Nevada",
|
||||||
|
NH: "New Hampshire",
|
||||||
|
NJ: "New Jersey",
|
||||||
|
NM: "New Mexico",
|
||||||
|
NY: "New York",
|
||||||
|
NC: "North Carolina",
|
||||||
|
ND: "North Dakota",
|
||||||
|
OH: "Ohio",
|
||||||
|
OK: "Oklahoma",
|
||||||
|
OR: "Oregon",
|
||||||
|
PA: "Pennsylvania",
|
||||||
|
PR: "Puerto Rico",
|
||||||
|
RI: "Rhode Island",
|
||||||
|
SC: "South Carolina",
|
||||||
|
SD: "South Dakota",
|
||||||
|
TN: "Tennessee",
|
||||||
|
TX: "Texas",
|
||||||
|
UT: "Utah",
|
||||||
|
VT: "Vermont",
|
||||||
|
VA: "Virginia",
|
||||||
|
WA: "Washington",
|
||||||
|
WV: "West Virginia",
|
||||||
|
WI: "Wisconsin",
|
||||||
|
WY: "Wyoming",
|
||||||
|
AB: "Alberta",
|
||||||
|
BC: "British Columbia",
|
||||||
|
MB: "Manitoba",
|
||||||
|
NB: "New Brunswick",
|
||||||
|
NS: "Nova Scotia",
|
||||||
|
ON: "Ontario",
|
||||||
|
PE: "Prince Edward Island",
|
||||||
|
QC: "Quebec",
|
||||||
|
SK: "Saskatchewan",
|
||||||
|
YT: "Yukon",
|
||||||
|
CN: "Canada",
|
||||||
|
AE: "Military Address - AE",
|
||||||
|
AP: "Military Address - AP",
|
||||||
|
AA: "Military Address - AA",
|
||||||
|
AS: "American Samoa - AS",
|
||||||
|
MH: "Marshall Islands - MH",
|
||||||
|
MP: "Mariana Islands - MP",
|
||||||
|
NL: "Newfoundland and Labrador",
|
||||||
|
PW: "Palau",
|
||||||
|
VI: "Virgin Islands",
|
||||||
|
};
|
||||||
|
export { stateOptionsInternational };
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ export default {
|
||||||
// Format used for the v-model value emitted to parent
|
// Format used for the v-model value emitted to parent
|
||||||
modelType: {
|
modelType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "MM/dd/yyyy",
|
default: "yyyy-MM-dd",
|
||||||
},
|
},
|
||||||
enableTimePicker: {
|
enableTimePicker: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,9 @@ export function fetchCmsContentForPage(fmgPage) {
|
||||||
// Client-specific config pages are optional. When one doesn't exist
|
// Client-specific config pages are optional. When one doesn't exist
|
||||||
// the CMS returns a 404 - treat that as "no overrides" instead of an
|
// the CMS returns a 404 - treat that as "no overrides" instead of an
|
||||||
// error so callers receive an empty config object.
|
// error so callers receive an empty config object.
|
||||||
const isClientConfigPage = typeof fmgPage === "string" && fmgPage.startsWith("client_");
|
const isClientConfigPage =
|
||||||
|
typeof fmgPage === "string" &&
|
||||||
|
(fmgPage.startsWith("client_") || fmgPage.startsWith("unmanaged_"));
|
||||||
const status = error?.status ?? error?.response?.status;
|
const status = error?.status ?? error?.response?.status;
|
||||||
const isNotFound = status == 404;
|
const isNotFound = status == 404;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,17 +113,21 @@ export default {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
resultKey: "clientConfig",
|
|
||||||
promise: clientConfigPromise,
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Only fetch the client-specific config when this is a claim & coverage order.
|
||||||
|
if (store.getters.order?.payment?.isClaimAndCoverage) {
|
||||||
|
promiseResultMap.push({
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: fetchCmsContentForPage(clientConfigPageName),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
placeholderText="MM/DD/YYYY"
|
placeholderText="MM/DD/YYYY"
|
||||||
validationRules="date-of-loss-required"
|
validationRules="date-of-loss-required"
|
||||||
format="MM/dd/yyyy"
|
format="MM/dd/yyyy"
|
||||||
modelType="MM/dd/yyyy"
|
modelType="yyyy-MM-dd"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
:textInput="true"
|
:textInput="true"
|
||||||
|
|
@ -146,14 +146,11 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { stateOptions } from "@/constants/state-options";
|
import { stateOptionsInternational } from "@/constants/state-options";
|
||||||
import { regex } from "@/helpers/validation-rules";
|
import { regex } from "@/helpers/validation-rules";
|
||||||
import {
|
import { coverageStatus, coverageStatusEnum } from "@/constants/insurance";
|
||||||
NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS,
|
|
||||||
coverageStatus,
|
|
||||||
coverageStatusEnum,
|
|
||||||
} from "@/constants/insurance";
|
|
||||||
import saveProgressModalQuestion from "@/fmg-components/save-progress-modal-question/save-progress-modal-question";
|
import saveProgressModalQuestion from "@/fmg-components/save-progress-modal-question/save-progress-modal-question";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule(
|
defineRule(
|
||||||
|
|
@ -174,6 +171,7 @@ export default {
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
clientConfig: {},
|
||||||
insuranceCompanyName: this.getInsuranceCompanyNameFromStore(),
|
insuranceCompanyName: this.getInsuranceCompanyNameFromStore(),
|
||||||
policyNumber: this.getPolicyNumberFromStore(),
|
policyNumber: this.getPolicyNumberFromStore(),
|
||||||
dateOfLoss: this.getDateOfLossFromStore(),
|
dateOfLoss: this.getDateOfLossFromStore(),
|
||||||
|
|
@ -202,11 +200,17 @@ export default {
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
|
const clientConfigPageName = `unmanaged_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
const emailFromStore = store.getters.order.customer.emailAddress;
|
const emailFromStore = store.getters.order.customer.emailAddress;
|
||||||
|
|
@ -214,6 +218,14 @@ export default {
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.showSaveProgressModal = showSaveProgressModal;
|
vm.showSaveProgressModal = showSaveProgressModal;
|
||||||
|
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||||
|
// The load-session API can return damageCause in a different case than
|
||||||
|
// the CMS answer values. Reconcile it so the dropdown pre-selects.
|
||||||
|
vm.damageCause = vm.matchDamageCauseToOption(vm.damageCause);
|
||||||
|
debugLog(
|
||||||
|
`insurance-details clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -221,16 +233,21 @@ export default {
|
||||||
today() {
|
today() {
|
||||||
return new Date();
|
return new Date();
|
||||||
},
|
},
|
||||||
|
parsedClientConfig() {
|
||||||
|
const raw = this.clientConfig?.ConfigWidget?.Text;
|
||||||
|
if (!raw) return {};
|
||||||
|
try {
|
||||||
|
return JSON.parse(raw);
|
||||||
|
} catch (err) {
|
||||||
|
console.warn("Failed to parse clientConfig.ConfigWidget.Text", err);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
displayClaimNumber() {
|
displayClaimNumber() {
|
||||||
const order = store.getters.order;
|
return this.parsedClientConfig?.displayClaimNumberField ?? false;
|
||||||
|
|
||||||
const parent = NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS.find(
|
|
||||||
(item) => item.value === order.payment?.parentAccountNumber?.toString()
|
|
||||||
);
|
|
||||||
return !!parent;
|
|
||||||
},
|
},
|
||||||
stateOptions() {
|
stateOptions() {
|
||||||
return stateOptions;
|
return stateOptionsInternational;
|
||||||
},
|
},
|
||||||
damageCauseQuestionText() {
|
damageCauseQuestionText() {
|
||||||
return this.getCmsContent("DamageTypesWidget", "QuestionText");
|
return this.getCmsContent("DamageTypesWidget", "QuestionText");
|
||||||
|
|
@ -239,6 +256,9 @@ export default {
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
const answers = this.getCmsContent("DamageTypesWidget", "Answers");
|
const answers = this.getCmsContent("DamageTypesWidget", "Answers");
|
||||||
|
if (!Array.isArray(answers)) {
|
||||||
|
return options;
|
||||||
|
}
|
||||||
for (const answer of answers) {
|
for (const answer of answers) {
|
||||||
options[answer.Name] = answer.Text;
|
options[answer.Name] = answer.Text;
|
||||||
}
|
}
|
||||||
|
|
@ -259,23 +279,36 @@ export default {
|
||||||
getDamageCauseFromStore() {
|
getDamageCauseFromStore() {
|
||||||
return store.getters.order.damage.damageCause ?? "";
|
return store.getters.order.damage.damageCause ?? "";
|
||||||
},
|
},
|
||||||
|
// Maps a stored damageCause to the matching dropdown option value using a
|
||||||
|
// case-insensitive comparison (load-session can return it uppercased).
|
||||||
|
// Returns the canonical option value, or the original value if no match.
|
||||||
|
matchDamageCauseToOption(value) {
|
||||||
|
if (!value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
const optionValues = Object.values(this.damageTypesOptions ?? {});
|
||||||
|
const match = optionValues.find(
|
||||||
|
(option) => option?.toLowerCase() === value.toLowerCase()
|
||||||
|
);
|
||||||
|
return match ?? value;
|
||||||
|
},
|
||||||
getStreetAddressFromStore() {
|
getStreetAddressFromStore() {
|
||||||
return store.getters.order.policy.policyAddress.streetAddress ?? "";
|
return store.getters.order.customer.address.streetAddress ?? "";
|
||||||
},
|
},
|
||||||
getStreetAddress2FromStore() {
|
getStreetAddress2FromStore() {
|
||||||
return store.getters.order.policy.policyAddress.streetAddress2 ?? "";
|
return store.getters.order.customer.address.streetAddress2 ?? "";
|
||||||
},
|
},
|
||||||
getCityFromStore() {
|
getCityFromStore() {
|
||||||
return store.getters.order.policy.policyAddress.city ?? "";
|
return store.getters.order.customer.address.city ?? "";
|
||||||
},
|
},
|
||||||
getPolicyStateFromStore() {
|
getPolicyStateFromStore() {
|
||||||
return store.getters.order.policy.policyAddress.state ?? "";
|
return store.getters.order.customer.address.state ?? "";
|
||||||
},
|
},
|
||||||
getPolicyZipFromStore() {
|
getPolicyZipFromStore() {
|
||||||
return store.getters.order.policy.policyAddress.zipCode ?? "";
|
return store.getters.order.customer.address.zipCode ?? "";
|
||||||
},
|
},
|
||||||
getClaimNumberFromStore() {
|
getClaimNumberFromStore() {
|
||||||
return store.getters.order.policy.claimNumber ?? "";
|
return store.getters.order.payment.insuranceCoverage.claimNumber ?? "";
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
placeholderText="MM/DD/YYYY"
|
placeholderText="MM/DD/YYYY"
|
||||||
validationRules="date-of-birth-required"
|
validationRules="date-of-birth-required"
|
||||||
format="MM/dd/yyyy"
|
format="MM/dd/yyyy"
|
||||||
modelType="MM/dd/yyyy"
|
modelType="yyyy-MM-dd"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
:textInput="true"
|
:textInput="true"
|
||||||
:maxDate="today"
|
:maxDate="today"
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
placeholderText="MM/DD/YYYY"
|
placeholderText="MM/DD/YYYY"
|
||||||
validationRules="date-of-loss-required"
|
validationRules="date-of-loss-required"
|
||||||
format="MM/dd/yyyy"
|
format="MM/dd/yyyy"
|
||||||
modelType="MM/dd/yyyy"
|
modelType="yyyy-MM-dd"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
:textInput="true"
|
:textInput="true"
|
||||||
:maxDate="today"
|
:maxDate="today"
|
||||||
|
|
@ -314,6 +314,9 @@ export default {
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
const answers = this.getCmsContent("DamageTypesWidget", "Answers");
|
const answers = this.getCmsContent("DamageTypesWidget", "Answers");
|
||||||
|
if (!Array.isArray(answers)) {
|
||||||
|
return options;
|
||||||
|
}
|
||||||
for (const answer of answers) {
|
for (const answer of answers) {
|
||||||
options[answer.Name] = answer.Text;
|
options[answer.Name] = answer.Text;
|
||||||
}
|
}
|
||||||
|
|
@ -411,6 +414,9 @@ export default {
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||||
|
// The load-session API can return damageCause in a different case than
|
||||||
|
// the CMS answer values. Reconcile it so the dropdown pre-selects.
|
||||||
|
vm.damageCause = vm.matchDamageCauseToOption(vm.damageCause);
|
||||||
debugLog(
|
debugLog(
|
||||||
`policy-infoclientConfig::${clientConfigPageName}`,
|
`policy-infoclientConfig::${clientConfigPageName}`,
|
||||||
JSON.stringify(vm.clientConfig)
|
JSON.stringify(vm.clientConfig)
|
||||||
|
|
@ -437,6 +443,19 @@ export default {
|
||||||
getDamageCauseFromStore() {
|
getDamageCauseFromStore() {
|
||||||
return store.getters.order.damage.damageCause;
|
return store.getters.order.damage.damageCause;
|
||||||
},
|
},
|
||||||
|
// Maps a stored damageCause to the matching dropdown option value using a
|
||||||
|
// case-insensitive comparison (load-session can return it uppercased).
|
||||||
|
// Returns the canonical option value, or the original value if no match.
|
||||||
|
matchDamageCauseToOption(value) {
|
||||||
|
if (!value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
const optionValues = Object.values(this.damageTypesOptions ?? {});
|
||||||
|
const match = optionValues.find(
|
||||||
|
(option) => option?.toLowerCase() === value.toLowerCase()
|
||||||
|
);
|
||||||
|
return match ?? value;
|
||||||
|
},
|
||||||
getPolicyStateFromStore() {
|
getPolicyStateFromStore() {
|
||||||
return store.getters.order.policy.state;
|
return store.getters.order.policy.state;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
placeholderText="MM/DD/YYYY"
|
placeholderText="MM/DD/YYYY"
|
||||||
validationRules="date-of-birth-required"
|
validationRules="date-of-birth-required"
|
||||||
format="MM/dd/yyyy"
|
format="MM/dd/yyyy"
|
||||||
modelType="MM/dd/yyyy"
|
modelType="yyyy-MM-dd"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
:textInputOnly="true"
|
:textInputOnly="true"
|
||||||
:maxDate="today"
|
:maxDate="today"
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
placeholderText="MM/DD/YYYY"
|
placeholderText="MM/DD/YYYY"
|
||||||
validationRules="date-of-loss-required"
|
validationRules="date-of-loss-required"
|
||||||
format="MM/dd/yyyy"
|
format="MM/dd/yyyy"
|
||||||
modelType="MM/dd/yyyy"
|
modelType="yyyy-MM-dd"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
:textInput="true"
|
:textInput="true"
|
||||||
:maxDate="today"
|
:maxDate="today"
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,13 @@ const getDefaultState = () => {
|
||||||
phoneNumber: null,
|
phoneNumber: null,
|
||||||
isSmsOptIn: null,
|
isSmsOptIn: null,
|
||||||
waitListRequested: null,
|
waitListRequested: null,
|
||||||
|
address: {
|
||||||
|
streetAddress: null,
|
||||||
|
streetAddress2: null,
|
||||||
|
city: null,
|
||||||
|
state: null,
|
||||||
|
zipCode: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: null,
|
isRepair: null,
|
||||||
|
|
@ -141,6 +148,7 @@ const getDefaultState = () => {
|
||||||
coverageSubStatus: null,
|
coverageSubStatus: null,
|
||||||
coverageType: null,
|
coverageType: null,
|
||||||
coverageVerificationType: null,
|
coverageVerificationType: null,
|
||||||
|
claimNumber: null,
|
||||||
},
|
},
|
||||||
parentAccountNumber: 0,
|
parentAccountNumber: 0,
|
||||||
accountName: null,
|
accountName: null,
|
||||||
|
|
@ -171,20 +179,12 @@ const getDefaultState = () => {
|
||||||
currentDeductible: 0,
|
currentDeductible: 0,
|
||||||
originalDeductible: 0,
|
originalDeductible: 0,
|
||||||
policyNumber: null,
|
policyNumber: null,
|
||||||
claimNumber: null,
|
|
||||||
isItac: false,
|
isItac: false,
|
||||||
additionalAuthFlag: null,
|
additionalAuthFlag: null,
|
||||||
isNoComp: false,
|
isNoComp: false,
|
||||||
insuranceCompanyName: null,
|
insuranceCompanyName: null,
|
||||||
phoneNumber: null,
|
phoneNumber: null,
|
||||||
phoneExtension: null,
|
phoneExtension: null,
|
||||||
policyAddress: {
|
|
||||||
streetAddress: null,
|
|
||||||
streetAddress2: null,
|
|
||||||
city: null,
|
|
||||||
state: null,
|
|
||||||
zipCode: null,
|
|
||||||
},
|
|
||||||
dateOfBirth: null,
|
dateOfBirth: null,
|
||||||
lossTime: null,
|
lossTime: null,
|
||||||
lossLocation: null,
|
lossLocation: null,
|
||||||
|
|
@ -363,22 +363,22 @@ export const mutations = {
|
||||||
state.order.policy.phoneExtension = phoneExtension;
|
state.order.policy.phoneExtension = phoneExtension;
|
||||||
},
|
},
|
||||||
updateStreetAddress(state, streetAddress) {
|
updateStreetAddress(state, streetAddress) {
|
||||||
state.order.policy.policyAddress.streetAddress = streetAddress;
|
state.order.customer.address.streetAddress = streetAddress;
|
||||||
},
|
},
|
||||||
updateStreetAddress2(state, streetAddress2) {
|
updateStreetAddress2(state, streetAddress2) {
|
||||||
state.order.policy.policyAddress.streetAddress2 = streetAddress2;
|
state.order.customer.address.streetAddress2 = streetAddress2;
|
||||||
},
|
},
|
||||||
updateCity(state, city) {
|
updateCity(state, city) {
|
||||||
state.order.policy.policyAddress.city = city;
|
state.order.customer.address.city = city;
|
||||||
},
|
},
|
||||||
updateState(state, stateValue) {
|
updateState(state, stateValue) {
|
||||||
state.order.policy.policyAddress.state = stateValue;
|
state.order.customer.address.state = stateValue;
|
||||||
},
|
},
|
||||||
updateZipCode(state, zipCode) {
|
updateZipCode(state, zipCode) {
|
||||||
state.order.policy.policyAddress.zipCode = zipCode;
|
state.order.customer.address.zipCode = zipCode;
|
||||||
},
|
},
|
||||||
updateClaimNumber(state, claimNumber) {
|
updateClaimNumber(state, claimNumber) {
|
||||||
state.order.policy.claimNumber = claimNumber;
|
state.order.payment.insuranceCoverage.claimNumber = claimNumber;
|
||||||
},
|
},
|
||||||
updateIsClaimAndCoverage(state, isClaimAndCoverage) {
|
updateIsClaimAndCoverage(state, isClaimAndCoverage) {
|
||||||
state.order.payment.isClaimAndCoverage = isClaimAndCoverage;
|
state.order.payment.isClaimAndCoverage = isClaimAndCoverage;
|
||||||
|
|
@ -405,13 +405,13 @@ export const mutations = {
|
||||||
};
|
};
|
||||||
|
|
||||||
state.order.policy.policyNumber = null;
|
state.order.policy.policyNumber = null;
|
||||||
state.order.policy.claimNumber = null;
|
state.order.payment.insuranceCoverage.claimNumber = null;
|
||||||
state.order.policy.insuranceCompanyName = null;
|
state.order.policy.insuranceCompanyName = null;
|
||||||
state.order.policy.policyAddress.streetAddress = null;
|
state.order.customer.address.streetAddress = null;
|
||||||
state.order.policy.policyAddress.streetAddress2 = null;
|
state.order.customer.address.streetAddress2 = null;
|
||||||
state.order.policy.policyAddress.city = null;
|
state.order.customer.address.city = null;
|
||||||
state.order.policy.policyAddress.state = null;
|
state.order.customer.address.state = null;
|
||||||
state.order.policy.policyAddress.zipCode = null;
|
state.order.customer.address.zipCode = null;
|
||||||
state.order.damage.dateOfLoss = null;
|
state.order.damage.dateOfLoss = null;
|
||||||
state.order.damage.damageCause = null;
|
state.order.damage.damageCause = null;
|
||||||
},
|
},
|
||||||
|
|
@ -565,12 +565,12 @@ export const mutations = {
|
||||||
updateInsuranceDetails(state, insuranceDetails) {
|
updateInsuranceDetails(state, insuranceDetails) {
|
||||||
if (insuranceDetails) {
|
if (insuranceDetails) {
|
||||||
state.order.policy.policyNumber = insuranceDetails.policyNumber;
|
state.order.policy.policyNumber = insuranceDetails.policyNumber;
|
||||||
state.order.policy.policyAddress.streetAddress = insuranceDetails.streetAddress;
|
state.order.customer.address.streetAddress = insuranceDetails.streetAddress;
|
||||||
state.order.policy.policyAddress.streetAddress2 = insuranceDetails.streetAddress2;
|
state.order.customer.address.streetAddress2 = insuranceDetails.streetAddress2;
|
||||||
state.order.policy.policyAddress.city = insuranceDetails.city;
|
state.order.customer.address.city = insuranceDetails.city;
|
||||||
state.order.policy.policyAddress.state = insuranceDetails.state;
|
state.order.customer.address.state = insuranceDetails.state;
|
||||||
state.order.policy.policyAddress.zipCode = insuranceDetails.zipCode;
|
state.order.customer.address.zipCode = insuranceDetails.zipCode;
|
||||||
state.order.policy.claimNumber = insuranceDetails.claimNumber;
|
state.order.payment.insuranceCoverage.claimNumber = insuranceDetails.claimNumber;
|
||||||
state.order.policy.phoneNumber = insuranceDetails.phoneNumber;
|
state.order.policy.phoneNumber = insuranceDetails.phoneNumber;
|
||||||
state.order.policy.phoneExtension = insuranceDetails.phoneExtension;
|
state.order.policy.phoneExtension = insuranceDetails.phoneExtension;
|
||||||
state.order.policy.morePolicyQuestions = insuranceDetails.morePolicyQuestions;
|
state.order.policy.morePolicyQuestions = insuranceDetails.morePolicyQuestions;
|
||||||
|
|
@ -587,7 +587,6 @@ export const mutations = {
|
||||||
state.order.payment.insuranceCoverage.coverageSubStatus =
|
state.order.payment.insuranceCoverage.coverageSubStatus =
|
||||||
insuranceDetails.coverageSubStatus;
|
insuranceDetails.coverageSubStatus;
|
||||||
}
|
}
|
||||||
console.log("::::" + state.order.payment.insuranceCoverage.coverageStatus);
|
|
||||||
},
|
},
|
||||||
updateDamageDetails(state, damageDetails) {
|
updateDamageDetails(state, damageDetails) {
|
||||||
if (damageDetails) {
|
if (damageDetails) {
|
||||||
|
|
@ -958,6 +957,16 @@ export const mutations = {
|
||||||
state.order.customer.phoneNumber = sessionInformation.order.customer.homePhone;
|
state.order.customer.phoneNumber = sessionInformation.order.customer.homePhone;
|
||||||
state.order.customer.isSmsOptIn = sessionInformation.order.customer.isSmsOptIn;
|
state.order.customer.isSmsOptIn = sessionInformation.order.customer.isSmsOptIn;
|
||||||
|
|
||||||
|
if (sessionInformation.order.customer.address) {
|
||||||
|
state.order.customer.address = Object.assign(state.order.customer.address, {
|
||||||
|
streetAddress: sessionInformation.order.customer.address.streetAddress,
|
||||||
|
streetAddress2: sessionInformation.order.customer.address.streetAddress2,
|
||||||
|
city: sessionInformation.order.customer.address.city,
|
||||||
|
state: sessionInformation.order.customer.address.state,
|
||||||
|
zipCode: sessionInformation.order.customer.address.zipCode,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
state.applicationUser.experiments = sessionInformation.applicationUser.experiments;
|
state.applicationUser.experiments = sessionInformation.applicationUser.experiments;
|
||||||
state.applicationUser.crmCustomerId = sessionInformation.applicationUser.crmCustomerId;
|
state.applicationUser.crmCustomerId = sessionInformation.applicationUser.crmCustomerId;
|
||||||
state.applicationUser.pageData = sessionInformation.applicationUser.pageData;
|
state.applicationUser.pageData = sessionInformation.applicationUser.pageData;
|
||||||
|
|
@ -985,20 +994,10 @@ export const mutations = {
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
state.order.policy.policyNumber = sessionInformation.order.policy?.policyNumber;
|
state.order.policy.policyNumber = sessionInformation.order.policy?.policyNumber;
|
||||||
state.order.policy.claimNumber = sessionInformation.order.policy?.claimNumber;
|
state.order.payment.insuranceCoverage.claimNumber = sessionInformation.order.insuranceCoverage?.claimNumber;
|
||||||
state.order.policy.insuranceCompanyName =
|
state.order.policy.insuranceCompanyName =
|
||||||
sessionInformation.order.policy?.insuranceCompanyName;
|
sessionInformation.order.policy?.insuranceCompanyName;
|
||||||
|
|
||||||
if (!state.order.policy.policyAddress) {
|
|
||||||
state.order.policy.policyAddress = {};
|
|
||||||
}
|
|
||||||
const sessionPolicyAddress = sessionInformation.order.policy?.address;
|
|
||||||
state.order.policy.policyAddress.streetAddress = sessionPolicyAddress?.streetAddress;
|
|
||||||
state.order.policy.policyAddress.streetAddress2 = sessionPolicyAddress?.streetAddress2;
|
|
||||||
state.order.policy.policyAddress.city = sessionPolicyAddress?.city;
|
|
||||||
state.order.policy.policyAddress.state = sessionPolicyAddress?.state;
|
|
||||||
state.order.policy.policyAddress.zipCode = sessionPolicyAddress?.zipCode;
|
|
||||||
|
|
||||||
state.order.policy.isNoComp =
|
state.order.policy.isNoComp =
|
||||||
coverageTypeValue(sessionInformation?.order.insuranceCoverage.coverageType) ===
|
coverageTypeValue(sessionInformation?.order.insuranceCoverage.coverageType) ===
|
||||||
coverageType.NOCOMP
|
coverageType.NOCOMP
|
||||||
|
|
@ -2668,6 +2667,13 @@ export const actions = {
|
||||||
lastName: order.customer.lastName,
|
lastName: order.customer.lastName,
|
||||||
isSmsOptIn: order.customer.isSmsOptIn,
|
isSmsOptIn: order.customer.isSmsOptIn,
|
||||||
phoneNumber: order.customer.phoneNumber,
|
phoneNumber: order.customer.phoneNumber,
|
||||||
|
address: {
|
||||||
|
streetAddress: order.customer.address.streetAddress,
|
||||||
|
streetAddress2: order.customer.address.streetAddress2,
|
||||||
|
city: order.customer.address.city,
|
||||||
|
state: order.customer.address.state,
|
||||||
|
zipCode: order.customer.address.zipCode,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
damage: {
|
damage: {
|
||||||
numberOfChips: damage.numberOfChips,
|
numberOfChips: damage.numberOfChips,
|
||||||
|
|
@ -2695,6 +2701,7 @@ export const actions = {
|
||||||
coverageVerificationType:
|
coverageVerificationType:
|
||||||
order.payment.insuranceCoverage.coverageVerificationType,
|
order.payment.insuranceCoverage.coverageVerificationType,
|
||||||
coverageSubStatus: order.payment.insuranceCoverage.coverageSubStatus,
|
coverageSubStatus: order.payment.insuranceCoverage.coverageSubStatus,
|
||||||
|
claimNumber: order.payment.insuranceCoverage.claimNumber,
|
||||||
},
|
},
|
||||||
isInsurance: order.payment.isInsurance,
|
isInsurance: order.payment.isInsurance,
|
||||||
parentAccountNumber: order.payment.parentAccountNumber,
|
parentAccountNumber: order.payment.parentAccountNumber,
|
||||||
|
|
@ -2730,15 +2737,7 @@ export const actions = {
|
||||||
isNoComp: order.policy?.isNoComp,
|
isNoComp: order.policy?.isNoComp,
|
||||||
currentDeductible: order.policy?.currentDeductible,
|
currentDeductible: order.policy?.currentDeductible,
|
||||||
originalDeductible: order.policy?.originalDeductible,
|
originalDeductible: order.policy?.originalDeductible,
|
||||||
policyAddress: {
|
|
||||||
streetAddress: order.policy?.policyAddress?.streetAddress,
|
|
||||||
streetAddress2: order.policy?.policyAddress?.streetAddress2,
|
|
||||||
city: order.policy?.policyAddress?.city,
|
|
||||||
state: order.policy?.policyAddress?.state,
|
|
||||||
zipCode: order.policy?.policyAddress?.zipCode,
|
|
||||||
},
|
|
||||||
policyNumber: order.policy?.policyNumber,
|
policyNumber: order.policy?.policyNumber,
|
||||||
claimNumber: order.policy?.claimNumber,
|
|
||||||
},
|
},
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
streetAddress: order.serviceLocation.address,
|
streetAddress: order.serviceLocation.address,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue