export type ProductStatus = "active" | "warning" | "critical" | "expired";
export type EffectiveType  = "legal" | "extended" | "insurance";

export type ProductCategory =
  | "electronics" | "mobile" | "appliance" | "computer"
  | "clothing"    | "vehicle" | "furniture"  | "tool"
  | "toy"         | "digital" | "secondhand" | "other";

export interface Product {
  id: number;
  name: string;
  brand: string;
  model: string;
  category: ProductCategory;
  purchase_date: string;
  purchase_price: string | null;
  vendor: string;
  serial_number: string;
  receipt_image: string | null;
  legal_warranty_months: number;
  warranty_end_date: string;
  has_extended_warranty: boolean;
  extended_warranty_end_date: string | null;
  extended_warranty_provider: string;
  extended_warranty_notes: string;
  has_insurance: boolean;
  insurance_end_date: string | null;
  insurance_provider: string;
  insurance_policy_number: string;
  notes: string;
  is_second_hand: boolean;
  created_at: string;
  updated_at: string;
  // computed
  days_remaining: number;
  effective_end_date: string;
  effective_type: EffectiveType;
  status: ProductStatus;
  progress: number;
}

export interface DashboardStats {
  total: number;
  active: number;
  warning: number;
  critical: number;
  expired: number;
  expiringSoon: Product[];
  recentlyAdded: Product[];
}

export interface ProductFormData {
  name: string;
  brand: string;
  model: string;
  category: ProductCategory;
  purchaseDate: string;
  purchasePrice: string;
  vendor: string;
  serialNumber: string;
  receiptImage: string | null;
  legalWarrantyMonths: number;
  warrantyEndDate: string;
  hasExtendedWarranty: boolean;
  extendedWarrantyEndDate: string;
  extendedWarrantyProvider: string;
  extendedWarrantyNotes: string;
  hasInsurance: boolean;
  insuranceEndDate: string;
  insuranceProvider: string;
  insurancePolicyNumber: string;
  notes: string;
  isSecondHand: boolean;
  purchaseDocumentId?: number | null;
  purchaseDocumentLineId?: number | null;
}
