/**
 * Tipos para o módulo de Relatórios
 */

export type ReportStatus = "draft" | "pending" | "completed" | "cancelled";

export interface Report {
  id: string;
  patient_id: string;
  order_number: string; // Gerado automaticamente: REP-YYYY-NNNN (somente leitura)
  exam: string | null;
  diagnosis: string | null;
  conclusion: string | null;
  cid_code: string | null;
  content_html: string | null;
  content_json: Record<string, unknown> | null;
  status: ReportStatus;
  requested_by: string | null;
  due_at: string | null;
  hide_date: boolean;
  hide_signature: boolean;
  created_at: string;
  updated_at: string;
  created_by: string | null;
}

export interface CreateReportInput {
  patient_id: string;
  exam?: string;
  diagnosis?: string;
  conclusion?: string;
  cid_code?: string;
  content_html?: string;
  content_json?: Record<string, unknown>;
  status?: ReportStatus;
  requested_by?: string;
  due_at?: string;
  hide_date?: boolean;
  hide_signature?: boolean;
}

export interface UpdateReportInput {
  patient_id?: string;
  exam?: string;
  diagnosis?: string;
  conclusion?: string;
  cid_code?: string;
  content_html?: string;
  content_json?: Record<string, unknown>;
  status?: ReportStatus;
  requested_by?: string;
  due_at?: string;
  hide_date?: boolean;
  hide_signature?: boolean;
}

export interface ReportFilters {
  patient_id?: string;
  status?: ReportStatus;
}
