from django.urls import include, path
from rest_framework import routers

from . import views

public_router = routers.DefaultRouter()
public_router.register(
    "categories", views.ProductCategoryPublicViewSet, basename="category"
)
public_router.register("products", views.ProductPublicViewSet, basename="product")
public_router.register(
    "delivery-zones", views.DeliveryZonePublicViewSet, basename="delivery-zone"
)
public_router.register("orders", views.OrderPublicViewSet, basename="order")

admin_router = routers.DefaultRouter()
admin_router.register(
    "categories", views.ProductCategoryAdminViewSet, basename="admin-category"
)
admin_router.register("products", views.ProductAdminViewSet, basename="admin-product")
admin_router.register(
    "delivery-zones", views.DeliveryZoneAdminViewSet, basename="admin-delivery-zone"
)
admin_router.register(
    "delivery-overrides",
    views.DeliveryOverrideCodeAdminViewSet,
    basename="admin-delivery-override",
)
admin_router.register("orders", views.OrderAdminViewSet, basename="admin-order")

urlpatterns = [
    path("", include(public_router.urls)),
    path("admin/", include(admin_router.urls)),
]
