feat : add RecurrenceHandler for auto-creating next recurring task

When a task transitions to a final status, archives the current task and creates
a new occurrence with recalculated dates. Adds TaskStatusRepository::findFirstNonFinal()
to assign the initial status to the new task.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-19 10:19:25 +01:00
parent 5a47adace5
commit b3d317284e
2 changed files with 117 additions and 0 deletions

View File

@@ -14,4 +14,16 @@ class TaskStatusRepository extends ServiceEntityRepository
{
parent::__construct($registry, TaskStatus::class);
}
public function findFirstNonFinal(): ?TaskStatus
{
return $this->createQueryBuilder('s')
->where('s.isFinal = :final')
->setParameter('final', false)
->orderBy('s.position', 'ASC')
->setMaxResults(1)
->getQuery()
->getOneOrNullResult()
;
}
}