import {
  IsString,
  IsOptional,
  IsNumber,
  IsIn,
} from 'class-validator';
import { Type } from 'class-transformer';

export class UpdateTrainingCertificateDto {
  @IsOptional()
  @IsString()
  participant_name?: string;

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

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

  @IsOptional()
  @IsNumber()
  standard_id?: number;

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

  @IsOptional()
  @Type(() => Date)
  training_date?: Date;

  @IsOptional()
  @Type(() => Date)
  training_date_end?: Date | null;

  @IsOptional()
  @Type(() => Date)
  valid_until?: Date;

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

  @IsOptional()
  @IsString()
  @IsIn(['local', 'international'])
  verification_domain?: string;

  // Admin actions: revoke / mark fake / reactivate
  @IsOptional()
  @IsString()
  @IsIn(['pending_scan', 'active', 'expired', 'revoked', 'fake'])
  status?: string;

  @IsOptional()
  @IsNumber()
  updated_by?: number;
}