<?php
namespace App\UseCase\Wage\Event;
use App\System\Infrastructure\Implementation\DataAccess\PaymentPercent\PaymentPercentRepository;
use App\UseCase\Wage\Write\Creation\CreationHandler;
use App\UseCase\Wage\Write\Creation\CreationDto;
use JetBrains\PhpStorm\Deprecated;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
#[Deprecated(reason: "INS-4780")]
class EventSubscriber implements EventSubscriberInterface
{
public function __construct(
private readonly CreationHandler $wageCreation,
private readonly PaymentPercentRepository $paymentPercentRepository,
) {}
public static function getSubscribedEvents(): array
{
return [
RecalculateWageEvent::NAME => 'onRecalculate',
];
}
public function onRecalculate(RecalculateWageEvent $event): void
{
// $wage = $event->getWage();
// $percent = $this->paymentPercentRepository->findOneByPeriodDateAndUser(
// $wage->getReportingPeriod()->getStartDt(), $wage->getInsUserId()
// );
//
// $this->wageCreation->handle(new CreationDto(
// $wage->getInsUserId(),
// $wage->getInsUserRole(),
// $percent ? ($percent->getCustomPaymentPercent() ?: $percent->getPaymentPercent()) : 0,
// $wage->getReportingPeriod(),
// $wage->getStatus(),
// wage: $wage
// ));
}
}