<?php

declare(strict_types=1);

namespace App\Contracts\Services;

use App\Models\VerificationCode;

interface VerificationCodeServiceInterface
{
    public function generate(string $email, string $type, int $expiresInMinutes = 15): VerificationCode;

    public function validate(string $email, string $code, string $type): ?VerificationCode;

    public function markAsUsed(VerificationCode $verificationCode): void;

    public function cleanup(): int;

    public function canRequestNewCode(string $email, string $type): bool;

    public function getRecentCodesCount(string $email, string $type, int $hours = 1): int;
}
