File

apps/recallassess/recallassess-api/src/api/client/learning-group/dto/learning-group-add.dto.ts

Description

DTO for adding a learning group (license allocation)

Index

Properties

Properties

courseId
Type : number
Decorators :
@Expose()
@ApiProperty({description: 'Course ID to assign to the learning group', example: 1})
@IsNotEmpty()
@IsInt()
@Type(undefined)
Optional dueDate
Type : Date
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Due date for completion', example: '2025-02-28'})
@IsOptional()
@Type(undefined)
@IsDate()
Optional moduleAssignmentRule
Type : ModuleAssignmentRule
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Module assignment rule - determines which eLearning modules to assign based on PRE BAT results', enum: ModuleAssignmentRule, example: undefined, default: undefined})
@IsOptional()
@IsEnum(ModuleAssignmentRule)
participants
Type : number[]
Decorators :
@Expose()
@ApiProperty({description: 'Array of participant IDs to assign to this learning group', example: undefined, type: undefined})
@IsNotEmpty()
@IsArray()
@IsInt({each: true})
@Type(undefined)
Optional team
Type : string
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Team/Group name (participant group name)', example: 'Sales Team'})
@IsOptional()
@IsString()
@MaxLength(200)
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ModuleAssignmentRule } from "@prisma/client";
import { Exclude, Expose, Type } from "class-transformer";
import { IsArray, IsDate, IsEnum, IsInt, IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";

/**
 * DTO for adding a learning group (license allocation)
 */
@Exclude()
export class AddLearningGroupDto {
  @Expose()
  @ApiProperty({
    description: "Course ID to assign to the learning group",
    example: 1,
  })
  @IsNotEmpty()
  @IsInt()
  @Type(() => Number)
  courseId!: number;

  @Expose()
  @ApiPropertyOptional({
    description: "Team/Group name (participant group name)",
    example: "Sales Team",
  })
  @IsOptional()
  @IsString()
  @MaxLength(200)
  team?: string;

  @Expose()
  @ApiPropertyOptional({
    description: "Due date for completion",
    example: "2025-02-28",
  })
  @IsOptional()
  @Type(() => Date)
  @IsDate()
  dueDate?: Date;

  @Expose()
  @ApiProperty({
    description: "Array of participant IDs to assign to this learning group",
    example: [1, 2, 3],
    type: [Number],
  })
  @IsNotEmpty()
  @IsArray()
  @IsInt({ each: true })
  @Type(() => Number)
  participants!: number[];

  @Expose()
  @ApiPropertyOptional({
    description: "Module assignment rule - determines which eLearning modules to assign based on PRE BAT results",
    enum: ModuleAssignmentRule,
    example: ModuleAssignmentRule.ALL_MODULES,
    default: ModuleAssignmentRule.ALL_MODULES,
  })
  @IsOptional()
  @IsEnum(ModuleAssignmentRule)
  moduleAssignmentRule?: ModuleAssignmentRule;
}

results matching ""

    No results matching ""