from django.urls import path
from api.property_api.property.views.property_views import (
    PropertyBuyDetailAPIView,
    PropertyBuyListAPIView,
    PropertyListCreateAPIView,
    PropertyDetailAPIView,
    PropertyExistAPIView,
    PropertyPublicListAPIView,
    PropertyRentDetailAPIView,
    PropertyRentListAPIView,
    PropertyDropdownAPIView,
)
from api.property_api.property.views.property_search_views import PropertySearchView
from api.property_api.property.views.flag_review import (
    PropertyFlagAPIView, PropertyUnflagAPIView, 
    PropertyFlaggedListAPIView
)
from api.property_api.property.views.review import (
    PropertyReviewsListCreateAPIView,
    PropertyReviewsDetailAPIView,
    PropertyReviewsPublicListAPIView
)
from api.property_api.property.views.country_based_property import PropertyCountryListView
from api.property_api.property.views.global_search import GlobalSearchView
from api.property_api.property.views.property_approve import ApprovePropertyView
from api.property_api.property.views.property_partial_modification import PropertyPartialUpdateAPIView
urlpatterns = [
    path("properties/public/", PropertyPublicListAPIView.as_view(), name="properties-public-list"), 
    path("properties/", PropertyListCreateAPIView.as_view(), name="properties-list-create"),
    path("properties/<int:pk>/", PropertyDetailAPIView.as_view(), name="properties-detail"),
    path("properties/isexist/<str:name>/", PropertyExistAPIView.as_view(), name="properties-exist"),
    path("properties/search/", PropertySearchView.as_view(), name="property-search"),
    path('properties/buy/', PropertyBuyListAPIView.as_view(), name='property-buy'),
    path('properties/rent/', PropertyRentListAPIView.as_view(), name='property-rent'),
    path("properties/buy/<int:pk>/", PropertyBuyDetailAPIView.as_view(), name="properties-detail-buy"),
    path("properties/rent/<int:pk>/", PropertyRentDetailAPIView.as_view(), name="properties-detail-rent"),
    path("properties/dropdown/", PropertyDropdownAPIView.as_view(), name="properties-dropdown"),

     # Reviews endpoints
    path("properties/reviews/public/", PropertyReviewsPublicListAPIView.as_view(), name="property-reviews-public-list"),
    path("properties/reviews/", PropertyReviewsListCreateAPIView.as_view(), name="property-reviews-list-create"),
    path("properties/reviews/<int:pk>/", PropertyReviewsDetailAPIView.as_view(),    name="property-reviews-detail"),    

    # Individual flag endpoints
    path("properties/<int:pk>/flag/", PropertyFlagAPIView.as_view(), name="property-flag"),
    path("properties/<int:pk>/unflag/", PropertyUnflagAPIView.as_view(), name="property-unflag"),
    path("properties/flagged-list/", PropertyFlaggedListAPIView.as_view(), name="property-flagged-list"),
    path("global/", GlobalSearchView.as_view(), name="global-search"),

    # country based property
    path("countries/properties/", PropertyCountryListView.as_view()),

    # Approve property
    path("properties/<int:property_id>/approve/", ApprovePropertyView.as_view()),

    # Partial update of property
     path('properties/<int:pk>/partial/', PropertyPartialUpdateAPIView.as_view()),
]
