File

apps/recallassess/recallassess-api/src/api/client/dashboard/dto/dashboard.dto.ts

Description

Recent Activity for Admin Dashboard

Index

Properties

Properties

action
Type : string
Decorators :
@Expose()
icon
Type : string
Decorators :
@Expose()
iconColor
Type : string
Decorators :
@Expose()
id
Type : number
Decorators :
@Expose()
time
Type : string
Decorators :
@Expose()
userName
Type : string
Decorators :
@Expose()
import { Exclude, Expose, Type } from "class-transformer";

/**
 * Participant Dashboard Statistics
 */
@Exclude()
export class ParticipantDashboardStatsDto {
  @Expose()
  totalCourses!: number;

  @Expose()
  inProgress!: number;

  @Expose()
  completed!: number;

  @Expose()
  averageProgress!: number;
}

/**
 * Recent Course Activity
 */
@Exclude()
export class RecentCourseActivityDto {
  @Expose()
  id!: number;

  @Expose()
  action!: string;

  @Expose()
  course!: string;

  @Expose()
  time!: string;

  @Expose()
  icon!: string;

  @Expose()
  iconColor!: string;
}

/**
 * Recent Course for Dashboard
 */
@Exclude()
export class DashboardCourseDto {
  @Expose()
  id!: number;

  @Expose()
  title!: string;

  @Expose()
  progress!: number;

  @Expose()
  totalModules!: number;

  @Expose()
  completedModules!: number;

  @Expose()
  status!: string;

  @Expose()
  dueDate!: string | null;

  @Expose()
  image!: string;

  @Expose()
  raw_status!: string; // Raw status from backend (INVITED, PRE_BAT, E_LEARNING, etc.)

  @Expose()
  accepted_at!: Date | null; // When the invitation was accepted

  @Expose()
  cancelled!: boolean;

  @Expose()
  pre_bat_analysis_available!: boolean; // Whether pre-BAT analysis is available

  @Expose()
  pre_bat_completed!: boolean; // Whether pre-BAT is completed

  @Expose()
  post_bat_analysis_available!: boolean; // Whether post-BAT analysis is available

  @Expose()
  post_bat_completed!: boolean; // Whether post-BAT is completed
}

/**
 * Participant Dashboard Response
 */
@Exclude()
export class ParticipantDashboardDto {
  @Expose()
  @Type(() => ParticipantDashboardStatsDto)
  stats!: ParticipantDashboardStatsDto;

  @Expose()
  @Type(() => DashboardCourseDto)
  myCourses!: DashboardCourseDto[];

  @Expose()
  @Type(() => RecentCourseActivityDto)
  recentActivity!: RecentCourseActivityDto[];

  /** False when portal subscription is inactive (see isPortalCompanyActive: expiry flag or no current ACTIVE sub; same for trial and paid). */
  @Expose()
  company_active!: boolean;
}

/**
 * Recent Activity for Admin Dashboard
 */
@Exclude()
export class AdminRecentActivityDto {
  @Expose()
  id!: number;

  @Expose()
  userName!: string;

  @Expose()
  action!: string;

  @Expose()
  time!: string;

  @Expose()
  icon!: string;

  @Expose()
  iconColor!: string;
}

/**
 * Pending Assessment for Admin Dashboard
 */
@Exclude()
export class PendingAssessmentDto {
  @Expose()
  id!: number;

  @Expose()
  userName!: string;

  @Expose()
  courseName!: string;

  @Expose()
  assignedDate!: string;

  @Expose()
  waitingDays!: number;

  @Expose()
  status!: string;
}

/**
 * Admin Dashboard Overview Response
 */
@Exclude()
export class AdminDashboardOverviewDto {
  @Expose()
  @Type(() => AdminRecentActivityDto)
  recentActivities!: AdminRecentActivityDto[];

  @Expose()
  @Type(() => PendingAssessmentDto)
  pendingAssessments!: PendingAssessmentDto[];

  @Expose()
  completionPercentage!: number; // Overall completion rate across all programs
}

/**
 * Progress Statistics for Admin Dashboard
 */
@Exclude()
export class ProgressStatisticsDto {
  @Expose()
  completedCourses!: number;

  @Expose()
  inProgress!: number;

  @Expose()
  pendingStart!: number;

  @Expose()
  completionPercentage!: number; // Overall completion rate across all programs

  @Expose()
  overallCompletionRateThisMonth!: number; // Completion rate for current month

  @Expose()
  averageAssessmentScore!: number; // Average assessment score (from individual_quotient)

  @Expose()
  activeParticipants!: number; // Participants actively taking courses (not INVITED/ACCEPTED)

  @Expose()
  averageCompletionTimeDays!: number; // Average days to complete a course
}

/**
 * Completion Trend Data
 */
@Exclude()
export class CompletionTrendDto {
  @Expose()
  month!: string;

  @Expose()
  rate!: number;
}

/**
 * Skill Gap Data
 */
@Exclude()
export class SkillGapDto {
  @Expose()
  name!: string;

  @Expose()
  percentage!: number;

  @Expose()
  color!: string;
}

/**
 * Admin Dashboard Progress Response
 */
@Exclude()
export class AdminDashboardProgressDto {
  @Expose()
  @Type(() => ProgressStatisticsDto)
  summaryCards!: ProgressStatisticsDto;

  @Expose()
  @Type(() => CompletionTrendDto)
  completionTrends!: CompletionTrendDto[]; // Monthly completion trends

  @Expose()
  @Type(() => SkillGapDto)
  skillGaps!: SkillGapDto[]; // Skill gap analysis (can be empty for now)
}

results matching ""

    No results matching ""