feat: add database export, welcome kit dialog, and DIP/sanctions updates
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -85,6 +85,54 @@ import { formatTabLabel } from 'app/shared/utils/format-tab-label.util';
|
||||
})
|
||||
export class ClientsViewComponent implements OnInit {
|
||||
complianceHideClientData = environment.complianceHideClientData;
|
||||
|
||||
/**
|
||||
* Whether the number's CURRENT DIP/MNRL status is a hit. Driven by the live lookup rather than
|
||||
* the onboarding-time `dipVerified` flag, which never changes once the client is created.
|
||||
*/
|
||||
isDipFlagged(liveStatus: string | null | undefined): boolean {
|
||||
return !!liveStatus && liveStatus !== 'CLEAN' && liveStatus !== 'ERROR';
|
||||
}
|
||||
|
||||
/** True only when the number is affirmatively clean — not merely "not flagged". */
|
||||
isDipClear(client: any): boolean {
|
||||
if (client?.dipLiveStatus) {
|
||||
return client.dipLiveStatus === 'CLEAN';
|
||||
}
|
||||
return client?.dipVerified === true || client?.dipVerified === 'true' || client?.dipVerified === 1;
|
||||
}
|
||||
|
||||
/** True when onboarding screening cleared the name — the pre-alert baseline. */
|
||||
isNameCleared(client: any): boolean {
|
||||
return client?.nameVerified === true || client?.nameVerified === 'true' || client?.nameVerified === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Header badge for sanctions. A live alert always wins over the onboarding flag: the flag says
|
||||
* what was true the day the client joined, the alert says what is true now.
|
||||
*/
|
||||
sanctionsHeaderLabel(client: any): string {
|
||||
switch (client?.sanctionsAlertStatus) {
|
||||
case 'CONFIRMED_MATCH':
|
||||
return 'Frozen — Sanctions Match';
|
||||
case 'PENDING_REVIEW':
|
||||
return 'Under Review';
|
||||
case 'FALSE_POSITIVE':
|
||||
return 'Cleared — False Positive';
|
||||
default:
|
||||
return this.isNameCleared(client) ? 'Clear' : 'Pending';
|
||||
}
|
||||
}
|
||||
|
||||
dipStatusLabel(client: any): string {
|
||||
const live = client?.dipLiveStatus;
|
||||
if (live === 'SUSPECTED') return 'Flagged — Suspected';
|
||||
if (live === 'DISCONNECTED') return 'Flagged — Disconnected';
|
||||
if (live === 'SUSPECTED_AND_DISCONNECTED') return 'Flagged — Suspected & Disconnected';
|
||||
if (live === 'SERVICE_UNAVAILABLE') return 'Not Verified';
|
||||
if (live === 'CLEAN') return 'Verified';
|
||||
return this.isDipClear(client) ? 'Verified' : 'Pending';
|
||||
}
|
||||
/**
|
||||
* Mask a string, keeping first and last letter, masking the rest with *
|
||||
*/
|
||||
@@ -461,12 +509,24 @@ export class ClientsViewComponent implements OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the Welcome Kit Dispatch dialog.
|
||||
* Opens the Welcome Kit Dispatch dialog. The kit is only posted once the client is active, so the dialog is
|
||||
* unreachable before then — the menu entry is hidden and this guard covers any other route into the action.
|
||||
*/
|
||||
private dispatchWelcomeKit() {
|
||||
if (!this.isActive()) {
|
||||
return;
|
||||
}
|
||||
const welcomeKitDialogRef = this.dialog.open(WelcomeKitDialogComponent, {
|
||||
data: { clientId: this.clientViewData.id },
|
||||
width: '600px'
|
||||
data: {
|
||||
clientId: this.clientViewData.id,
|
||||
clientName: this.clientViewData.displayName,
|
||||
accountNo: this.clientViewData.accountNo,
|
||||
cifNumber: this.clientViewData.cifNumber,
|
||||
mobileNo: this.clientViewData.mobileNo,
|
||||
emailAddress: this.clientViewData.emailAddress,
|
||||
officeName: this.clientViewData.officeName
|
||||
},
|
||||
width: '680px'
|
||||
});
|
||||
welcomeKitDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response) {
|
||||
|
||||
Reference in New Issue
Block a user