estimates->getById($estimateId); if ($estimate === null) { return response()->json([ 'status' => 'error', 'message' => 'Estimate not found' ], 404); } $deleteEstimateResponse = new DeleteEstimateAction(request: new DeleteEstimateRequest($estimate) )->execute(); if ($deleteEstimateResponse->success) { return response()->json([ 'status' => 'success', 'message' => 'Der Eintrag wurde erfolgreich gelöscht.' ]); } else { return response()->json([ 'status' => 'error', 'message' => 'Beim Löschen des Eintrags ist ein Fehler aufgetreten.' ]); } } }