Use enums in flag providers and rename NotificationEnum to NotificationFlagEnum

This commit is contained in:
2025-06-18 15:24:12 +02:00
parent acad9d1553
commit cf391d60fe
14 changed files with 35 additions and 28 deletions

View File

@@ -2,6 +2,7 @@
namespace Chill\MainBundle\Notification\FlagProviders;
use Chill\MainBundle\Entity\NotificationFlagEnum;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
@@ -10,7 +11,7 @@ class AccompanyingCourseNotificationFlagProvider implements NotificationFlagProv
public function getFlag(): string
{
return 'acc-course-notif';
return NotificationFlagEnum::ACC_COURSE->value;
}
public function getLabel(): TranslatableInterface

View File

@@ -2,19 +2,20 @@
namespace Chill\MainBundle\Notification\FlagProviders;
use Chill\MainBundle\Entity\NotificationFlagEnum;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
class AccompanyingCourseWorkEvalNotificationFlagProvider implements NotificationFlagProviderInterface
class AccompanyingCourseWorkEvalDocNotificationFlagProvider implements NotificationFlagProviderInterface
{
public function getFlag(): string
{
return 'acc-course-work-eval-notif';
return NotificationFlagEnum::ACC_COURSE_WORK_EVAL_DOC->value;
}
public function getLabel(): TranslatableInterface
{
return new TranslatableMessage('notification.flags.acc-course-work-eval');
return new TranslatableMessage('notification.flags.acc-course-work-eval-doc');
}
}

View File

@@ -2,6 +2,7 @@
namespace Chill\MainBundle\Notification\FlagProviders;
use Chill\MainBundle\Entity\NotificationFlagEnum;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
@@ -10,7 +11,7 @@ class AccompanyingCourseWorkNotificationFlagProvider implements NotificationFlag
public function getFlag(): string
{
return 'acc-course-work-notif';
return NotificationFlagEnum::ACC_COURSE_WORK->value;
}
public function getLabel(): TranslatableInterface

View File

@@ -2,6 +2,7 @@
namespace Chill\MainBundle\Notification\FlagProviders;
use Chill\MainBundle\Entity\NotificationFlagEnum;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
@@ -10,7 +11,7 @@ class ActivityNotificationFlagProvider implements NotificationFlagProviderInterf
public function getFlag(): string
{
return 'activity-notif';
return NotificationFlagEnum::ACTIVITY->value;
}
public function getLabel(): TranslatableInterface

View File

@@ -2,6 +2,7 @@
namespace Chill\MainBundle\Notification\FlagProviders;
use Chill\MainBundle\Entity\NotificationFlagEnum;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
@@ -10,7 +11,7 @@ class DesignatedReferrerNotificationFlagProvider implements NotificationFlagProv
public function getFlag(): string
{
return 'referrer-acc-course-notif';
return NotificationFlagEnum::REFERRER_ACC_COURSE->value;
}
public function getLabel(): TranslatableInterface

View File

@@ -2,6 +2,7 @@
namespace Chill\MainBundle\Notification\FlagProviders;
use Chill\MainBundle\Entity\NotificationFlagEnum;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
@@ -10,7 +11,7 @@ class PersonAddressMoveNotificationFlagProvider implements NotificationFlagProvi
public function getFlag(): string
{
return 'person-address-move-notif';
return NotificationFlagEnum::PERSON_MOVE->value;
}
public function getLabel(): TranslatableInterface

View File

@@ -2,6 +2,7 @@
namespace Chill\MainBundle\Notification\FlagProviders;
use Chill\MainBundle\Entity\NotificationFlagEnum;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
@@ -10,7 +11,7 @@ class WorkflowTransitionNotificationFlagProvider implements NotificationFlagProv
public function getFlag(): string
{
return 'workflow-trans-notif';
return NotificationFlagEnum::WORKFLOW_TRANS->value;
}
public function getLabel(): TranslatableInterface