from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework.pagination import PageNumberPagination
from rest_framework.exceptions import ValidationError, NotFound
from drf_yasg.utils import swagger_auto_schema
from django.shortcuts import get_object_or_404

from service.models.services import Services
from service.serializers.summary_service_serializer import ReviewOnlySerializer
from common.pagination.custom_pagination import CustomPageNumberPagination
from common.exceptions.exceptions import custom_exception_handler


class ReviewOnlyServiceDetailAPIView(APIView):
    def get(self, request, pk):
        service = get_object_or_404(Services, pk=pk)
        serializer = ReviewOnlySerializer(service)
        return Response(serializer.data)