File

apps/recallassess/recallassess-api/src/api/client/my-course/dto/my-course.dto.ts

Description

Response for GET /api/client/my-course — company_active matches isPortalCompanyActive (expiry flag + current ACTIVE subscription).

Index

Properties

Properties

company_active
Type : boolean
Decorators :
@Expose()
courses
Type : CLMyCourseDto[]
Decorators :
@Expose()
import { Exclude, Expose } from "class-transformer";

/**
 * Response for GET /api/client/my-course — `company_active` matches isPortalCompanyActive (expiry flag + current ACTIVE subscription).
 */
@Exclude()
export class CLMyCourseListResponseDto {
  @Expose()
  courses!: CLMyCourseDto[];

  @Expose()
  company_active!: boolean;
}

/**
 * DTO for user's enrolled courses with progress tracking
 */
@Exclude()
export class CLMyCourseDto {
  @Expose()
  id!: number; // This is the LearningGroupParticipant ID

  @Expose()
  learning_group_participant_id!: number; // Alias for id for clarity

  @Expose()
  course_id!: number;

  @Expose()
  title!: string;

  @Expose()
  category!: string;

  @Expose()
  level!: string;

  @Expose()
  level_color!: string;

  @Expose()
  description!: string;

  @Expose()
  modules!: number;

  @Expose()
  duration!: string | null;

  @Expose()
  image!: string;

  @Expose()
  course_code!: string;

  // Progress tracking fields
  @Expose()
  progress_percentage!: number; // E-Learning module progress (from eLearningParticipant)

  @Expose()
  completion_percentage!: number; // Overall course completion (from LearningGroupParticipant) - 25%, 50%, 75%, 100%

  @Expose()
  status!: string; // NOT_STARTED | IN_PROGRESS | COMPLETED

  @Expose()
  course_modules_completed!: number;

  @Expose()
  total_course_modules!: number;

  @Expose()
  start_date!: Date | null;

  @Expose()
  complete_date!: Date | null;

  @Expose()
  last_activity!: Date | null;

  @Expose()
  learning_group_id!: number;

  @Expose()
  pre_bat_completed!: boolean;

  @Expose()
  post_bat_completed!: boolean;

  @Expose()
  pre_bat_analysis_available!: boolean; // Whether ai_analysis is available for PRE_BAT

  @Expose()
  post_bat_analysis_available!: boolean; // Whether ai_analysis is available for POST_BAT

  @Expose()
  knowledge_review_completed!: boolean;

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

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

  @Expose()
  module_assignment_rule?: string; // Module assignment rule (ALL_MODULES, RED_AMBER_ONLY, RECOMMENDED) - for testing

  @Expose()
  skip_hundred_dj?: boolean; // Whether 100DJ is skipped for this course

  @Expose()
  knowledge_review_email_date?: Date | null; // Date when knowledge review email will be sent (for 100DJ courses)

  @Expose()
  post_bat_email_date?: Date | null; // Date when Post BAT invitation email will be sent (48-72 hours after KR completion)

  @Expose()
  hundred_dj_email1_date?: Date | null; // Date when 100DJ email 1 will be sent

  @Expose()
  hundred_dj_email2_date?: Date | null; // Date when 100DJ email 2 will be sent

  @Expose()
  hundred_dj_email3_date?: Date | null; // Date when 100DJ email 3 will be sent

  @Expose()
  hundred_dj_email4_date?: Date | null; // Date when 100DJ email 4 will be sent

  // Sequential course access fields
  @Expose()
  sequential_position?: number; // Position in sequence (1, 2, 3, etc.)

  @Expose()
  is_accessible?: boolean; // Whether this course can be accessed (all previous courses completed)

  @Expose()
  cancelled?: boolean; // Whether the license is cancelled

  /** Same as list `company_active` (isPortalCompanyActive). */
  @Expose()
  company_active?: boolean;
}

results matching ""

    No results matching ""