import { IsNotEmpty, IsEnum, IsUUID, IsInt, Min } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { HistoryContentType } from '../../common/enums';

export class UpsertHistoryDto {
  @ApiProperty({ example: 'uuid-content-id' })
  @IsUUID()
  @IsNotEmpty()
  contentId: string;

  @ApiProperty({ enum: HistoryContentType, example: HistoryContentType.MOVIE })
  @IsEnum(HistoryContentType)
  @IsNotEmpty()
  contentType: HistoryContentType;

  @ApiProperty({ example: 1200 })
  @IsInt()
  @Min(0)
  progressSeconds: number;

  @ApiProperty({ example: 7200 })
  @IsInt()
  @Min(0)
  totalSeconds: number;
}
