<?php

declare(strict_types=1);

final class AuthService
{
    public static function findUserByEmail(string $email): ?array
    {
        $pdo = Api::pdo();
        $stmt = $pdo->prepare('SELECT user_id, email, password_hash, full_name, user_type, is_active FROM users WHERE email = :email LIMIT 1');
        $stmt->execute(['email' => $email]);
        $row = $stmt->fetch();

        return $row ? (array)$row : null;
    }
}
