<?php

declare(strict_types=1);

namespace App\Administration\Domain\Repository;

use App\Administration\Domain\Model\ActivationToken\ActivationToken;
use App\Administration\Domain\Model\ActivationToken\ActivationTokenId;

interface ActivationTokenRepository
{
    public function save(ActivationToken $token): void;

    /**
     * Find a token by its unique token value.
     */
    public function findByTokenValue(string $tokenValue): ?ActivationToken;

    /**
     * Get a token by its ID.
     *
     * @throws \App\Administration\Domain\Exception\ActivationTokenNotFoundException if token does not exist
     */
    public function get(ActivationTokenId $id): ActivationToken;

    /**
     * Delete a token (after use or for cleanup).
     */
    public function delete(ActivationTokenId $id): void;

    /**
     * Delete a token by its token value.
     */
    public function deleteByTokenValue(string $tokenValue): void;
}
