Refactored commerce models to support refunds, invoices, and improved carrier/payment logic. Added new serializers and viewsets for products, categories, images, discount codes, and refunds. Introduced Stripe client integration and removed legacy Stripe admin/model code. Updated Dockerfile for PDF generation dependencies. Removed obsolete migration files and updated configuration app initialization. Added invoice template and tasks for order cleanup.
25 lines
796 B
Python
25 lines
796 B
Python
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
from .views import (
|
|
OrderViewSet,
|
|
ProductViewSet,
|
|
CategoryViewSet,
|
|
ProductImageViewSet,
|
|
DiscountCodeViewSet,
|
|
RefundViewSet,
|
|
)
|
|
|
|
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')
|
|
|
|
urlpatterns = [
|
|
path('', include(router.urls)),
|
|
]
|
|
|
|
# NOTE: Other endpoints (categories/products/discounts) can be added later
|