Set type upon creation of automatic notifications

This commit is contained in:
2025-06-18 14:30:23 +02:00
parent bef5dcce14
commit 0a19255a22
3 changed files with 9 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\AccompanyingPeriod\Events;
use Chill\MainBundle\Entity\Notification;
use Chill\MainBundle\Entity\NotificationEnum;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Notification\NotificationPersisterInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
@@ -73,7 +74,8 @@ class UserRefEventSubscriber implements EventSubscriberInterface
'accompanyingCourse' => $period,
]
))
->addAddressee($period->getUser());
->addAddressee($period->getUser())
->setType(NotificationEnum::REFERRER_ACC_COURSE);
$this->notificationPersister->persist($notification);
}