<?php

declare(strict_types=1);

/*
 * Chill is a software for social workers
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Chill\TicketBundle\Repository;

use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserGroup;
use Chill\PersonBundle\Entity\Person;
use Chill\TicketBundle\Entity\EmergencyStatusEnum;
use Chill\TicketBundle\Entity\Motive;
use Chill\TicketBundle\Entity\StateEnum;
use Chill\TicketBundle\Entity\Ticket;

/**
 * Repository to find tickets, taking care of permissions.
 *
 * @phpstan-type TicketACLAwareRepositoryParam array{byPerson?: list<Person>, byCurrentState?: list<StateEnum>, byCurrentStateEmergency?: list<EmergencyStatusEnum>, byMotives?: list<Motive>, byCreatedBefore?: \DateTimeImmutable, byCreatedAfter?: \DateTimeImmutable, byAddressee?: list<User>, byAddresseeGroup?: list<UserGroup>, byCreator?: list<User>, byTicketId?: int, byPersonCenter?: list<Center>}
 */
interface TicketACLAwareRepositoryInterface
{
    /**
     * Find tickets.
     *
     * @param TicketACLAwareRepositoryParam $params
     *
     * @return list<Ticket>
     */
    public function findTickets(array $params, int $start = 0, int $limit = 100): array;

    /**
     * Find tickets.
     *
     * @param TicketACLAwareRepositoryParam $params
     */
    public function countTickets(array $params): int;
}
