import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber } from 'class-validator';
import { CreateDto } from 'src/common/dto/create.dto';
/**
 * 学员课件学习信息
 */
export class CourseStudyCoursewareDto extends CreateDto {
  @ApiProperty({ description: '需要更新的ID，可填可不填' })
  id: number;

  @ApiProperty({ description: '所属的记录ID' })
  @IsNotEmpty({ message: '所属的记录ID不能为空' })
  @IsNumber()
  recordId: number;

  @ApiProperty({ description: '课件ID' })
  @IsNotEmpty({ message: '课件的ID不可为空' })
  @IsNumber()
  coursewareId: number;

  @ApiProperty({ description: '学习进度百分比不可为空' })
  @IsNotEmpty({ message: '学习进度百分比不可为空' })
  studyProgress: number;

  @ApiProperty({
    description: '学习状态：0未开始，1进行中，2已完成',
    default: 1,
  })
  @IsNotEmpty({ message: '学习状态不可为空' })
  courseStudyOver: number;

  @ApiProperty({
    description: '获得的分数',
    default: 1,
  })
  @IsNotEmpty({ message: '当前分数不可为空' })
  score: number;

  @ApiProperty({
    description: '学习时间',
    default: 0,
  })
  learningDuration: number;
}
