@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'|'REVIEW NON COMPLIANCE'|'CONCUR COMPLIANCE REVIEW'|'CLOSING REMARKS';
type Role = 'Investigator'|'Hod'|'Panel';
type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'|'REVIEW NON COMPLIANCE'|'CONCUR COMPLIANCE REVIEW'|'CLOSING REMARKS'|'PREPARE PRELIMINARY LETTER'|'RESPOND TO PRELIMINARY LETTER' ;
type Role = 'Investigator'|'Hod'|'Panel'|'Customer' ;
@Component({
selector: 'app-investigate-business-entities-and-individuals',
@@ -26,16 +26,21 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni
constructor() {
const panelRemarks = localStorage.getItem('panelRemarks');
if (panelRemarks) {
this.panelRemarks = panelRemarks;
}
this.isNonCompliant = localStorage.getItem('isNonCompliant') === 'true';
const loginEmail = localStorage.getItem('loginEmail');
if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('hod')) {
this.loginRole = 'Hod';
} else if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('panel')) {
this.loginRole = 'Panel';
} else if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('customer')) {
this.loginRole = 'Customer';
} else {
this.loginRole = 'Investigator';
}
@@ -63,6 +68,14 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni
this.state = 'CLOSING REMARKS';
this.executingRole = 'Investigator';
break;
case 'PREPARE PRELIMINARY LETTER':
this.state = 'PREPARE PRELIMINARY LETTER';
this.executingRole = 'Investigator';
break;
case 'RESPOND TO PRELIMINARY LETTER':
this.state = 'RESPOND TO PRELIMINARY LETTER';
this.executingRole = 'Customer';
break;
default:
this.state = 'VIEW INITIAL DETAILS';
this.executingRole = 'Investigator';
@@ -71,6 +84,11 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni
this.canExecute = this.loginRole === this.executingRole;
}
updateIsNonCompliant(isNonCompliant: boolean) {
this.isNonCompliant = isNonCompliant;
localStorage.setItem('isNonCompliant', String(isNonCompliant));
}
updatePanelRemarks(remarks: string) {
this.panelRemarks = remarks;
localStorage.setItem('panelRemarks', remarks);
@@ -105,10 +123,18 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni
if (!this.isPanelConcurring) {
this.state = 'REVIEW NON COMPLIANCE';
} else {
this.state = 'CLOSING REMARKS';
if (this.isNonCompliant) {
this.state = 'PREPARE PRELIMINARY LETTER';
} else {
this.state = 'CLOSING REMARKS';
}
}
this.executingRole = 'Investigator';
break;
case 'PREPARE PRELIMINARY LETTER':
this.state = 'RESPOND TO PRELIMINARY LETTER';
this.executingRole = 'Customer';
break;
}
localStorage.setItem('state', this.state);