import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import {
  IsString,
  IsOptional,
  IsDateString,
  IsEnum,
} from 'class-validator';
import { ActionStatus, Priority } from '@prisma/client';

/**
 * DTO for creating a new action item in a morning meeting
 */
export class CreateActionDto {
  @ApiProperty({
    description: 'Action item title',
    example: 'Fix conveyor belt alignment',
  })
  @IsString()
  title: string;

  @ApiPropertyOptional({
    description: 'Detailed description of the action',
    example: 'The conveyor belt on line A needs realignment to prevent product jams',
  })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiPropertyOptional({
    description: 'User ID of the assignee',
    example: 'clq1234567890abcdef',
  })
  @IsOptional()
  @IsString()
  assigneeId?: string;

  @ApiPropertyOptional({
    description: 'Due date for the action (YYYY-MM-DD)',
    example: '2024-01-20',
  })
  @IsOptional()
  @IsDateString()
  dueDate?: string;

  @ApiPropertyOptional({
    description: 'Action status',
    enum: ActionStatus,
    default: 'OPEN',
  })
  @IsOptional()
  @IsEnum(ActionStatus)
  status?: ActionStatus;

  @ApiPropertyOptional({
    description: 'Priority level',
    enum: Priority,
    default: 'MEDIUM',
  })
  @IsOptional()
  @IsEnum(Priority)
  priority?: Priority;
}
