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 company_services.models.company import Companies
from company_services.serializers.company_dropdown_serializer import CompanyDropDownSerializer
from common.pagination.custom_pagination import CustomPageNumberPagination
from common.exceptions.exceptions import custom_exception_handler


class CompanyDropDownListAPIView(APIView):
    def get(self, request):
        service = Companies.objects.filter(is_active=True)
        serializer = CompanyDropDownSerializer(service, many=True)
        return Response(serializer.data)