This commit is contained in:
Marek Lenczewski
2026-03-31 18:09:15 +02:00
parent b6a4548732
commit b998940caa
48 changed files with 717 additions and 816 deletions

View File

@@ -24,14 +24,12 @@ class TaskSchemaRepository extends ServiceEntityRepository
public function findActiveSchemasInRange(\DateTimeInterface $from, \DateTimeInterface $to): array
{
return $this->createQueryBuilder('t')
->where('t.status != :excluded')
->andWhere(
'(t.taskType = :einzel AND (t.deadline IS NULL OR (t.deadline >= :from AND t.deadline <= :to)))'
. ' OR '
. '(t.taskType != :einzel AND t.startDate <= :to AND (t.endDate IS NULL OR t.endDate >= :from))'
)
->setParameter('excluded', TaskSchemaStatus::Inactive)
->setParameter('einzel', TaskSchemaType::Single->value)
->where('t.status = :active')
->andWhere('t.taskType IN (:types)')
->andWhere('t.startDate <= :to')
->andWhere('t.endDate IS NULL OR t.endDate >= :from')
->setParameter('active', TaskSchemaStatus::Active)
->setParameter('types', [TaskSchemaType::Daily, TaskSchemaType::Custom])
->setParameter('from', $from)
->setParameter('to', $to)
->getQuery()