/**
 * Auth API Types - Mirror backend schemas
 */

import type { GlobalUserRole } from '../../types/roles';

export interface User {
  id: string;
  email: string;
  full_name: string;
  is_active: boolean;
  is_verified: boolean;
  created_at: string;
  last_login?: string;
  phone?: string;
  language?: string;
  timezone?: string;
  tenant_id?: string;
  role?: GlobalUserRole;
}

export interface UserRegistration {
  email: string;
  password: string;
  full_name: string;
  tenant_name?: string;
  phone?: string;
  language?: string;
  timezone?: string;
}

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

export interface TokenResponse {
  access_token: string;
  refresh_token?: string;
  token_type: string;
  expires_in?: number;
  user?: User;
}

export interface RefreshTokenRequest {
  refresh_token: string;
}

export interface PasswordChange {
  current_password: string;
  new_password: string;
}

export interface PasswordReset {
  email: string;
}

export interface UserResponse {
  id: string;
  email: string;
  full_name: string;
  is_active: boolean;
  is_verified: boolean;
  created_at: string;
  last_login?: string;
  phone?: string;
  language?: string;
  timezone?: string;
  tenant_id?: string;
  role?: GlobalUserRole;
}

export interface UserUpdate {
  full_name?: string;
  phone?: string;
  language?: string;
  timezone?: string;
}

export interface TokenVerificationResponse {
  valid: boolean;
  user_id?: string;
  email?: string;
  role?: GlobalUserRole;
  exp?: number;
  message?: string;
}

export interface AuthHealthResponse {
  status: string;
  service: string;
  version: string;
  features: string[];
}