export type MobileUser = {
  id: number;
  email: string;
  name: string;
  role: string;
  user_type: string;
  // Champs profil enrichis par /mobile/me.php (optionnels : absents sur une
  // instance non mise a jour).
  telephone?: string | null;
  numero_habilitation_fluide?: string | null;
  date_etalonage_detection_fuite?: string | null;
  date_etalonage_capteur_temperature?: string | null;
  date_etalonage_balance?: string | null;
};

export type LoginData = {
  access_token: string;
  token_type: string;
  expires_in: number;
  refresh_token: string;
  refresh_expires_in: number;
  user: MobileUser;
};

export type RefreshData = {
  access_token: string;
  token_type: string;
  expires_in: number;
  refresh_token: string;
  refresh_expires_in: number;
  user: MobileUser;
};

export type ApiEnvelope<T> = {
  success: boolean;
  message?: string;
  data?: T;
};
