import { IsBoolean, IsDateString, IsNotEmpty, IsNumber, IsOptional, IsString, Max, Min } from 'class-validator';

export class LogTimeDto {
  @IsString()
  @IsNotEmpty()
  projectId!: string;

  @IsString()
  @IsOptional()
  userId?: string;

  @IsString()
  @IsOptional()
  milestoneId?: string;

  @IsString()
  @IsOptional()
  taskId?: string;

  @IsDateString()
  @IsNotEmpty()
  date!: string;

  @IsNumber()
  @Min(0.25)
  @Max(24)
  hours!: number;

  @IsBoolean()
  @IsOptional()
  isBillable?: boolean;

  @IsString()
  @IsOptional()
  note?: string;
}
