
from django.urls import path
from . import views
from .views import select_tenants_for_unit, assign_tenant_finalize
urlpatterns = [
    # =========================
    # BUILDINGS
    # =========================
    path('buildings/', views.building_list, name='building_list'),
    path('buildings/add/', views.building_add, name='building_add'),

    # =========================
    # UNITS
    # =========================
    path('units/', views.unit_list, name='unit_list'),
    path('units/add/', views.unit_add, name='unit_add'),
    path('units/<int:unit_id>/', views.unit_detail, name='unit_detail'),
    path('units/<int:unit_id>/edit/', views.unit_update, name='unit_update'),

    # =========================
    # TENANT ASSIGNMENT (CLEANED)
    # =========================
    path("unit/<int:unit_id>/tenants/", select_tenants_for_unit, name="select_tenants_for_unit"),
    path(
        'units/<int:unit_id>/assign-tenant/<int:tenant_id>/',
        views.assign_tenant_to_unit,
        name='assign_tenant_to_unit'
    ),
    path("assign/<int:tenant_id>/<int:unit_id>/", assign_tenant_finalize, name="assign_tenant_finalize"),

    path("tenants/<int:tenant_id>/evict/", views.evict_tenant, name="evict_tenant"),
    path("tenants/<int:tenant_id>/vacate/", views.vacate_tenant, name="vacate_tenant"),

    # tenant self vacate
    path("tenant/vacate/", views.tenant_vacate_self, name="tenant_vacate_self"),

    # inspections / history
    path("inspections/history/", views.inspection_history, name="inspection_history"),
]

