/**
 * Domain Repository: UserRepository
 * 
 * Repository interface for User entity operations.
 */

export interface UserCredentials {
  email: string;
  passwordHash: string;
}

export interface StoredUser {
  id: string;
  email: string;
  displayName: string;
  passwordHash: string;
  salt?: string;
  primaryDriverId?: string | undefined;
  companyId?: string | undefined;
  createdAt: Date;
}

export interface UserRepository {
  /**
   * Find user by email
   */
  findByEmail(email: string): Promise<StoredUser | null>;
  
  /**
   * Find user by ID
   */
  findById(id: string): Promise<StoredUser | null>;
  
  /**
   * Create a new user
   */
  create(user: StoredUser): Promise<StoredUser>;
  
  /**
   * Update user
   */
  update(user: StoredUser): Promise<StoredUser>;
  
  /**
   * Check if email exists
   */
  emailExists(email: string): Promise<boolean>;
}