63 lines
1.6 KiB
Python
63 lines
1.6 KiB
Python
from django.urls import path, include
|
|
|
|
from core.utils.router import TypedRouter
|
|
from . import views
|
|
|
|
|
|
router = TypedRouter()
|
|
|
|
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.ContractDetailApiView.as_view(),
|
|
name="contract-detail-api-view"
|
|
),
|
|
path(
|
|
"contract-owners/<uuid:owner_id>/files/<uuid:file_id>",
|
|
views.ContractOwnerAttachedFileApiView.as_view(),
|
|
name="contract-file-api-view"
|
|
),
|
|
path(
|
|
r"contract-owners/<uuid:owner_id>/files/<uuid:file_id>/upload",
|
|
views.UploadFileContentApiView.as_view(),
|
|
name="upload-file-content-api-view"
|
|
),
|
|
path(
|
|
r"folders/<uuid:pk>/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"
|
|
)
|
|
]
|