feat(notification) : notifier les collaborateurs ajoutés à une tâche

This commit is contained in:
Matthieu
2026-06-15 11:45:01 +02:00
parent 390f2a40a8
commit 9e63f3d268
2 changed files with 46 additions and 0 deletions
@@ -57,6 +57,22 @@ final class TaskNotificationListener
$this->pending[] = ['user' => $new, 'type' => 'task_assigned', 'task' => $entity];
}
}
// Ajout de collaborateur(s) (tâche nouvelle ou existante).
foreach ($uow->getScheduledCollectionUpdates() as $collection) {
$owner = $collection->getOwner();
if (!$owner instanceof Task) {
continue;
}
if ('collaborators' !== $collection->getMapping()->fieldName) {
continue;
}
foreach ($collection->getInsertDiff() as $user) {
if ($user instanceof User && $user !== $actor) {
$this->pending[] = ['user' => $user, 'type' => 'task_collaborator_added', 'task' => $owner];
}
}
}
}
public function postFlush(PostFlushEventArgs $args): void