test create plan with request

This commit is contained in:
Yisroel Baum 2026-02-23 10:41:31 +02:00
parent de744c9b15
commit 9f29b9b94e
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 52 additions and 0 deletions

View 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,
));
}
}