// frontend/lib/calendar/types.ts — phase-8 일정/회의 타입 (backend schemas.py 와 1:1)
import type { Tone, Task } from "@/lib/types"; // phase-3 재사용

export interface Calendar {
  id: string;
  name: string;
  tone: Tone;
  on: boolean;
  count: number;
}

export interface EventAction {
  text: string;
  when: string;
}

export interface CalEvent {
  id: string;
  day: number;
  start: string;
  end: string;
  title: string;
  cal: string;
  loc: string;
  note: string;
  soon: boolean;
  people: string[];
  actions: EventAction[];
  has_meeting: boolean;
  meet_label: string;
}

export interface FocusBlock {
  id: string;
  day: number;
  start: string;
  end: string;
  title: string;
  type: "light" | "deep";
  tag: string;
  task_id: string | null;
  auto: boolean;
}

export interface MeetingAction {
  id: string;
  idx: number;
  text: string;
  who: string;
  when: string;
  added: boolean;
  materialized_task_id: string | null;
}

export interface Meeting {
  id: string;
  event_id: string;
  phase: "done" | "live" | "upcoming";
  one_on_one: boolean;
  meta: string;
  starts_in: string;
  summary: string[];
  decisions: string[];
  agenda: string[];
  last_meeting: { when?: string; note?: string };
  last_actions: { text: string; who: string; done: boolean }[];
  insights: string[];
  docs: string[];
  person: { name?: string; initial?: string; tone?: Tone };
  promises: { text: string; done: boolean }[];
  signals: { k: string; v: string; tone: Tone }[];
  talking_points: string[];
  actions: MeetingAction[];
}

export interface WeekBundle {
  today: number;
  week: number[];
  weekdays: string[];
  calendars: Calendar[];
  events: CalEvent[];
  focus_blocks: FocusBlock[];
}

export interface DayBundle {
  day: number;
  events: CalEvent[];
  focus_blocks: FocusBlock[];
}

export interface MaterializeResult {
  action: MeetingAction;
  task: Task | null;
  all_added: boolean;
}
