<?php

declare(strict_types=1);

namespace apexl\Io\modules\user\interfaces;

use apexl\Io\exceptions\RecordNotFoundException;
use apexl\Io\modules\user\Dtos\SessionDto;
use apexl\Io\modules\user\exceptions\SessionException;

interface SessionManagerInterface
{
    public function endSession(): void;


    /**
     * @throws RecordNotFoundException
     */
    public function forSessionId(string $sessionId): SessionDto;

    public function create(int $userId, string $sessionId): SessionDto;

    /**
     * @throws SessionException
     */
    public function current(): ?SessionDto;

    /**
     * @throws SessionException
     */
    public function addDataToCurrentSession(array $data);
}