from django.urls import path
from . import views

app_name = 'shop'

urlpatterns = [
    # Product Views
    path('', views.product_list, name='product_list'),  # Homepage to list products
    path('product/<int:product_id>/', views.product_detail, name='product_detail'),  # Product detail page

    # Cart Views
    path('cart/', views.cart_detail, name='cart_detail'),  # View cart details
    path('cart/add/', views.add_to_cart, name='add_to_cart'),  # Add item to cart
    path('cart/update/', views.update_cart, name='update_cart'),
    path('cart/remove/<int:cart_item_id>/', views.remove_from_cart, name='remove_from_cart'),  # Remove item from cart

    # Checkout Views
    path('checkout/', views.checkout, name='checkout'),  # Checkout process
    path('checkout/confirmation/<int:order_id>/', views.order_confirmation, name='order_confirmation'),  # Order confirmation

    # Order Management
    path('orders/', views.order_list, name='order_list'),  # User's order history
    path('orders/<int:order_id>/', views.order_detail, name='order_detail'),  # Specific order details

    # Search
    path('search/', views.search, name='search'),  # Search results page

    # My Account
    path('account/', views.my_account, name='my_account'),

    # My Orders
    path('orders/', views.my_orders, name='my_orders'),
    path('orders/<int:order_id>/', views.order_detail, name='order_detail'),

    # Saved Items
    path('saved-items/', views.saved_items, name='saved_items'),

    # Footer Pages
    path('about-us/', views.about_us, name='about_us'),
    path('help-center/', views.help_center, name='help_center'),
    path('terms-and-conditions/', views.terms_and_conditions, name='terms'),
    path('privacy-policy/', views.privacy_policy, name='privacy'),

    path('shipping/', views.shipping_method_list, name='shipping'),
    path('create/', views.shipping_method_create, name='shipping_method_create'),
    path('edit/<int:pk>/', views.shipping_method_edit, name='shipping_method_edit'),
    path('delete/<int:pk>/', views.shipping_method_delete, name='shipping_method_delete'),

    path('mpesa/callback/', views.mpesa_callback, name='mpesa_callback'),

]
