// ============================================================================
// Document request / response types
// Generated from:
//   honeyDueAPI-go/internal/dto/requests/document.go
//   honeyDueAPI-go/internal/dto/responses/document.go
//   honeyDueAPI-go/internal/models/document.go (DocumentType enum)
// ============================================================================

// ---------------------------------------------------------------------------
// Enums
// ---------------------------------------------------------------------------

/** Matches models.DocumentType string enum in Go. */
export type DocumentType =
  | "general"
  | "warranty"
  | "receipt"
  | "contract"
  | "insurance"
  | "manual";

// ---------------------------------------------------------------------------
// Requests
// ---------------------------------------------------------------------------

export interface CreateDocumentRequest {
  residence_id: number;
  title: string;
  description?: string;
  document_type?: DocumentType;
  file_url?: string;
  file_name?: string;
  file_size?: number | null;
  mime_type?: string;
  purchase_date?: string | null;
  expiry_date?: string | null;
  purchase_price?: string | null;
  vendor?: string;
  serial_number?: string;
  model_number?: string;
  task_id?: number | null;
  image_urls?: string[];
}

export interface UpdateDocumentRequest {
  title?: string | null;
  description?: string | null;
  document_type?: DocumentType | null;
  file_url?: string | null;
  file_name?: string | null;
  file_size?: number | null;
  mime_type?: string | null;
  purchase_date?: string | null;
  expiry_date?: string | null;
  purchase_price?: string | null;
  vendor?: string | null;
  serial_number?: string | null;
  model_number?: string | null;
  task_id?: number | null;
}

// ---------------------------------------------------------------------------
// Responses
// ---------------------------------------------------------------------------

export interface DocumentUserResponse {
  id: number;
  username: string;
  first_name: string;
  last_name: string;
}

export interface DocumentImageResponse {
  id: number;
  image_url: string;
  media_url: string;
  caption: string;
}

export interface DocumentResponse {
  id: number;
  residence_id: number;
  residence: number;
  created_by_id: number;
  created_by?: DocumentUserResponse | null;
  title: string;
  description: string;
  document_type: DocumentType;
  file_url: string;
  media_url: string;
  file_name: string;
  file_size: number | null;
  mime_type: string;
  purchase_date: string | null;
  expiry_date: string | null;
  purchase_price: string | null;
  vendor: string;
  serial_number: string;
  model_number: string;
  task_id: number | null;
  is_active: boolean;
  images: DocumentImageResponse[];
  created_at: string;
  updated_at: string;
}
