test create plan with request
This commit is contained in:
parent
de744c9b15
commit
9f29b9b94e
3 changed files with 52 additions and 0 deletions
21
app/Plan/UseCases/CreatePlan.php
Normal file
21
app/Plan/UseCases/CreatePlan.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Plan\UseCases;
|
||||
|
||||
use App\Plan\CreatePlanDto;
|
||||
use App\Plan\Plan;
|
||||
use App\Plan\PlanRepository;
|
||||
|
||||
class CreatePlan
|
||||
{
|
||||
public function __construct(
|
||||
private PlanRepository $planRepo,
|
||||
) {}
|
||||
|
||||
public function execute(CreatePlanRequest $request): Plan
|
||||
{
|
||||
return $this->planRepo->create(new CreatePlanDto(
|
||||
name: $request->name,
|
||||
));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue