<?php

declare(strict_types=1);

namespace ApiModel\Domain\Repository;

interface RefreshTokenRepositoryInterface
{
    public function insert(string $userId, string $tokenHash, string $expiresAt): void;

    /**
     * Fila de sesión válida para rotación de refresh token.
     *
     * @return array<string, mixed>|null claves: id (token), uid, name, email, role, language, is_active, expires_at
     */
    public function findValidSessionByTokenHash(string $tokenHash): ?array;

    public function revokeByTokenId(string $tokenId): void;

    public function revokeByUserIdAndTokenHash(string $userId, string $tokenHash): void;

    public function revokeAllForUser(string $userId): void;
}
