from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    OrderViewSet,
    ProductViewSet,
    CategoryViewSet,
    ProductImageViewSet,
    DiscountCodeViewSet,
    RefundViewSet,
    RefundPublicView,
    ReviewPostPublicView,
    ReviewPublicViewSet,
    CartViewSet,
    WishlistViewSet,
    AdminWishlistViewSet,
    AnalyticsView,
)
from .currency_info_view import CurrencyInfoView

router = DefaultRouter()
router.register(r'orders', OrderViewSet)
router.register(r'products', ProductViewSet, basename='product')
router.register(r'categories', CategoryViewSet, basename='category')
router.register(r'product-images', ProductImageViewSet, basename='product-image')
router.register(r'discount-codes', DiscountCodeViewSet, basename='discount-code')
router.register(r'refunds', RefundViewSet, basename='refund')
router.register(r'reviews', ReviewPublicViewSet, basename='review')
router.register(r'cart', CartViewSet, basename='cart')
router.register(r'wishlist', WishlistViewSet, basename='wishlist')
router.register(r'admin/wishlists', AdminWishlistViewSet, basename='admin-wishlist')

urlpatterns = [
    path('', include(router.urls)),
    path('refunds/public/', RefundPublicView.as_view(), name='RefundPublicView'),
    path('reviews/create/', ReviewPostPublicView.as_view(), name='ReviewCreate'),
    path('analytics/', AnalyticsView.as_view(), name='analytics'),
    path('currency/info/', CurrencyInfoView.as_view(), name='currency-info'),
]
