export interface RegisterInput {
  email: string;
  password: string;
  name: string;
  firstName: string;
}

export interface LoginInput {
  email: string;
  password: string;
}

export interface User {
  id: number;
  email: string;
  roles: string[];
  isVerified: boolean;
  activeSubscription: boolean;
  appID?: string;
  name: string;
  firstName: string;
}

export interface AuthContextType {
  user: User | null;
  token: string | null;
  isAuthenticated: boolean;
  isLoading: boolean;
  login: (email: string, password: string) => Promise<void>;
  logout: () => void;
  refreshUser: () => Promise<void>;  // ← NOUVELLE MÉTHODE
}

export interface AuthResponse {
  token: string;
  user: User;
}

export interface ApiError {
  message: string;
  violations?: Array<{
    propertyPath: string;
    message: string;
  }>;
}

export interface VerifyEmailResponse {
  message: string;
  email: string;
  verified: boolean;
}

export interface LoginResponse {
  token: string;
  id: number;
  email: string;
  roles: string[];
  isVerified: boolean;
  activeSubscription: boolean;
  appID?: string;
  name: string;
  firstName: string;
}
