feat: Implement client-facing service management API with UUID for services and bulk actions for product services.
This commit is contained in:
@@ -16,6 +16,7 @@ use App\Models\OrderAddon;
|
||||
use App\Models\OrderItem;
|
||||
use App\Models\Product;
|
||||
use App\Models\ProductPricings;
|
||||
use App\Models\Service;
|
||||
use App\Repositories\Api\Service\ServiceRepository;
|
||||
use App\Services\Api\Service\ServiceService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -190,6 +191,31 @@ class ServiceController extends Controller
|
||||
};
|
||||
}
|
||||
|
||||
public function getDetailServiceCustomer(Request $request, $uuid)
|
||||
{
|
||||
$service = Service::where('uuid', $uuid)->first();
|
||||
|
||||
if (!$service) {
|
||||
return response()->json([
|
||||
'error' => true,
|
||||
'message' => 'Dịch vụ không tồn tại'
|
||||
], 404);
|
||||
}
|
||||
|
||||
$service->load([
|
||||
'product.category',
|
||||
'orderItem.os.osGroup',
|
||||
'orderItem.pricing',
|
||||
'invoice',
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => 'Lấy dữ liệu thành công',
|
||||
'data' => new ServiceResource($service),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get addons for a specific product
|
||||
* GET /v1/products/{productId}/addons
|
||||
|
||||
Reference in New Issue
Block a user