import { UUID } from './common.types';

export interface User {
  id: UUID;
  name: string;
  email: string;
  locale: 'en' | 'ar';
  avatar_url?: string;
  company_id: UUID;
  company: Company;
  departments: Department[];
  roles: Role[];
  permissions: string[];
  is_super_admin?: boolean;
  is_active: boolean;
  last_login_at?: string;
  onboarding_completed_at?: string | null;
  onboarding_step?: string | null;
  dismissed_tours?: string[];
  created_at: string;
  updated_at: string;
}

export interface Company {
  id: UUID;
  name: string;
  domain: string;
  is_active: boolean;
  created_at: string;
  updated_at: string;
}

export interface Department {
  id: UUID;
  company_id: UUID;
  company?: Company;
  name: string;
  description?: string;
  is_active: boolean;
  created_at: string;
  updated_at: string;
}

export interface Role {
  id: number;
  name: string;
  display_name: string;
  guard_name: string;
  scope: 'global' | 'company' | 'department';
  created_at: string;
  updated_at: string;
}

export interface Permission {
  id: number;
  name: string;
  display_name: string;
  guard_name: string;
  created_at: string;
  updated_at: string;
}

export interface AuthResponse {
  access_token: string;
  token_type: string;
  user: User;
}
