<?php

declare(strict_types=1);

namespace App\Module\TimeTracking\Domain\Repository;

use App\Module\TimeTracking\Domain\Entity\TimeEntry;
use App\Shared\Domain\Contract\ProjectInterface;
use App\Shared\Domain\Contract\UserInterface;
use DateTimeImmutable;
use Doctrine\ORM\QueryBuilder;

interface TimeEntryRepositoryInterface
{
    public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder;

    public function findById(int $id): ?TimeEntry;

    public function findActiveByUser(UserInterface $user): ?TimeEntry;

    /**
     * @param null|UserInterface[]    $users
     * @param null|ProjectInterface[] $projects
     * @param null|int[]              $tagIds
     *
     * @return TimeEntry[]
     */
    public function findForExport(
        DateTimeImmutable $after,
        DateTimeImmutable $before,
        ?array $users = null,
        ?array $projects = null,
        ?array $tagIds = null,
    ): array;
}
