// Shared input shapes for the Gesamtprojekt-Export (Demo-067 C, KAR-982) —
// used by both project-docx.ts and project-xlsx.ts so the two builders stay
// in sync on what a "project export" actually contains. Deliberately plain
// data (no Supabase/Agenda-domain types) so this module stays DB-free (ADR
// 019) — the server action maps DB rows / lib/agenda's Agenda type into this
// shape.

export interface ProjectExportStammdaten {
  supplierName: string
  plantLocation: string | null
  productName: string | null
  projectCode: string | null
  vehicleProject: string | null
  productLine: string | null
  visitDate: string | null
  orderReceivedDate: string | null
  expectedEndDate: string | null
  customerTaktTimeSec: number | null
  targetCycleTimeSec: number | null
  plannedOee: number | null
  notes: string | null
  isDemo: boolean
}

export interface ProjectExportAgendaItem {
  startTime: string | null
  endTime: string | null
  title: string
  responsible: string | null
  location: string | null
}

export interface ProjectExportAgendaDay {
  title: string | null
  date: string | null
  items: ProjectExportAgendaItem[]
}

export interface ProjectExportAgenda {
  title: string
  language: string
  status: string
  days: ProjectExportAgendaDay[]
}

export interface ProjectExportWorkshopAction {
  actionNumber: number
  area: string
  description: string
  effort: string
  benefit: string
  status: string
  responsible: string | null
  targetDate: string | null
}

/** One short-form rollup per module (FA/QAF/Wertstrom/LSC) — "Kurzfassungen
 * der Modul-Stände" per the task spec. Intentionally light: counts + a few
 * label lines, not a full recomputation of each module's own metrics. */
export interface ProjectExportModuleSummary {
  label: string
  countLabel: string
  items: readonly string[]
}

export interface ProjectExportInput {
  stammdaten: ProjectExportStammdaten
  agendas: readonly ProjectExportAgenda[]
  workshopActions: readonly ProjectExportWorkshopAction[]
  moduleSummaries: readonly ProjectExportModuleSummary[]
  generatedAtLabel: string
}
