# Copyright (c) 2023-present Plane Software, Inc. and contributors
# SPDX-License-Identifier: AGPL-3.0-only
# See the LICENSE file for details.

from django.urls import path

from plane.app.views import (
    ExternalContourAttachmentDownloadEndpoint,
    ExternalContourDetailEndpoint,
    ExternalContourDecisionEndpoint,
    ExternalContourListCreateEndpoint,
    ExternalContourReplyEndpoint,
    ExternalContourTargetOptionsEndpoint,
    ExternalContourTargetProjectListEndpoint,
)


urlpatterns = [
    path(
        "workspaces/<str:slug>/projects/<uuid:project_id>/external-contours/",
        ExternalContourListCreateEndpoint.as_view(http_method_names=["get", "post"]),
        name="external-contours",
    ),
    path(
        "workspaces/<str:slug>/projects/<uuid:project_id>/external-contours/targets/",
        ExternalContourTargetProjectListEndpoint.as_view(http_method_names=["get"]),
        name="external-contour-targets",
    ),
    path(
        "workspaces/<str:slug>/projects/<uuid:project_id>/external-contours/targets/<uuid:target_project_id>/options/",
        ExternalContourTargetOptionsEndpoint.as_view(http_method_names=["get"]),
        name="external-contour-target-options",
    ),
    path(
        "workspaces/<str:slug>/projects/<uuid:project_id>/external-contours/<uuid:request_id>/",
        ExternalContourDetailEndpoint.as_view(http_method_names=["get", "patch"]),
        name="external-contour-detail",
    ),
    path(
        "workspaces/<str:slug>/projects/<uuid:project_id>/external-contours/<uuid:request_id>/decision/",
        ExternalContourDecisionEndpoint.as_view(http_method_names=["post"]),
        name="external-contour-decision",
    ),
    path(
        "workspaces/<str:slug>/projects/<uuid:project_id>/external-contours/<uuid:request_id>/reply/",
        ExternalContourReplyEndpoint.as_view(http_method_names=["post"]),
        name="external-contour-reply",
    ),
    path(
        "workspaces/<str:slug>/projects/<uuid:project_id>/external-contours/<uuid:request_id>/attachments/<uuid:attachment_id>/",
        ExternalContourAttachmentDownloadEndpoint.as_view(http_method_names=["get"]),
        name="external-contour-attachment-download",
    ),
]
