fix: comments con companies app fixed

This commit is contained in:
2025-08-07 09:40:08 +05:00
parent d46506cc32
commit 73aa6a6242
3 changed files with 21 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ from core.apps.companies.serializers.accounts import (
) )
################################################################################### ###################################################################################
# @view-set | POST, GET, UPDATE, DELETE, PATCH, PUT - # @view-set | ALL - /company-accounts
################################################################################### ###################################################################################
@extend_schema(tags=["CompanyAccount"]) @extend_schema(tags=["CompanyAccount"])
class CompanyAccountCrudViewSet(BaseViewSetMixin, ModelViewSet): class CompanyAccountCrudViewSet(BaseViewSetMixin, ModelViewSet):

View File

@@ -35,9 +35,9 @@ from core.apps.contracts.models import ContractModel
UserModel = get_user_model() UserModel = get_user_model()
###################################################################### ###################################################################################
# Crud # @view-set | ALL - /companies
###################################################################### ###################################################################################
@extend_schema(tags=["Company"]) @extend_schema(tags=["Company"])
class CompanyCrudViewSet(BaseViewSetMixin, ModelViewSet): class CompanyCrudViewSet(BaseViewSetMixin, ModelViewSet):
queryset = CompanyModel.objects.all() queryset = CompanyModel.objects.all()
@@ -60,9 +60,9 @@ class CompanyCrudViewSet(BaseViewSetMixin, ModelViewSet):
} }
###################################################################### ###################################################################################
# company/<uuid:pk>/contract # @api-view | GET - /companies/<uuid:pk>/contracts
###################################################################### ###################################################################################
@extend_schema(tags=["Company Contracts"]) @extend_schema(tags=["Company Contracts"])
class CompanyContractApiView(BaseApiViewMixin, GenericAPIView): # type: ignore class CompanyContractApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
queryset = CompanyModel.objects.all() queryset = CompanyModel.objects.all()
@@ -101,9 +101,9 @@ class CompanyContractApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
return Response(serializer.data, status=status.HTTP_200_OK) return Response(serializer.data, status=status.HTTP_200_OK)
###################################################################### ###################################################################################
# company/<uuid:pk>/accounts # @api-view | GET - /company/<uuid:pk>/accounts
###################################################################### ###################################################################################
@extend_schema(tags=["Company Accounts"]) @extend_schema(tags=["Company Accounts"])
class CompanyAccountApiView(BaseApiViewMixin, GenericAPIView): # type: ignore class CompanyAccountApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
queryset = CompanyModel.objects.all() queryset = CompanyModel.objects.all()
@@ -128,9 +128,10 @@ class CompanyAccountApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
return Response(data=ser.data, status=status.HTTP_200_OK) return Response(data=ser.data, status=status.HTTP_200_OK)
######################################################################
# company/<uuid:pk>/folders ###################################################################################
###################################################################### # @api-view | GET, POST - /company/<uuid:pk>/folders
###################################################################################
@extend_schema(tags=["Company Folders"]) @extend_schema(tags=["Company Folders"])
class CompanyFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore class CompanyFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
queryset = CompanyModel.objects.all() queryset = CompanyModel.objects.all()
@@ -142,7 +143,7 @@ class CompanyFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
} }
method_permission_classes = { method_permission_classes = {
"get": [IsCompanyAccount], "get": [IsCompanyAccount],
"get": [IsCompanyAccount], "post": [IsCompanyAccount],
} }
@extend_schema( @extend_schema(

View File

@@ -24,9 +24,9 @@ from core.apps.companies.serializers.folders import (
) )
###################################################################### ###################################################################################
# Crud # @view-set | ALL - /company-folders
###################################################################### ###################################################################################
@extend_schema(tags=["CompanyFolder"]) @extend_schema(tags=["CompanyFolder"])
class CompanyFolderCrudViewSet(BaseViewSetMixin, ModelViewSet): class CompanyFolderCrudViewSet(BaseViewSetMixin, ModelViewSet):
queryset = CompanyFolderModel.objects.all() queryset = CompanyFolderModel.objects.all()
@@ -48,9 +48,9 @@ class CompanyFolderCrudViewSet(BaseViewSetMixin, ModelViewSet):
} }
###################################################################### ###################################################################################
# /company-folders/<uuid:pk>/contracts # @api-view | POST - /company-folders/<uuid:pk>/contracts
###################################################################### ###################################################################################
@extend_schema(tags=["CompanyFolder Contracts"]) @extend_schema(tags=["CompanyFolder Contracts"])
class ContractFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore class ContractFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore
queryset = CompanyFolderModel.objects.all() queryset = CompanyFolderModel.objects.all()