80 lines
4.9 KiB
Python
80 lines
4.9 KiB
Python
"""
|
|
Inventory app URLs with comprehensive CRUD operations.
|
|
"""
|
|
|
|
from django.urls import path, include
|
|
from . import views
|
|
|
|
app_name = 'inventory'
|
|
|
|
urlpatterns = [
|
|
# ============================================================================
|
|
# DASHBOARD AND OVERVIEW
|
|
# ============================================================================
|
|
path('', views.InventoryDashboardView.as_view(), name='dashboard'),
|
|
|
|
# ============================================================================
|
|
# SUPPLIER URLS (FULL CRUD - Master Data)
|
|
# ============================================================================
|
|
path('suppliers/', views.SupplierListView.as_view(), name='supplier_list'),
|
|
path('suppliers/create/', views.SupplierCreateView.as_view(), name='supplier_create'),
|
|
path('suppliers/<int:pk>/', views.SupplierDetailView.as_view(), name='supplier_detail'),
|
|
path('suppliers/<int:pk>/update/', views.SupplierUpdateView.as_view(), name='supplier_update'),
|
|
path('suppliers/<int:pk>/delete/', views.SupplierDeleteView.as_view(), name='supplier_delete'),
|
|
|
|
# ============================================================================
|
|
# INVENTORY LOCATION URLS (FULL CRUD - Master Data)
|
|
# ============================================================================
|
|
path('locations/', views.InventoryLocationListView.as_view(), name='location_list'),
|
|
path('locations/create/', views.InventoryLocationCreateView.as_view(), name='location_create'),
|
|
path('locations/<int:pk>/', views.InventoryLocationDetailView.as_view(), name='location_detail'),
|
|
path('locations/<int:pk>/update/', views.InventoryLocationUpdateView.as_view(), name='location_update'),
|
|
path('locations/<int:pk>/delete/', views.InventoryLocationDeleteView.as_view(), name='location_delete'),
|
|
|
|
# ============================================================================
|
|
# INVENTORY ITEM URLS (FULL CRUD - Master Data)
|
|
# ============================================================================
|
|
path('items/', views.InventoryItemListView.as_view(), name='item_list'),
|
|
path('items/create/', views.InventoryItemCreateView.as_view(), name='item_create'),
|
|
path('items/<int:pk>/', views.InventoryItemDetailView.as_view(), name='item_detail'),
|
|
path('items/<int:pk>/update/', views.InventoryItemUpdateView.as_view(), name='item_update'),
|
|
path('items/<int:pk>/delete/', views.InventoryItemDeleteView.as_view(), name='item_delete'),
|
|
|
|
# ============================================================================
|
|
# INVENTORY STOCK URLS (LIMITED CRUD - Operational Data)
|
|
# ============================================================================
|
|
path('stock/', views.InventoryStockListView.as_view(), name='stock_list'),
|
|
path('stock/create/', views.InventoryStockCreateView.as_view(), name='stock_create'),
|
|
path('stock/<int:pk>/', views.InventoryStockDetailView.as_view(), name='stock_detail'),
|
|
path('stock/<int:pk>/update/', views.InventoryStockUpdateView.as_view(), name='stock_update'),
|
|
# Note: No delete view for stock - use adjustments instead
|
|
|
|
# ============================================================================
|
|
# PURCHASE ORDER URLS (RESTRICTED CRUD - Operational Data)
|
|
# ============================================================================
|
|
path('orders/', views.PurchaseOrderListView.as_view(), name='purchase_order_list'),
|
|
path('orders/create/', views.PurchaseOrderCreateView.as_view(), name='purchase_order_create'),
|
|
path('orders/<int:pk>/', views.PurchaseOrderDetailView.as_view(), name='purchase_order_detail'),
|
|
path('orders/<int:pk>/update/', views.PurchaseOrderUpdateView.as_view(), name='purchase_order_update'),
|
|
# Note: No delete view for orders - use status updates instead
|
|
|
|
# ============================================================================
|
|
# HTMX ENDPOINTS FOR REAL-TIME UPDATES
|
|
# ============================================================================
|
|
path('htmx/stats/', views.inventory_stats, name='inventory_stats'),
|
|
path('htmx/stock-search/', views.stock_search, name='stock_search'),
|
|
|
|
# ============================================================================
|
|
# ACTION URLS FOR WORKFLOW OPERATIONS
|
|
# ============================================================================
|
|
path('stock/<int:stock_id>/adjust/', views.adjust_stock, name='adjust_stock'),
|
|
path('orders/<int:order_id>/approve/', views.approve_purchase_order, name='approve_purchase_order'),
|
|
path('orders/<int:order_id>/receive/', views.receive_purchase_order, name='receive_purchase_order'),
|
|
|
|
# ============================================================================
|
|
# API ENDPOINTS
|
|
# ============================================================================
|
|
path('api/', include('inventory.api.urls')),
|
|
]
|
|
|