23 lines
583 B
PHP
23 lines
583 B
PHP
<?php
|
|
|
|
namespace App\Domain\ReportDuty\Actions;
|
|
|
|
use App\Domain\ReportDuty\Contracts\ReportDutyRepositoryInterface;
|
|
use App\Domain\ReportDuty\DTO\CreateReportDutyDto;
|
|
use App\Domain\ReportDuty\Events\ReportDutyCreated;
|
|
use App\Domain\ReportDuty\Models\ReportDuty;
|
|
use App\Models\User;
|
|
use App\Services\DateRange;
|
|
|
|
class CreateReportDutyAction
|
|
{
|
|
public function __construct(
|
|
protected ReportDutyRepositoryInterface $repository,
|
|
) {}
|
|
|
|
public function execute(CreateReportDutyDto $dto): ReportDuty
|
|
{
|
|
return $this->repository->findOrCreate($dto);
|
|
}
|
|
}
|