import { IsIn, IsObject, IsOptional, IsString, MaxLength } from 'class-validator';

const projectStatuses = ['active', 'paused', 'completed', 'archived'] as const;

export class CreateProjectDto {
  @IsString()
  @MaxLength(255)
  name!: string;

  @IsOptional()
  @IsString()
  @MaxLength(10_000)
  description?: string;

  @IsOptional()
  @IsIn(projectStatuses)
  status?: 'active' | 'paused' | 'completed' | 'archived';
}

export class UpdateProjectDto {
  @IsOptional()
  @IsString()
  @MaxLength(255)
  name?: string;

  @IsOptional()
  @IsString()
  @MaxLength(10_000)
  description?: string | null;

  @IsOptional()
  @IsIn(projectStatuses)
  status?: 'active' | 'paused' | 'completed' | 'archived';

  @IsOptional()
  @IsObject()
  metadata?: Record<string, unknown> | null;
}
