/**
 * Google Calendar and Meet Integration Types
 *
 * Type definitions for Google Calendar API integration with Google Meet
 */

/**
 * Demo booking event data for Google Calendar
 */
export interface DemoBookingEventData {
  id: string;
  fullName: string;
  email: string;
  telephone: string;
  appointmentDate: string; // YYYY-MM-DD format
  appointmentTime: string; // HH:MM format
  duration: string; // e.g., "30", "60"
  language: 'ar' | 'en';
  timezone: string; // IANA timezone (e.g., "Asia/Qatar")
  specialRequirements?: string;
}

/**
 * Result from creating a Google Calendar event
 */
export interface CalendarEventResult {
  success: boolean;
  eventId?: string;
  hangoutLink?: string; // Google Meet link
  conferenceId?: string; // Google Meet conference ID
  htmlLink?: string; // Calendar event link
  error?: string;
}

/**
 * Google Calendar service account configuration
 */
export interface GoogleCalendarConfig {
  enabled: boolean;
  serviceAccountEmail?: string;
  serviceAccountKey?: string; // Base64-encoded JSON key
  calendarId?: string;
  impersonatedUser?: string; // For domain-wide delegation
}

/**
 * Google Calendar event creation options
 */
export interface CreateEventOptions {
  summary: string;
  description: string;
  start: {
    dateTime: string; // ISO 8601 format
    timeZone: string;
  };
  end: {
    dateTime: string; // ISO 8601 format
    timeZone: string;
  };
  attendees?: Array<{ email: string; displayName?: string }>;
  conferenceData?: {
    createRequest: {
      requestId: string;
      conferenceSolutionKey: { type: 'hangoutsMeet' };
    };
  };
  reminders?: {
    useDefault: boolean;
    overrides?: Array<{
      method: 'email' | 'popup';
      minutes: number;
    }>;
  };
}
