productService = $productService; } public function getProductById($id) { try { $data = $this->productService->getProductById($id); return $this->successResponse($data); } catch(\Exception $e) { return $this->errorResponse(errorDetails:$e->getMessage()); } } public function getProductByName(Request $request, $currentOutletId) { $name = $request->query('name'); try { $data = $this->productService->getProductByName($currentOutletId, $name); return $this->successResponse($data); } catch(\Exception $e) { return $this->errorResponse(errorDetails:$e->getMessage()); } } public function getProductByCategory($currentOutletId, $categoryId) { try { $data = $this->productService->getProductByCategory($currentOutletId, $categoryId); return $this->successResponse($data); } catch(\Exception $e) { return $this->errorResponse(errorDetails:$e->getMessage()); } } public function getProductBestSellerByOutlet($currentOutletId) { try { $data = $this->productService->getProductBestSellerByOutlet($currentOutletId); return $this->successResponse($data); } catch(\Exception $e) { return $this->errorResponse(errorDetails:$e->getMessage()); } } }