*/ final readonly class FindBrand implements UseCase { public function __construct( private BrandRepository $repository, ) { } #[\Override] public function execute(BaseInput $input): Output { Assert::isInstanceOf($input, Input::class); $brand = $this->repository->findByCode($input->code); if (! $brand instanceof Brand) { return new BrandNotFound(); } return new BrandFound( name: $brand->name, code: $brand->code, logo: $brand->logo, rcs: $brand->rcs, contact: $brand->contact, createdAt: $brand->createdAt(), updatedAt: $brand->updatedAt(), ); } }