feat: additional functionality and layout adjustments for season teamers
This commit is contained in:
1 parent
80c6016da3
commit
4cab57d136
30 files changed
+916
-192
No files matched your search
@@ -44,6 +44,47 @@ class SeasonAssignmentTaskRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* The rows a newly deposited library document may still be copied onto: the entry is not
|
||||
* ticked off yet and its assignment has not ended.
|
||||
*
|
||||
* A finished entry keeps what it handed out - that is the whole point of the row carrying its
|
||||
* own document - and so does an assignment that is over, whether or not every entry on it was
|
||||
* ticked.
|
||||
*
|
||||
* @return SeasonAssignmentTask[]
|
||||
*/
|
||||
public function findOpenForTask(string $taskKey, \DateTimeImmutable $today): array
|
||||
{
|
||||
return $this
|
||||
->createOpenForTaskQueryBuilder($taskKey, $today)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracted like createOpenQueryBuilder() below, so a test can pin the conditions by
|
||||
* compiling the DQL rather than by persisting rows.
|
||||
*/
|
||||
public function createOpenForTaskQueryBuilder(string $taskKey, \DateTimeImmutable $today): QueryBuilder
|
||||
{
|
||||
$qb = $this->createQueryBuilder('task');
|
||||
|
||||
return $qb
|
||||
->innerJoin('task.seasonAssignment', 'season_assignment')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('task.taskKey', ':taskKey'),
|
||||
$qb->expr()->eq('task.done', ':done'),
|
||||
$qb->expr()->gte('season_assignment.dateTo', ':today'),
|
||||
$qb->expr()->isNull('season_assignment.deletedAt')
|
||||
))
|
||||
->setParameter('taskKey', $taskKey)
|
||||
->setParameter('done', false)
|
||||
->setParameter('today', $today)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracted so the conditions can be pinned by a test compiling the DQL - the suite has no
|
||||
* fixtures, so what is asserted is what the query says, not what it returns.
|
||||
|
||||
Reference in new issue
Block a user