feat: hide past assignments by default, include via filtersetting
This commit is contained in:
@@ -110,6 +110,13 @@ class AssignmentRepository extends ServiceEntityRepository
|
||||
|
||||
private function applyFilterSettings(AssignmentFilterDto $filterDto, QueryBuilder $qb): void
|
||||
{
|
||||
if (false === $filterDto->isIncludePast()) {
|
||||
$qb
|
||||
->andWhere($qb->expr()->gte('destination.dateFrom', ':now'))
|
||||
->setParameter('now', new \DateTimeImmutable())
|
||||
;
|
||||
}
|
||||
|
||||
if (null !== $status = $filterDto->getStatus()) {
|
||||
switch ($status) {
|
||||
case Assignment::STATUS_STAFFED:
|
||||
|
||||
Reference in New Issue
Block a user