mahlzeiten->find($quellId); $req = new MahlzeitCreateRequest( name: $quelle->name, notiz: $quelle->notiz, wochentage: $quelle->wochentage, ); $mahlzeit = $this->factory->createFromCreateRequest($req, $this->clock->now()); $gespeichert = $this->tx->execute(fn () => $this->mahlzeiten->create($mahlzeit)); $this->events->dispatch(new MahlzeitAdoptedEvent(id: $gespeichert->id, name: $gespeichert->name, quellId: $quellId)); return MahlzeitResponse::fromModel($gespeichert); } }