restrict coverage lookup WIP
This commit is contained in:
parent
750ea42400
commit
ac2f3f3c4b
3 changed files with 12 additions and 2 deletions
|
|
@ -89,6 +89,8 @@ export default {
|
||||||
this.unauthorized = !authorized;
|
this.unauthorized = !authorized;
|
||||||
|
|
||||||
if (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.
|
// 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}`;
|
window.location = `/?issPage=${issPageValues.WELCOME_PAGE}`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -308,6 +308,9 @@ export default {
|
||||||
},
|
},
|
||||||
isCoverageEnabled() {
|
isCoverageEnabled() {
|
||||||
return this.mainStore.issConfig.isCoverageEnabled;
|
return this.mainStore.issConfig.isCoverageEnabled;
|
||||||
|
},
|
||||||
|
isCoverageLookupRestricted() {
|
||||||
|
return this.mainStore.applicationUser.coverageAttempts >= 11;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -316,8 +319,10 @@ export default {
|
||||||
await this.mainStore.getDuplicateReferrals()
|
await this.mainStore.getDuplicateReferrals()
|
||||||
.then(() => {}, () => {})
|
.then(() => {}, () => {})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
if (this.isCoverageEnabled) {
|
if (this.isCoverageEnabled && !this.isCoverageLookupRestricted) {
|
||||||
await this.mainStore.getCoveragePolicyInfo()?.then(() => {}, () => {});
|
await this.mainStore.getCoveragePolicyInfo()?.then(() => {}, () => {});
|
||||||
|
} else {
|
||||||
|
this.mainStore.order.policy.policyLookupSuccessful = false;
|
||||||
}
|
}
|
||||||
this.navigateForward();
|
this.navigateForward();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,8 @@ const getDefaultState = () => ({
|
||||||
lastPageVisited: null,
|
lastPageVisited: null,
|
||||||
triggeredSiteEntry: false, // TODO not in save session
|
triggeredSiteEntry: false, // TODO not in save session
|
||||||
duplicateOrders: [],
|
duplicateOrders: [],
|
||||||
hasSentSaveQuoteEmail: null
|
hasSentSaveQuoteEmail: null,
|
||||||
|
coverageAttempts: 0
|
||||||
},
|
},
|
||||||
issConfig: {
|
issConfig: {
|
||||||
clientName: 'Generic Insurance', // this is the default and will be overriden by the client's name
|
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() {
|
getCoveragePolicyInfo() {
|
||||||
const { order } = this;
|
const { order } = this;
|
||||||
const { policy } = order;
|
const { policy } = order;
|
||||||
|
this.applicationUser.coverageAttempts += 1;
|
||||||
|
console.log(this.applicationUser.coverageAttempts);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
globalMethods.callHttpClient({
|
globalMethods.callHttpClient({
|
||||||
method: endpoints.CoveragePolicyInfo.method,
|
method: endpoints.CoveragePolicyInfo.method,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue