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

router = DefaultRouter()
router.register(r'crops', views.CropViewSet)
router.register(r'varieties', views.VarietyViewSet)
router.register(r'rice-transplant-plans', views.RiceTransplantPlanViewSet, basename='rice-transplant-plan')
router.register(r'', views.PlanViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('get-crops-with-varieties/', views.PlanViewSet.as_view({'get': 'get_crops_with_varieties'}), name='get_crops_with_varieties'),
]
