68 lines
2.0 KiB
PHP
68 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Jobs\Application\Contracts;
|
|
|
|
use App\Modules\Jobs\Application\DTOs\BookableTask;
|
|
use App\Modules\Jobs\Application\DTOs\TaskSummary;
|
|
|
|
interface TaskQueries
|
|
{
|
|
/**
|
|
* The job's tasks: open ones by due date (none last), then done ones.
|
|
*
|
|
* @return list<TaskSummary>
|
|
*/
|
|
public function tasksOf(int $jobId): array;
|
|
|
|
/**
|
|
* Which of the job's tasks are pinned to the Kanban board, by task id.
|
|
*
|
|
* @return array<int, bool>
|
|
*/
|
|
public function pinnedTaskIds(int $jobId): array;
|
|
|
|
/**
|
|
* Tasks scheduled for the user between the dates (Y-m-d): booked on
|
|
* their task calendar row, or open tasks they are the assignee or a
|
|
* member of whose planned period overlaps the dates or that have no
|
|
* planned period at all (so unscheduled own work is never hidden).
|
|
*
|
|
* @return list<int>
|
|
*/
|
|
public function scheduledTaskIdsFor(int $userId, string $from, string $to): array;
|
|
|
|
/**
|
|
* Null when the task does not exist or belongs to another job.
|
|
*/
|
|
public function findTask(int $jobId, int $taskId): ?TaskSummary;
|
|
|
|
/**
|
|
* A task as time is recorded on it, or null when there is no such task.
|
|
*/
|
|
public function bookableTask(int $taskId): ?BookableTask;
|
|
|
|
/**
|
|
* @param list<int> $taskIds
|
|
* @return list<BookableTask> In job number, then task id order.
|
|
*/
|
|
public function bookableTasks(array $taskIds): array;
|
|
|
|
/**
|
|
* Ids of tasks assigned to the user that are not done, on jobs that are
|
|
* not locked.
|
|
*
|
|
* @return list<int>
|
|
*/
|
|
public function assignedOpenTaskIds(int $userId): array;
|
|
|
|
/**
|
|
* Tasks on unlocked jobs whose job number, job name or task name
|
|
* contains the term; only jobs the user is a member of when given.
|
|
*
|
|
* @return list<BookableTask>
|
|
*/
|
|
public function searchBookableTasks(string $term, ?int $onlyMemberUserId = null, int $limit = 8): array;
|
|
}
|