From 73aa6a62424ae4356f62916f22eaa4c9b9b1917c Mon Sep 17 00:00:00 2001 From: Fazliddin Abdurahimov Date: Thu, 7 Aug 2025 09:40:08 +0500 Subject: [PATCH] fix: comments con companies app fixed --- core/apps/companies/views/accounts.py | 2 +- core/apps/companies/views/companies.py | 27 +++++++++++++------------- core/apps/companies/views/folders.py | 12 ++++++------ 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/core/apps/companies/views/accounts.py b/core/apps/companies/views/accounts.py index 7d5c274..90d6fce 100644 --- a/core/apps/companies/views/accounts.py +++ b/core/apps/companies/views/accounts.py @@ -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"]) class CompanyAccountCrudViewSet(BaseViewSetMixin, ModelViewSet): diff --git a/core/apps/companies/views/companies.py b/core/apps/companies/views/companies.py index 4a067ac..8d3a79a 100644 --- a/core/apps/companies/views/companies.py +++ b/core/apps/companies/views/companies.py @@ -35,9 +35,9 @@ from core.apps.contracts.models import ContractModel UserModel = get_user_model() -###################################################################### -# Crud -###################################################################### +################################################################################### +# @view-set | ALL - /companies +################################################################################### @extend_schema(tags=["Company"]) class CompanyCrudViewSet(BaseViewSetMixin, ModelViewSet): queryset = CompanyModel.objects.all() @@ -60,9 +60,9 @@ class CompanyCrudViewSet(BaseViewSetMixin, ModelViewSet): } -###################################################################### -# company//contract -###################################################################### +################################################################################### +# @api-view | GET - /companies//contracts +################################################################################### @extend_schema(tags=["Company Contracts"]) class CompanyContractApiView(BaseApiViewMixin, GenericAPIView): # type: ignore queryset = CompanyModel.objects.all() @@ -101,9 +101,9 @@ class CompanyContractApiView(BaseApiViewMixin, GenericAPIView): # type: ignore return Response(serializer.data, status=status.HTTP_200_OK) -###################################################################### -# company//accounts -###################################################################### +################################################################################### +# @api-view | GET - /company//accounts +################################################################################### @extend_schema(tags=["Company Accounts"]) class CompanyAccountApiView(BaseApiViewMixin, GenericAPIView): # type: ignore queryset = CompanyModel.objects.all() @@ -128,9 +128,10 @@ class CompanyAccountApiView(BaseApiViewMixin, GenericAPIView): # type: ignore return Response(data=ser.data, status=status.HTTP_200_OK) -###################################################################### -# company//folders -###################################################################### + +################################################################################### +# @api-view | GET, POST - /company//folders +################################################################################### @extend_schema(tags=["Company Folders"]) class CompanyFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore queryset = CompanyModel.objects.all() @@ -142,7 +143,7 @@ class CompanyFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore } method_permission_classes = { "get": [IsCompanyAccount], - "get": [IsCompanyAccount], + "post": [IsCompanyAccount], } @extend_schema( diff --git a/core/apps/companies/views/folders.py b/core/apps/companies/views/folders.py index 1febd15..4c9a86d 100644 --- a/core/apps/companies/views/folders.py +++ b/core/apps/companies/views/folders.py @@ -24,9 +24,9 @@ from core.apps.companies.serializers.folders import ( ) -###################################################################### -# Crud -###################################################################### +################################################################################### +# @view-set | ALL - /company-folders +################################################################################### @extend_schema(tags=["CompanyFolder"]) class CompanyFolderCrudViewSet(BaseViewSetMixin, ModelViewSet): queryset = CompanyFolderModel.objects.all() @@ -48,9 +48,9 @@ class CompanyFolderCrudViewSet(BaseViewSetMixin, ModelViewSet): } -###################################################################### -# /company-folders//contracts -###################################################################### +################################################################################### +# @api-view | POST - /company-folders//contracts +################################################################################### @extend_schema(tags=["CompanyFolder Contracts"]) class ContractFolderApiView(BaseApiViewMixin, GenericAPIView): # type: ignore queryset = CompanyFolderModel.objects.all()