fix: Swagger schema fix, comments add

This commit is contained in:
2025-08-07 10:47:03 +05:00
parent 73aa6a6242
commit e40bced16b
10 changed files with 241 additions and 175 deletions

View File

@@ -1,37 +1,62 @@
from django.urls import path, include
from rest_framework.routers import DefaultRouter # type: ignore
from core.utils.router import TypedRouter
from . import views
router = DefaultRouter()
router.register(r"contract-attached-files", views.ContractAttachedFileView, "contract-attached-files") # type: ignore
router.register(r"contracts", views.ContractView, "contracts") # type: ignore
router.register(r"contracts", views.ContractRelationsViewSet, "contract-relations") # type: ignore
router.register(r"contract-file-contents", views.ContractFileContentView, "contract-file-contents") # type: ignore
router.register(r"contract-owners", views.ContractOwnerView, "contract-owners") # type: ignore
# router.register(r"contract-owners", views.CompanyFolderCrudViewSet, "contract-owner-files") # type: ignore
router = TypedRouter()
urlpatterns = [ # type: ignore
router.register(
r"contract-attached-files",
views.ContractAttachedFileViewSet,
"contract-attached-files-view-set"
)
router.register(
r"contract-file-contents",
views.ContractFileContentViewSet,
"contract-file-contents-view-set"
)
router.register(
r"contract-owners",
views.ContractOwnerViewSet,
"contract-owners-view-set"
)
router.register(
r"contracts",
views.ContractViewSet,
"contracts"
)
urlpatterns: list[object] = [
path("", include(router.urls)), # type: ignore
path(
r"contract-owners/<uuid:owner_id>/contract",
views.ContractDetailView.as_view(),
name="contract-detail"
views.ContractDetailApiView.as_view(),
name="contract-detail-api-view"
),
path(
"contract-owners/<uuid:owner_id>/files/<uuid:file_id>",
views.ContractAttachedFileDeleteView.as_view(),
name="contract-file-delete"
views.ContractOwnerAttachedFileApiView.as_view(),
name="contract-file-api-view"
),
path(
r"contract-owners/<uuid:owner_id>/files/<uuid:file_id>/upload",
views.UploadFileContentView.as_view(),
name="upload-file-content"
views.UploadFileContentApiView.as_view(),
name="upload-file-content-api-view"
),
path(
r"folders/<uuid:pk>/contracts",
views.ListFolderContractsView.as_view(),
name="list-folder-contracts"
views.ListFolderContractsApiView.as_view(),
name="list-folder-contracts-api-view"
),
path(
r"contracts/<uuid:pk>/owners",
views.ContractOwnerApiView.as_view(),
name="contract-owners-api-view"
),
path(
r"/contract-owners/<uuid:owner_id>/files/<uuid:file_id>",
views.ContractAttachedFileApiView.as_view(),
name="contract-attached-files-api-view"
)
]