<?php

namespace NoahVet\Reef\Application\Query;

class GetAllQuery implements GetAllQueryInterface
{
    /**
     * @param class-string                                                               $entityFQCN
     * @param array{filters: mixed, keywords: mixed, permissions: mixed, sorting: mixed} $context
     */
    public function __construct(
        private readonly string $entityFQCN,
        private readonly array $context,
    ) {
    }

    #[\Override]
    public function objectFQCN(): string
    {
        return $this->entityFQCN;
    }

    /**
     * @return array<string, mixed>
     */
    #[\Override]
    public function filters(): array
    {
        return $this->context['filters'];
    }

    /**
     * @return array<string, mixed>
     */
    #[\Override]
    public function permissions(): array
    {
        return $this->context['permissions'];
    }

    /**
     * @return array<string, mixed>
     */
    #[\Override]
    public function sorting(): array
    {
        return $this->context['sorting'];
    }
}
