restrict coverage lookup WIP

This commit is contained in:
Katie Kroell 2024-01-09 15:58:01 -05:00
parent 750ea42400
commit ac2f3f3c4b
3 changed files with 12 additions and 2 deletions

View file

@ -89,6 +89,8 @@ export default {
this.unauthorized = !authorized;
if (authorized) {
this.mainStore.applicationUser.coverageAttempts = 0;
console.log(this.mainStore.applicationUser.coverageAttempts);
// Forced full location redirect here. We do not want the entry page as part of the router/flow/path history.
window.location = `/?issPage=${issPageValues.WELCOME_PAGE}`;
}

View file

@ -308,6 +308,9 @@ export default {
},
isCoverageEnabled() {
return this.mainStore.issConfig.isCoverageEnabled;
},
isCoverageLookupRestricted() {
return this.mainStore.applicationUser.coverageAttempts >= 11;
}
},
methods: {
@ -316,8 +319,10 @@ export default {
await this.mainStore.getDuplicateReferrals()
.then(() => {}, () => {})
.finally(async () => {
if (this.isCoverageEnabled) {
if (this.isCoverageEnabled && !this.isCoverageLookupRestricted) {
await this.mainStore.getCoveragePolicyInfo()?.then(() => {}, () => {});
} else {
this.mainStore.order.policy.policyLookupSuccessful = false;
}
this.navigateForward();
});

View file

@ -183,7 +183,8 @@ const getDefaultState = () => ({
lastPageVisited: null,
triggeredSiteEntry: false, // TODO not in save session
duplicateOrders: [],
hasSentSaveQuoteEmail: null
hasSentSaveQuoteEmail: null,
coverageAttempts: 0
},
issConfig: {
clientName: 'Generic Insurance', // this is the default and will be overriden by the client's name
@ -437,6 +438,8 @@ export const useMainStore = defineStore({
getCoveragePolicyInfo() {
const { order } = this;
const { policy } = order;
this.applicationUser.coverageAttempts += 1;
console.log(this.applicationUser.coverageAttempts);
return new Promise((resolve, reject) => {
globalMethods.callHttpClient({
method: endpoints.CoveragePolicyInfo.method,