// Phòng họp + Booking (Phase 10.2 G-O2 — Mig 36, S36 2026-05-28).
// Mirror BE Application/Office/MeetingFeatures.cs DTOs.
// File này MIRROR SHA256 identical với fe-user/src/types/meeting.ts.

// 3-state lifecycle Booking — mirror BE MeetingBookingStatus enum (Domain/Office).
export const MeetingBookingStatus = {
  Confirmed: 1,
  Cancelled: 2,
  Completed: 3,
} as const
export type MeetingBookingStatusValue = (typeof MeetingBookingStatus)[keyof typeof MeetingBookingStatus]

// ===== MeetingRoom (catalog) =====

export interface MeetingRoomDto {
  id: string
  code: string
  name: string
  capacity: number
  location: string | null
  equipment: string | null
  isActive: boolean
  createdAt: string
}

export interface MeetingRoomCreateInput {
  code: string
  name: string
  capacity: number
  location?: string | null
  equipment?: string | null
}

export interface MeetingRoomUpdateInput extends MeetingRoomCreateInput {
  isActive: boolean
}

// ===== MeetingBooking (booking + attendees N-to-N join) =====

export interface MeetingBookingAttendeeDto {
  userId: string
  fullName: string
  email: string | null
  notes: string | null
}

export interface MeetingBookingDto {
  id: string
  roomId: string
  roomCode: string
  roomName: string
  bookedByUserId: string
  bookedByFullName: string
  startAt: string
  endAt: string
  title: string
  description: string | null
  status: MeetingBookingStatusValue
  note: string | null
  createdAt: string
  attendees: MeetingBookingAttendeeDto[]
}

export interface AttendeeInput {
  userId: string
  notes?: string | null
}

export interface MeetingBookingCreateInput {
  roomId: string
  startAt: string
  endAt: string
  title: string
  description?: string | null
  note?: string | null
  attendees: AttendeeInput[]
}

export interface MeetingBookingUpdateInput {
  id: string
  roomId: string
  startAt: string
  endAt: string
  title: string
  description?: string | null
  note?: string | null
  attendees: AttendeeInput[]
}
