import { ApiPropertyOptional } from '@nestjs/swagger';
import {
  IsString,
  IsOptional,
  IsDateString,
  IsArray,
  IsEnum,
  IsInt,
  Min,
} from 'class-validator';
import { MeetingStatus } from '@prisma/client';

/**
 * DTO for updating a morning meeting
 */
export class UpdateMeetingDto {
  @ApiPropertyOptional({
    description: 'Conductor/facilitator user ID',
    example: 'clq1234567890abcdef',
  })
  @IsOptional()
  @IsString()
  conductorId?: string;

  @ApiPropertyOptional({
    description: 'Array of participant user IDs',
    example: ['clq123', 'clq456'],
    type: [String],
  })
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  participants?: string[];

  @ApiPropertyOptional({
    description: 'Meeting notes',
    example: 'Weekly status review - updated',
  })
  @IsOptional()
  @IsString()
  notes?: string;

  @ApiPropertyOptional({
    description: 'Meeting status',
    enum: MeetingStatus,
  })
  @IsOptional()
  @IsEnum(MeetingStatus)
  status?: MeetingStatus;

  @ApiPropertyOptional({
    description: 'Meeting start time (ISO 8601)',
    example: '2024-01-15T08:00:00Z',
  })
  @IsOptional()
  @IsDateString()
  startTime?: string;

  @ApiPropertyOptional({
    description: 'Meeting end time (ISO 8601)',
    example: '2024-01-15T08:15:00Z',
  })
  @IsOptional()
  @IsDateString()
  endTime?: string;

  @ApiPropertyOptional({
    description: 'Meeting duration in minutes',
    example: 15,
  })
  @IsOptional()
  @IsInt()
  @Min(0)
  duration?: number;
}
