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

const MEETING_TYPES = ['ZOOM', 'PHONE', 'IN_PERSON', 'CALLBACK', 'INTERNAL'] as const;
const CONSENT = ['UNKNOWN', 'GRANTED', 'DENIED', 'REVOKED'] as const;

export class ScheduleMeetingDto {
  @IsIn(MEETING_TYPES) meetingType!: (typeof MEETING_TYPES)[number];
  @IsString() title!: string;
  @IsString() startAt!: string;
  @IsOptional() @IsString() endAt?: string;
  @IsOptional() @IsString() timezone?: string;
  @IsOptional() @IsArray() attendees?: { userId: string; displayName?: string; role?: 'REQUIRED' | 'OPTIONAL'; visibility?: 'FULL' | 'LIMITED' | 'NONE' }[];
  @IsOptional() @IsString() requestId?: string;
}

export class RequestMeetingDto {
  @IsObject() requestedWindow!: Record<string, unknown>;
  @IsOptional() @IsIn(MEETING_TYPES) meetingType?: (typeof MEETING_TYPES)[number];
  @IsOptional() @IsString() interactionId?: string;
  @IsOptional() @IsString() targetActorId?: string;
}

export class ConsentDto {
  @IsString() actorRefId!: string;
  @IsIn(CONSENT) status!: (typeof CONSENT)[number];
}
