from django.urls import path, include
from rest_framework.routers import DefaultRouter
from apps.mpr.views import (
    WareHouseViewSet,
    PurchaseRequisitionViewSet, PurchaseRequisitionItemViewSet,
    WarehouseEntryViewSet, WarehouseEntryItemViewSet,
    WarehouseStockViewSet,
    MaterialRequisitionViewSet, MaterialRequisitionItemViewSet,
)

API_BASE_URL = 'api/mpr/'

router = DefaultRouter()
router.register('warehouse', WareHouseViewSet, basename='mpr_warehouse')
router.register('requisition', PurchaseRequisitionViewSet, basename='requisition')
router.register('requisition_item', PurchaseRequisitionItemViewSet, basename='requisition_item')
router.register('warehouse_entry', WarehouseEntryViewSet, basename='warehouse_entry')
router.register('warehouse_entry_item', WarehouseEntryItemViewSet, basename='warehouse_entry_item')
router.register('warehouse_stock', WarehouseStockViewSet, basename='warehouse_stock')
router.register('material_requisition', MaterialRequisitionViewSet, basename='material_requisition')
router.register('material_requisition_item', MaterialRequisitionItemViewSet, basename='material_requisition_item')

urlpatterns = [
    path(API_BASE_URL, include(router.urls)),
]
