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

router = DefaultRouter()
router.register(r'fertilizers', views.FertilizerViewSet, basename='fertilizer')
router.register(r'plans', views.FertilizationPlanViewSet, basename='fertilization-plan')
router.register(r'delivery', views.DeliveryPlanViewSet, basename='delivery-plan')
router.register(r'spreading', views.SpreadingSessionViewSet, basename='spreading-session')

urlpatterns = [
    path('candidate_fields/', views.CandidateFieldsView.as_view(), name='candidate-fields'),
    path('calculate/', views.CalculateView.as_view(), name='fertilizer-calculate'),
    path('spreading/candidates/', views.SpreadingCandidatesView.as_view(), name='spreading-candidates'),
    path('', include(router.urls)),
]
