File

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

Description

DTO for user's enrolled courses with progress tracking

Index

Properties

Properties

accepted_at
Type : Date | null
Decorators :
@Expose()
Optional cancelled
Type : boolean
Decorators :
@Expose()
category
Type : string
Decorators :
@Expose()
Optional company_active
Type : boolean
Decorators :
@Expose()

Same as list company_active (isPortalCompanyActive).

complete_date
Type : Date | null
Decorators :
@Expose()
completion_percentage
Type : number
Decorators :
@Expose()
course_code
Type : string
Decorators :
@Expose()
course_id
Type : number
Decorators :
@Expose()
course_modules_completed
Type : number
Decorators :
@Expose()
description
Type : string
Decorators :
@Expose()
duration
Type : string | null
Decorators :
@Expose()
Optional hundred_dj_email1_date
Type : Date | null
Decorators :
@Expose()
Optional hundred_dj_email2_date
Type : Date | null
Decorators :
@Expose()
Optional hundred_dj_email3_date
Type : Date | null
Decorators :
@Expose()
Optional hundred_dj_email4_date
Type : Date | null
Decorators :
@Expose()
id
Type : number
Decorators :
@Expose()
image
Type : string
Decorators :
@Expose()
Optional is_accessible
Type : boolean
Decorators :
@Expose()
knowledge_review_completed
Type : boolean
Decorators :
@Expose()
Optional knowledge_review_email_date
Type : Date | null
Decorators :
@Expose()
last_activity
Type : Date | null
Decorators :
@Expose()
learning_group_id
Type : number
Decorators :
@Expose()
learning_group_participant_id
Type : number
Decorators :
@Expose()
level
Type : string
Decorators :
@Expose()
level_color
Type : string
Decorators :
@Expose()
Optional module_assignment_rule
Type : string
Decorators :
@Expose()
modules
Type : number
Decorators :
@Expose()
post_bat_analysis_available
Type : boolean
Decorators :
@Expose()
post_bat_completed
Type : boolean
Decorators :
@Expose()
Optional post_bat_email_date
Type : Date | null
Decorators :
@Expose()
pre_bat_analysis_available
Type : boolean
Decorators :
@Expose()
pre_bat_completed
Type : boolean
Decorators :
@Expose()
progress_percentage
Type : number
Decorators :
@Expose()
raw_status
Type : string
Decorators :
@Expose()
Optional sequential_position
Type : number
Decorators :
@Expose()
Optional skip_hundred_dj
Type : boolean
Decorators :
@Expose()
start_date
Type : Date | null
Decorators :
@Expose()
status
Type : string
Decorators :
@Expose()
title
Type : string
Decorators :
@Expose()
total_course_modules
Type : number
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 ""