import {
  IsBoolean,
  IsDateString,
  IsEnum,
  IsInt,
  IsOptional,
  IsString,
  MaxLength,
  MinLength,
} from 'class-validator';
import { MeetingType } from '../entities/meeting.entity';

export class CreateMeetingDto {
  @IsString()
  @MinLength(2)
  @MaxLength(255)
  title: string;

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

  @IsOptional()
  @IsEnum(MeetingType)
  type?: MeetingType;

  /**
   * Link this meeting to an audit row. When set, type is forced to AUDIT and
   * the company is resolved from the audit automatically.
   */
  @IsOptional()
  @IsInt()
  audit_row_id?: number;

  /** only used for non-audit meetings that still concern a client */
  @IsOptional()
  @IsInt()
  company_id?: number;

  @IsOptional()
  @IsDateString()
  scheduled_at?: string;

  @IsOptional()
  @IsBoolean()
  is_recorded?: boolean;
}
