33 lines
792 B
PHP
33 lines
792 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Cqs\Actions\Employee;
|
|
|
|
use App\Attributes\WithoutTransaction;
|
|
use App\Contracts\Action;
|
|
use App\Contracts\ActionInput;
|
|
use App\Contracts\ActionInputEmpty;
|
|
use App\Services\EmployeeSyncService;
|
|
use Webmozart\Assert\Assert;
|
|
|
|
/**
|
|
* @implements \App\Contracts\Action<\App\Contracts\ActionInputEmpty, void>
|
|
*/
|
|
#[WithoutTransaction]
|
|
final class SynchronizeEmployeesWithArcadiaApi implements Action
|
|
{
|
|
public function __construct(
|
|
private readonly EmployeeSyncService $syncService
|
|
) {
|
|
}
|
|
|
|
/** @param \App\Contracts\ActionInputEmpty $input */
|
|
#[\Override]
|
|
public function __invoke(ActionInput $input): void
|
|
{
|
|
Assert::isAOf($input, ActionInputEmpty::class);
|
|
|
|
$this->syncService->synchronize();
|
|
}
|
|
}
|