// ── Web Calendar Types ──────────────────────────────────────────────
// Core calendar event types used across the CRM system, including
// event classification, status tracking, and participant metadata.

/** Possible types of calendar events — triggered by different CRM workflows. */
export type EventType = "call" | "follow_up" | "website_creation"

/** Lifecycle state of a calendar event. */
export type EventStatus = "scheduled" | "completed" | "cancelled" | "rescheduled"

/** A single calendar entry linking a user, participant, developer, and optional lead/conversation. */
export interface CalendarEvent {
  id: string
  userId: string
  participantId: string | null
  developerId: string | null
  leadId: string | null
  conversationId: string | null
  title: string
  description: string | null
  participantNotes: string | null
  eventType: EventType
  startTime: string
  endTime: string | null
  durationMinutes: number | null
  status: EventStatus
  // Denormalized user references for display (avoid extra joins in list views)
  creator: { id: string; name: string; email?: string; role?: string; avatar?: string } | null
  participant: { id: string; name: string; email?: string; role?: string; avatar?: string } | null
  developer: { id: string; name: string; email?: string; role?: string; avatar?: string } | null
  lead: { id: string; companyName: string; contactName: string } | null
  clientName: string | null
  clientEmail: string | null
  clientPhone: string | null
  createdAt: string
}
