<?php

namespace App\Modules\AdminSession\Infrastructure;

use App\Modules\AdminSession\Domain\AdminSessionRepository;
use App\Modules\Shared\Application\ActionHandler;
use Illuminate\Support\Facades\DB;

class MysqlAdminSessionRepository implements AdminSessionRepository
{

    public function __construct(
    ) {
    }

    public function current(string $token)
    {
        return (new ActionHandler())->handle(DB::select(
            'call sp_admin_session_get(?,?)',
            [
                $token,
                ''
            ]
        ));
    }
}
