from django.urls import path, include
from rest_framework.routers import DefaultRouter

from apps.qm.views import (QuaStatViewSet, TestItemViewSet, 
                           FtestWorkViewSet, FtestViewSet, PtestViewSet, 
                           NotOkOptionView, DefectViewSet, QctViewSet, QctTestItemViewSet, QctDefectViewSet, QctMatViewSet)

API_BASE_URL = 'api/qm/'
HTML_BASE_URL = 'dhtml/qm/'

router = DefaultRouter()
router.register('quastat', QuaStatViewSet, basename='quastat')
router.register('testitem', TestItemViewSet, basename='testitem')
router.register('ftest', FtestViewSet, basename='ftest')
router.register('ftestwork', FtestWorkViewSet, basename='ftestwork')
router.register('ptest', PtestViewSet, basename='ptest')
router.register("defect", DefectViewSet, basename="defect")
router.register('qct', QctViewSet, basename='qct')
router.register('qcttestitem', QctTestItemViewSet, basename='qcttestitem')
router.register('qctdefect', QctDefectViewSet, basename="qctdefect")
router.register('qctmat', QctMatViewSet, basename='qctmat')
urlpatterns = [
    path(API_BASE_URL, include(router.urls)),
    path(API_BASE_URL + 'notok_option/', NotOkOptionView.as_view()),
]
