apps/recallassess/recallassess-api/src/api/client/learning-group/dto/learning-group-add.dto.ts
DTO for adding a learning group (license allocation)
Properties |
|
| courseId |
Type : number
|
Decorators :
@Expose()
|
| Optional dueDate |
Type : Date
|
Decorators :
@Expose()
|
| Optional team |
Type : string
|
Decorators :
@Expose()
|
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;
}