File

apps/recallassess/recallassess-api/src/api/client/participant/events/participant.events.ts

Description

Event emitted when a participant is deleted

Index

Properties

Constructor

constructor(participantId: number, companyId: number, isActive: boolean, isReplaced: boolean)
Parameters :
Name Type Optional
participantId number No
companyId number No
isActive boolean No
isReplaced boolean No

Properties

Public Readonly companyId
Type : number
Public Readonly isActive
Type : boolean
Public Readonly isReplaced
Type : boolean
Public Readonly participantId
Type : number
export class ParticipantCreatedEvent {
  constructor(
    public readonly participantId: number,
    public readonly companyId: number,
    public readonly isActive: boolean,
    public readonly isReplaced: boolean,
  ) {}
}

/**
 * Event emitted when a participant's status is updated
 */
export class ParticipantStatusUpdatedEvent {
  constructor(
    public readonly participantId: number,
    public readonly companyId: number,
    public readonly oldIsActive: boolean,
    public readonly newIsActive: boolean,
    public readonly oldIsReplaced: boolean,
    public readonly newIsReplaced: boolean,
  ) {}
}

/**
 * Event emitted when a participant is deleted
 */
export class ParticipantDeletedEvent {
  constructor(
    public readonly participantId: number,
    public readonly companyId: number,
    public readonly isActive: boolean,
    public readonly isReplaced: boolean,
  ) {}
}

/**
 * Event emitted when participant performs an activity
 */
export class ParticipantActivityEvent {
  constructor(
    public readonly participantId: number,
    public readonly activityType: string, // String to allow any activity type from any module
    public readonly metadata?: Record<string, unknown>,
  ) {}
}

/**
 * Event emitted when a participant is reactivated
 */
export class ParticipantReactivatedEvent {
  constructor(
    public readonly participantId: number,
    public readonly companyId: number,
    public readonly incompleteCourses: number,
    public readonly pendingAssessments: number,
    public readonly reactivatedAt: Date,
  ) {}
}

/**
 * Event names as constants for type safety
 */
export const PARTICIPANT_EVENTS = {
  CREATED: "participant.created",
  STATUS_UPDATED: "participant.status.updated",
  DELETED: "participant.deleted",
  ACTIVITY: "participant.activity",
  REACTIVATED: "participant.reactivated",
} as const;

results matching ""

    No results matching ""