from django.urls import path

from . import views

app_name = "order"
urlpatterns = [
    path("", views.IndexView.as_view(), name="index"),
    path(
        "<str:code>/",
        views.GroupedOrderDetailView.as_view(),
        name="grouped_order_detail",
    ),
    path(
        "<str:code>/ics/",
        views.GroupedOrderEventView.as_view(),
        name="grouped_order_event",
    ),
    path(
        "<str:code>/gerer",
        views.GroupedOrderOverview.as_view(),
        name="grouped_order_overview",
    ),
    path("<str:code>/commander/", views.place_order, name="order"),
    path(
        "<str:code>/<int:pk>/confirmation/",
        views.OrderDetailView.as_view(),
        name="order_confirm",
    ),
    path(
        "<str:code>/gerer/<int:pk>/supprimer",
        views.OrderDeleteView.as_view(),
        name="order_delete",
    ),
    path("creer", views.GroupedOrderCreateView.as_view(), name="create_grouped_order"),
    path(
        "<str:code>/gerer-produits",
        views.GroupedOrderAddItemsView.as_view(),
        name="manage_items",
    ),
    path(
        "<str:code>/modifier",
        views.GroupedOrderUpdateView.as_view(),
        name="update_grouped_order",
    ),
    path(
        "<str:code>/supprimer",
        views.GroupedOrderDeleteView.as_view(),
        name="delete_grouped_order",
    ),
    path(
        "<str:code>/dupliquer",
        views.GroupedOrderDuplicateView.as_view(),
        name="duplicate_grouped_order",
    ),
    path(
        "<str:code>/gerer-produits/nouveau",
        views.ItemCreateView.as_view(),
        name="item_create",
    ),
    path(
        "<str:code>/gerer-produits/<int:pk>/supprimer",
        views.ItemDeleteView.as_view(),
        name="item_delete",
    ),
    path(
        "<str:code>/gerer/imprimer",
        views.DownloadGroupedOrderSheetView.as_view(),
        name="grouped_order_sheet",
    ),
    path(
        "<str:code>/gerer/liste-mails",
        views.ExportGroupOrderEmailAdressesToDownloadView.as_view(),
        name="email_list",
    ),
    path(
        "<str:code>/gerer/csv",
        views.ExportGroupedOrderToCSVView.as_view(),
        name="grouped_order_csv_export",
    ),
]
