<?php
namespace PaperKite\Common\EventSubscriber;
use PaperKite\Common\Event\TicketCreatedEvent;
use PaperKite\Common\Service\ActivityLogWriterService;
use PaperKite\CompanyApi\Event\MemberApplicationCompanyStatusChangedEvent;
use PaperKite\EmployeeApi\Event\ActivityLogEventInterface;
use PaperKite\EmployeeApi\Event\CmcmRequestCommentAddedEvent;
use PaperKite\EmployeeApi\Event\CmcmRequestCreatedEvent;
use PaperKite\EmployeeApi\Event\CmcmRequestDepartmentChangedEvent;
use PaperKite\EmployeeApi\Event\CmcmRequestDossierTypeChangedEvent;
use PaperKite\EmployeeApi\Event\CmcmRequestEmployeeAssignedEvent;
use PaperKite\EmployeeApi\Event\CmcmRequestMemberAssociatedEvent;
use PaperKite\EmployeeApi\Event\CmcmRequestStatusChangedEvent;
use PaperKite\EmployeeApi\Event\Inquiry\InquiryDepartmentChangedEvent;
use PaperKite\EmployeeApi\Event\Inquiry\InquiryEmployeeAssignedEvent;
use PaperKite\EmployeeApi\Event\MemberApplication\MemberApplicationCommentAddedEvent;
use PaperKite\EmployeeApi\Event\MemberApplication\MemberApplicationCreatedEvent;
use PaperKite\EmployeeApi\Event\MemberApplication\MemberApplicationDecisionEmailSentEvent;
use PaperKite\EmployeeApi\Event\MemberApplication\MemberApplicationMissingDocumentEmailSentEvent;
use PaperKite\EmployeeApi\Event\MemberApplication\MemberApplicationProcessStatusChangedEvent;
use PaperKite\HealthMutualApi\Event\MemberApplicationHealthMutualStatusChangedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ActivityLogEventSubscriber implements EventSubscriberInterface
{
public function __construct(
private ActivityLogWriterService $activityLogWriterService,
) {
}
public function onActivityLogEvent(ActivityLogEventInterface $event): void
{
$this->activityLogWriterService->createActivityLog($event);
}
public static function getSubscribedEvents(): array
{
return [
CmcmRequestCreatedEvent::class => 'onActivityLogEvent',
CmcmRequestStatusChangedEvent::class => 'onActivityLogEvent',
CmcmRequestEmployeeAssignedEvent::class => 'onActivityLogEvent',
CmcmRequestDossierTypeChangedEvent::class => 'onActivityLogEvent',
CmcmRequestDepartmentChangedEvent::class => 'onActivityLogEvent',
CmcmRequestMemberAssociatedEvent::class => 'onActivityLogEvent',
CmcmRequestCommentAddedEvent::class => 'onActivityLogEvent',
InquiryDepartmentChangedEvent::class => 'onActivityLogEvent',
InquiryEmployeeAssignedEvent::class => 'onActivityLogEvent',
MemberApplicationCommentAddedEvent::class => 'onActivityLogEvent',
MemberApplicationDecisionEmailSentEvent::class => 'onActivityLogEvent',
MemberApplicationMissingDocumentEmailSentEvent::class => 'onActivityLogEvent',
MemberApplicationCreatedEvent::class => 'onActivityLogEvent',
MemberApplicationProcessStatusChangedEvent::class => 'onActivityLogEvent',
MemberApplicationHealthMutualStatusChangedEvent::class => 'onActivityLogEvent',
MemberApplicationCompanyStatusChangedEvent::class => 'onActivityLogEvent',
TicketCreatedEvent::class => 'onActivityLogEvent',
];
}
}