using Tiku.Application.PlatformAdmin;
using Tiku.Application.Security;

namespace Tiku.Api.Controllers;

public sealed class PlatformAdminActorResolver(ICurrentUser currentUser)
{
    internal PlatformAdminActor Resolve()
    {
        if (currentUser.UserId is not { } userId)
            throw new PlatformAdminException("Platform admin actor was not resolved.", "platform_access_denied");

        return new PlatformAdminActor(userId);
    }
}
