Skip to main content

default

chainalign-backend


chainalign-backend / services/NotificationService / default

Class: default

Defined in: services/NotificationService.js:7

Constructors

Constructor

new default(): NotificationService

Returns

NotificationService

Properties

_io

static _io: any = null

Defined in: services/NotificationService.js:8

Methods

init()

static init(ioInstance): void

Defined in: services/NotificationService.js:14

Initializes the NotificationService with the Socket.IO instance.

Parameters

ioInstance

any

The Socket.IO server instance.

Returns

void


sendHighPriorityAlert()

static sendHighPriorityAlert(tenantId, title, message, recipientType): Promise<void>

Defined in: services/NotificationService.js:62

Sends a high-priority alert to the frontend.

Parameters

tenantId

string

The ID of the tenant.

title

string

The title of the alert.

message

string

The detailed message of the alert.

recipientType

string = 'system'

The type of recipient (e.g., 'system', 'user', 'role').

Returns

Promise<void>


sendInsightUpdate()

static sendInsightUpdate(tenantId, userId, insightData, updateType): void

Defined in: services/NotificationService.js:26

Sends a real-time update to the frontend about an insight change or addition.

Parameters

tenantId

string

The ID of the tenant.

userId

string

The ID of the user (can be used for targeted notifications).

insightData

any

The data of the insight that was updated or added.

updateType

string

Type of update (e.g., 'insight_updated', 'insight_added', 'warning_added').

Returns

void


sendRejectionNotification()

static sendRejectionNotification(tenantId, userId, feedbackId, reason): void

Defined in: services/NotificationService.js:45

Sends a notification to a user about a rejected feedback.

Parameters

tenantId

string

The ID of the tenant.

userId

string

The ID of the user to notify.

feedbackId

string

The ID of the feedback that was rejected.

reason

string

The reason for rejection.

Returns

void


sendSearchUpdate()

static sendSearchUpdate(userId, eventName, payload): void

Defined in: services/NotificationService.js:81

Sends a real-time search update to the frontend.

Parameters

userId

string

The ID of the user to notify.

eventName

string

The name of the WebSocket event (e.g., 'search_update').

payload

any

The payload of the search update (e.g., search_id, status, results).

Returns

void