fix: added serializer_class to views needed
This commit is contained in:
@@ -16,7 +16,7 @@ from core.apps.companies.serializers.accounts import (
|
||||
# @view-set | ALL - /company-accounts
|
||||
###################################################################################
|
||||
@extend_schema(tags=["Company Accounts"])
|
||||
class CompanyAccountCrudViewSet(BaseViewSetMixin, ModelViewSet):
|
||||
class CompanyAccountViewSet(BaseViewSetMixin, ModelViewSet):
|
||||
queryset = CompanyAccountModel.objects.all()
|
||||
serializer_class = ListCompanyAccountSerializer
|
||||
permission_classes = [AllowAny]
|
||||
|
||||
@@ -28,6 +28,7 @@ from core.apps.companies.serializers import (
|
||||
from core.apps.contracts.serializers import (
|
||||
RetrieveContractSerializer,
|
||||
BaseContractSerializer,
|
||||
RetrieveContractQuerySerializer,
|
||||
)
|
||||
from core.apps.contracts.models import ContractModel
|
||||
|
||||
@@ -79,7 +80,8 @@ class CompanyContractApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
|
||||
#! TODO: status should be added.
|
||||
@extend_schema(
|
||||
summary="Company Contracts",
|
||||
description="Get List Company Contracts"
|
||||
description="Get List Company Contracts",
|
||||
parameters=[RetrieveContractQuerySerializer]
|
||||
)
|
||||
def get(
|
||||
self,
|
||||
@@ -88,9 +90,13 @@ class CompanyContractApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
|
||||
**kwargs: object,
|
||||
) -> Response:
|
||||
company = self.get_object()
|
||||
contracts = ContractModel.objects.filter(
|
||||
owners__legal_entity__phone=company.phone,
|
||||
).distinct()
|
||||
contracts = (
|
||||
ContractModel.objects.filter(
|
||||
owners__legal_entity__phone=company.phone,
|
||||
)
|
||||
.select_related("owners")
|
||||
.distinct()
|
||||
)
|
||||
|
||||
folders_param = request.data.get("folders")
|
||||
if folders_param:
|
||||
|
||||
@@ -28,8 +28,9 @@ from core.apps.companies.serializers.folders import (
|
||||
# @view-set | ALL - /company-folders
|
||||
###################################################################################
|
||||
@extend_schema(tags=["Company Folders"])
|
||||
class CompanyFolderCrudViewSet(BaseViewSetMixin, ModelViewSet):
|
||||
class CompanyFolderViewSet(BaseViewSetMixin, ModelViewSet):
|
||||
queryset = CompanyFolderModel.objects.all()
|
||||
serializer_class = ListCompanyFolderSerializer
|
||||
permission_classes = [AllowAny]
|
||||
|
||||
action_permission_classes = { # type: ignore
|
||||
|
||||
Reference in New Issue
Block a user