import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber } from 'class-validator';
import { CreateDto } from 'src/common/dto/create.dto';

/**
 * 学员课后维度评价
 */
export class CourseStudyEvaluateDto extends CreateDto {
  @ApiProperty({ description: '所属的记录ID' })
  @IsNotEmpty({ message: '所属的记录ID不能为空' })
  @IsNumber()
  recordId: number;

  @ApiProperty({ description: '评论所属维度ID' })
  @IsNotEmpty({ message: '评论所属维度ID不能为空' })
  @IsNumber()
  dimensionId: string;

  @ApiProperty({
    description: '评分值1-5',
  })
  @IsNotEmpty({ message: '平分值不可为空' })
  value: number;

  @IsNotEmpty({ message: '0为课程评价1为自我评价' })
  type: number;
}
// 更新课程的评价信息
export class updateEvaluate {
  @ApiProperty({ description: '评价的集体信息' })
  evealInfo: {
    recordId: number;
    dimensionId: string;
    value: number;
    type: number;
  }[];
  textEvealInfo: { id: number; selfEvael: string; courseEveal: string };
}
