from django.urls import path, include
from . import views

app_name = 'hydro_data'

urlpatterns = [
    path('', views.HomePage.as_view(), name='home'),
    path('items/', views.ItemsPage.as_view(), name='items'),
    path('batches/', views.BatchesPage.as_view(), name='batches'),

    path('create_site/', views.SiteForm.as_view(), name='create_site'),
    path('create_box_with_racks/', views.create_box_with_racks, name='create_box_with_racks'),
    path('create_producetype/', views.create_producetype, name='create_producetype'),
    path('create_location/', views.create_location, name='create_location'),
    path('create_acid/', views.create_acid, name='create_acid'),
    path('create_nutrient/', views.create_nutrient, name='create_nutrient'),
    path('create_activity/', views.create_activity, name='create_activity'),
    path('create_growmedium/', views.create_growmedium, name='create_growmedium'),
    path('create_tray/', views.create_tray, name='create_tray'),
    path('create_tank/', views.create_tank, name='create_tank'),
    path('create_batch/', views.BatchForm.as_view(), name='create_batch'),
    path('create_plantingdata/', views.create_plantingdata, name='create_plantingdata'),
    path('create_harvestdata/', views.create_harvestdata, name='create_harvestdata'),
    path('create_lightreading/', views.create_lightreading, name='create_lightreading'),
    path('create_airreading/', views.AirReadingForm.as_view(), name='create_airreading'),
    path('create_waterreading/', views.create_waterreading, name='create_waterreading'),

    path('sites/', views.ListSite.as_view(), name='site_list'),
    path('site/<slug>/box_list/', views.ListBox.as_view(), name='box_list'),
    path('produce_type_list/', views.ListProduceType.as_view(), name='produce_type_list'),
    path('acid_list/', views.ListAcid.as_view(), name='acid_list'),
    path('nutrient_list/', views.ListNutrient.as_view(), name='nutrient_list'),
    path('activity_list/', views.ListActivity.as_view(), name='activity_list'),
    path('growmedium_list/', views.ListGrowMedium.as_view(), name='growmedium_list'),
    path('tank_list/', views.ListTray.as_view(), name='tray_list'),
    path('box/<slug>/racks/', views.ListRackTankPerBox.as_view(), name='rack_tank_per_box'),
    path('box/<boxslug>/rack/<rackslug>/', views.ListLocPerRack.as_view(), name='loc_per_rack'),

    path('produce_type/<slug>/', views.ProduceTypeDetail.as_view(), name='single_produce_type'),
    path('acid/<slug>/', views.AcidDetail.as_view(), name='single_acid'),
    path('nutrient/<slug>/', views.NutrientDetail.as_view(), name='single_nutrient'),
    path('activity/<slug>/', views.ActivityDetail.as_view(), name='single_activity'),
    path('growmedium/<slug>/', views.GrowMediumDetail.as_view(), name='single_growmedium'),
    path('tray/<slug>/', views.TrayDetail.as_view(), name='single_tray'),
    path('box/<boxslug>/tank/<slug>/', views.TankDetail.as_view(), name='single_tank'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/', views.LocationDetail.as_view(), name='single_location'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/plantingdata/<int:pk>', views.PlantingDataDetail.as_view(), name='single_plantingdata'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/harvestdata/<int:pk>', views.HarvestDataDetail.as_view(), name='single_harvestdata'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/lightreading/<int:pk>', views.LightReadingDetail.as_view(), name='single_lightreading'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/transplantdata/<int:pk>', views.TransplantDataDetail.as_view(), name='single_transplantdata'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/seedlingwastagedata/<int:pk>', views.SeedlingWastageDataDetail.as_view(), name='single_seedlingwastagedata'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/wastagedata/<int:pk>', views.WastageDataDetail.as_view(), name='single_wastagedata'),
    path('box/<boxslug>/airreading/<int:pk>', views.AirReadingDetail.as_view(), name='single_airreading'),
    path('box/<boxslug>/tank/<tankslug>/waterreading/<int:pk>', views.WaterReadingDetail.as_view(), name='single_waterreading'),

    path('box/<slug>/add_rack/', views.add_rack, name='add_rack'),
    path('box/<slug>/add_tank/', views.add_tank, name='add_tank'),
    path('box/<boxslug>/rack/<slug>/add_sqm_id/', views.add_location, name='add_location'),
    path('box/<boxslug>/rack/<int:pk>/add_seedlingbatch/', views.add_seedlingbatch,name='add_seedlingbatch'),
    path('box/<boxslug>/rack/<int:pk>/add_transplantbatch/', views.add_transplantbatch,name='add_transplantbatch'),
    path('box/<boxslug>/rack/<int:pk>/add_seedlingwastage/', views.add_seedlingwastage,name='add_seedlingwastage'),
    path('box/<boxslug>/rack/<int:pk>/add_wastage/', views.add_wastagedata,name='add_wastagedata'),

    path('site/<slug>/add_waterconsumption/', views.add_waterconsumption_for_site, name='add_waterconsumption_for_site'),
    path('box/<slug>/add_energyconsumption/', views.add_energyconsumption_for_box, name='add_energyconsumption_for_box'),
    path('box/<slug>/add_airdata/', views.add_airdata_for_box, name='add_airdata_for_box'),
    path('box/<boxslug>/tank/<int:pk>/add_waterdata/', views.add_waterdata_for_tank, name='add_waterdata_for_tank'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<int:pk>/add_plantdata/', views.add_plantdata_for_loc, name='add_plantdata_for_loc'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<int:pk>/add_harvestdata/', views.add_harvestdata_for_loc, name='add_harvestdata_for_loc'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<int:pk>/add_lightdata/', views.add_lightdata_for_loc, name='add_lightdata_for_loc'),

    path('box/<slug>/add_multiple_waterreading/', views.add_multiple_waterreading,name='add_multiple_waterreading'),
    path('box/<boxslug>/rack/<int:pk>/add_multiple_lightreading/', views.add_multiple_lightreading,name='add_multiple_lightreading'),
    path('box/<boxslug>/rack/<int:pk>/add_multiple_plantdata/', views.add_multiple_plantdata,name='add_multiple_plantdata'),
    path('box/<boxslug>/rack/<int:pk>/add_multiple_harvestdata/', views.add_multiple_harvestdata,name='add_multiple_harvestdata'),

    path('site/<slug>/edit/', views.SiteUpdateView.as_view(),name='site_edit'),
    path('site/<slug>/remove/', views.SiteDeleteView.as_view(), name='site_remove'),
    path('box/<slug>/edit/', views.BoxUpdateView.as_view(),name='box_edit'),
    path('box/<slug>/remove/', views.BoxDeleteView.as_view(), name='box_remove'),
    path('box/<boxslug>/rack/<int:pk>/edit/', views.RackUpdateView.as_view(),name='rack_edit'),
    path('box/<boxslug>/rack/<int:pk>/remove/', views.RackDeleteView.as_view(), name='rack_remove'),
    path('box/<boxslug>/tank/<int:pk>/edit/', views.TankUpdateView.as_view(),name='tank_edit'),
    path('box/<boxslug>/tank/<int:pk>/remove/', views.TankDeleteView.as_view(), name='tank_remove'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<int:pk>/edit/', views.LocationUpdateView.as_view(),name='location_edit'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<int:pk>/remove/', views.LocationDeleteView.as_view(), name='location_remove'),
    path('produce_type/<int:pk>/edit/', views.ProduceTypeUpdateView.as_view(),name='produce_type_edit'),
    path('produce_type/<int:pk>/remove/', views.ProduceTypeDeleteView.as_view(), name='produce_type_remove'),
    path('acid/<int:pk>/edit/', views.AcidUpdateView.as_view(),name='acid_edit'),
    path('acid/<int:pk>/remove/', views.AcidDeleteView.as_view(), name='acid_remove'),
    path('nutrient/<int:pk>/edit/', views.NutrientUpdateView.as_view(),name='nutrient_edit'),
    path('nutrient/<int:pk>/remove/', views.NutrientDeleteView.as_view(), name='nutrient_remove'),
    path('activity/<int:pk>/edit/', views.ActivityUpdateView.as_view(),name='activity_edit'),
    path('activity/<int:pk>/remove/', views.ActivityDeleteView.as_view(), name='activity_remove'),
    path('growmedium/<int:pk>/edit/', views.GrowMediumUpdateView.as_view(),name='growmedium_edit'),
    path('growmedium/<int:pk>/remove/', views.GrowMediumDeleteView.as_view(), name='growmedium_remove'),
    path('tray/<int:pk>/edit/', views.TrayUpdateView.as_view(),name='tray_edit'),
    path('tray/<int:pk>/remove/', views.TrayDeleteView.as_view(), name='tray_remove'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/plantingdata/<int:pk>/edit', views.PlantingDataUpdateView.as_view(), name='plantingdata_edit'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/plantingdata/<int:pk>/remove', views.PlantingDataDeleteView.as_view(), name='plantingdata_remove'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/harvestdata/<int:pk>/edit', views.HarvestDataUpdateView.as_view(), name='harvestdata_edit'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/harvestdata/<int:pk>/remove', views.HarvestDataDeleteView.as_view(), name='harvestdata_remove'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/lightreading/<int:pk>/edit', views.LightReadingUpdateView.as_view(), name='lightreading_edit'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/lightreading/<int:pk>/remove', views.LightReadingDeleteView.as_view(), name='lightreading_remove'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/transplantdata/<int:pk>/edit', views.TransplantDataUpdateView.as_view(), name='transplantdata_edit'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/transplantdata/<int:pk>/remove', views.TransplantDataDeleteView.as_view(), name='transplantdata_remove'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/seedlingwastagedata/<int:pk>/edit', views.SeedlingWastageDataUpdateView.as_view(), name='seedlingwastagedata_edit'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/seedlingwastagedata/<int:pk>/remove', views.SeedlingWastageDataDeleteView.as_view(), name='seedlingwastagedata_remove'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/wastagedata/<int:pk>/edit', views.WastageDataUpdateView.as_view(), name='wastagedata_edit'),
    path('box/<boxslug>/rack/<rackslug>/sqm_id/<slug>/wastagedata/<int:pk>/remove', views.WastageDataDeleteView.as_view(), name='wastagedata_remove'),
    path('box/<boxslug>/airreading/<int:pk>/edit/', views.AirReadingUpdateView.as_view(), name='airreading_edit'),
    path('box/<boxslug>/airreading/<int:pk>/remove', views.AirReadingDeleteView.as_view(), name='airreading_remove'),
    path('box/<boxslug>/tank/<tankslug>/waterreading/<int:pk>/edit/', views.WaterReadingUpdateView.as_view(), name='waterreading_edit'),
    path('box/<boxslug>/tank/<tankslug>/waterreading/<int:pk>/remove/', views.WaterReadingDeleteView.as_view(), name='waterreading_remove'),

    path('box/<boxslug>/rack/<int:pk>/clear/',views.ClearPlants.as_view(),name="clear_plants"),

    path('ajax/load-boxes/', views.load_boxes, name='ajax_load_boxes'),
    path('ajax/load-racks/', views.load_racks, name='ajax_load_racks'),
    path('ajax/load-locations/', views.load_locations, name='ajax_load_locations'),
    path('ajax/load-open-locations/', views.load_open_locations, name='ajax_load_open_locations'),
    path('ajax/load-occupied-locations/', views.load_occupied_locations, name='ajax_load_occupied_locations'),
    path('ajax/load-tanks/', views.load_tanks, name='ajax_load_tanks'),

    path("ajax/load-product-name/", views.load_prod_name, name='ajax_prod_name'),
    path('packing-log-form/', views.create_packinglog, name= 'packing_log'),
    path('create-weight-category/', views.WeightCategoryModalCreate.as_view(), name='weight-category'),
    path('packing-log-list/', views.PackingLogDataList.as_view(), name = 'packing_log_list'),
    path('csv-upload/', views.csv_upload, name='csv_upload'),
    path('delivery-data-table/', views.DeliveryDataTable.as_view(), name='delivery_data_table'),
    path('dashboard/', views.AdminDashboard.as_view(), name='dashboard'),
]
