*/ final readonly class FindIncoSheet implements Usecase { public function __construct( private IncoSheetDirectory $directory ) { } #[\Override] public function execute(BaseInput $input): Output { Assert::isInstanceOf($input, Input::class); $incoSheet = $this->directory->find($input->id); if ($incoSheet === null) { throw NotFoundException::forEntity('IncoSheet', $input->id->value); } return new Output( id: $incoSheet->id(), name: $incoSheet->name, label: $incoSheet->label, description: $incoSheet->description, allegations: $incoSheet->allegations, sellArguments: $incoSheet->sellArguments, preparationAdvices: $incoSheet->preparationAdvices, tips: $incoSheet->tips, sellFamilly: $incoSheet->sellFamilly, ingredients: $incoSheet->ingredients, portions: $incoSheet->portions, allergens: $incoSheet->allergens, brand: $incoSheet->brand, isSeasonal: $incoSheet->isSeasonal, weight: $incoSheet->weight, nutriscore: $incoSheet->nutriscore, storageCondition: $incoSheet->storageCondition, additives: $incoSheet->additives, compo: $incoSheet->compo, createdAt: $incoSheet->createdAt, updatedAt: $incoSheet->updatedAt, ); } }