from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from apps.lotes.views import cadastro_lote, editar_lote, excluir_lote, lista_lotes, \
     semeadura_lote, lista_estoque, editar_semeadura_lote, delete_semeadura, relatorio_lotes
# Create your views here.
urlpatterns = [
     ################ URLS LOTE ################
    path('lista_lotes/', lista_lotes, name='lista_lotes'),
    path('lista_estoque/', lista_estoque, name='lista_estoque'),
    path('cadastro_lote/<int:especie_id>', cadastro_lote, name='cadastro_lote'),
    path('editar_lote/<int:especie_id>/<int:lote_id>/', editar_lote, name='editar_lote'),
    path('excluir_lote/<int:lote_id>/', excluir_lote, name='excluir_lote'),
    
    ################ URLS SEMEADURA ################
    path('semeadura_lote/<int:especie_id>/<int:lote_id>/',semeadura_lote, name='semeadura_lote'),
    path('editar_semeadura_lote/<int:especie_id>/<int:lote_id>/',editar_semeadura_lote, name='editar_semeadura_lote'),
    path('semeadura/delete/<int:semeadura_id>/', delete_semeadura, name='delete_semeadura'),
    path('relatorio_lotes/', relatorio_lotes, name='relatorio_lotes'),
]
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
