// Types mirroring the FastAPI backend responses.

export interface User {
  id: number
  username: string
  email: string | null
  email_verified: number
}

export type RoomRole = "owner" | "admin" | "member"

export interface Room {
  id: number
  name: string
  owner_id: number
  invite_code: string
  role: RoomRole
}

export interface RoomMember {
  id: number
  username: string
  role: RoomRole
}

export type EventType = "private" | "busy" | "proposal"
export type EventVisibility = "private" | "busy_only" | "room"
export type EventStatus = "draft" | "proposed" | "confirmed" | "cancelled"

export interface CalendarEvent {
  id: number
  room_id: number
  creator_id: number
  type: EventType
  title: string
  description: string | null
  start_time: string
  end_time: string
  visibility: EventVisibility
  status: EventStatus
  min_people: number
  invitation_mode?: string
}

export type SignupStatus = "going" | "maybe" | "declined"

export interface EventResponse {
  event_id: number
  user_id: number
  status: SignupStatus
  username?: string
}

export interface RoomPermissions {
  room_id: number
  user_id: number
  member: boolean
  role: RoomRole | null
  is_admin: boolean
  is_owner: boolean
}
