export type TelematicsProductCategory =
  | "boitier"
  | "module"
  | "capteur"
  | "accessoire";

export interface TelematicsProductSpec {
  key: string;
  value: string;
}

export interface TelematicsProduct {
  id: number;
  sku: string;
  category: TelematicsProductCategory;
  name: string;
  description: string | null;
  price: number;
  stock_quantity: number;
  is_active: boolean;
  needs_covered: string[];
  specifications: TelematicsProductSpec[];
}

export interface CreateTelematicsProductPayload {
  sku: string;
  category: TelematicsProductCategory;
  name: string;
  description?: string;
  price: number;
  stock_quantity: number;
  is_active: boolean;
  needs_covered: string[];
  specifications: TelematicsProductSpec[];
}

export type UpdateTelematicsProductPayload = Partial<CreateTelematicsProductPayload>;

export interface TelematicsCatalogStats {
  products: number;
  active: number;
  out_of_stock: number;
  stock_value: number;
}

/** Predefined list shown as toggle pills in the product dialog. */
export const TELEMATICS_NEEDS_SUGGESTIONS: string[] = [
  "Géolocalisation temps réel",
  "Odomètre exact",
  "Coupure moteur à distance",
  "Éco-conduite",
  "Consommation de carburant",
  "Température/Humidité",
  "Autopartage",
  "Identification conducteur",
  "Bus CAN",
  "Anti-vol",
  "Maintenance prédictive",
];

export const TELEMATICS_PRODUCT_CATEGORIES: TelematicsProductCategory[] = [
  "boitier",
  "module",
  "capteur",
  "accessoire",
];
