"""Back-office routes."""

from django.urls import path

from ..views import backoffice as views

app_name = "backoffice"

urlpatterns = [
    path("", views.index, name="index"),
    path("create/", views.create, name="create"),
    path("<int:pk>/edit/", views.edit, name="edit"),
    path("<int:pk>/delete/", views.delete, name="delete"),
    path("<int:pk>/manage/", views.manage, name="manage"),
    path("<int:pk>/orders/", views.orders, name="orders"),
    path("<int:pk>/orders/<str:reference>/", views.order_detail, name="order_detail"),
    path(
        "<int:pk>/orders/<str:reference>/status/",
        views.set_order_status,
        name="set_order_status",
    ),
    path(
        "<int:pk>/manage/<str:section>/",
        views.manage_section,
        name="manage_section",
    ),
    path(
        "<int:pk>/manage/<str:section>/stockroom/add/",
        views.add_stockroom,
        name="add_stockroom",
    ),
    path(
        "<int:pk>/manage/stockroom/<int:source_id>/edit/",
        views.edit_stockroom,
        name="edit_stockroom",
    ),
    path(
        "<int:pk>/manage/stockroom/<int:source_id>/remove/",
        views.remove_stockroom,
        name="remove_stockroom",
    ),
    path("<int:pk>/manage/hull/add/", views.add_hull, name="add_hull"),
    path(
        "<int:pk>/manage/hull/<int:listing_id>/edit/", views.edit_hull, name="edit_hull"
    ),
    path(
        "<int:pk>/manage/hull/<int:listing_id>/remove/",
        views.remove_hull,
        name="remove_hull",
    ),
    path(
        "<int:pk>/manage/module/<int:listing_id>/edit/",
        views.edit_module,
        name="edit_module",
    ),
    path(
        "<int:pk>/manage/module/<int:listing_id>/remove/",
        views.remove_module,
        name="remove_module",
    ),
    path(
        "<int:pk>/manage/fitted/<int:listing_id>/edit/",
        views.edit_fitted,
        name="edit_fitted",
    ),
    path(
        "<int:pk>/manage/fitted/<int:listing_id>/remove/",
        views.remove_fitted,
        name="remove_fitted",
    ),
    path(
        "<int:pk>/manage/<str:section>/listing/<int:listing_id>/star/",
        views.toggle_featured,
        name="toggle_featured",
    ),
    path(
        "<int:pk>/manage/bpc/<int:listing_id>/prices/",
        views.save_bpc_prices,
        name="save_bpc_prices",
    ),
]
