<?php

namespace App\Support;

class RequestContext
{
    private ?string $tenantId = null;
    private ?string $tenantKey = null;
    private ?string $userId = null;
    private array $roles = [];

    public function setTenant(?string $tenantId, ?string $tenantKey = null): void
    {
        $this->tenantId = $tenantId;
        $this->tenantKey = $tenantKey;
    }

    public function tenantId(): ?string
    {
        return $this->tenantId;
    }

    public function tenantKey(): ?string
    {
        return $this->tenantKey;
    }

    public function setUser(?string $userId, array $roles = []): void
    {
        $this->userId = $userId;
        $this->roles = $roles;
    }

    public function userId(): ?string
    {
        return $this->userId;
    }

    public function roles(): array
    {
        return $this->roles;
    }
}
