from django.urls import path
from .views import (
    # Post Views
    PostCreateView,
    PostListView,
    PostDetailView,
    PostUpdateView,
    PostDeleteView,
    UserPostsView,
    
    # Post Engagement
    ToggleLikeView,
    ToggleLoveView,
    
    # Comment Views
    CommentCreateView,
    CommentListView,
    CommentUpdateView,
    CommentDeleteView,
    
    # Comment Engagement
    ToggleCommentLikeView,
    ToggleCommentDislikeView,

    # Polls & Bookmarks
    PollVoteView,
    BookmarkToggleView,
    BookmarkListView,
)

app_name = 'posts'

urlpatterns = [
    # ========================================
    # POST ENDPOINTS
    # ========================================
    
    # List and Create Posts
    path("posts/", PostListView.as_view(), name="post-list"),
    path("posts/create/", PostCreateView.as_view(), name="post-create"),
    path("posts/my-posts/", UserPostsView.as_view(), name="user-posts"),
    
    # Single Post Operations
    path("posts/<int:post_id>/", PostDetailView.as_view(), name="post-detail"),
    path("posts/<int:post_id>/update/", PostUpdateView.as_view(), name="post-update"),
    path("posts/<int:post_id>/delete/", PostDeleteView.as_view(), name="post-delete"),
    
    # Post Engagement
    path("posts/<int:post_id>/like/", ToggleLikeView.as_view(), name="post-like"),
    path("posts/<int:post_id>/love/", ToggleLoveView.as_view(), name="post-love"),
    
    # ========================================
    # COMMENT ENDPOINTS
    # ========================================
    
    # List and Create Comments
    path("posts/<int:post_id>/comments/", CommentListView.as_view(), name="comment-list"),
    path("posts/<int:post_id>/comments/add/", CommentCreateView.as_view(), name="comment-create"),
    
    # Single Comment Operations
    path("comments/<int:comment_id>/update/", CommentUpdateView.as_view(), name="comment-update"),
    path("comments/<int:comment_id>/delete/", CommentDeleteView.as_view(), name="comment-delete"),
    
    # Comment Engagement
    path("comments/<int:comment_id>/like/", ToggleCommentLikeView.as_view(), name="comment-like"),
    path("comments/<int:comment_id>/dislike/", ToggleCommentDislikeView.as_view(), name="comment-dislike"),

    # ========================================
    # POLL & BOOKMARK ENDPOINTS
    # ========================================
    path("polls/options/<int:option_id>/vote/", PollVoteView.as_view(), name="poll-vote"),
    path("posts/<int:post_id>/bookmark/", BookmarkToggleView.as_view(), name="post-bookmark"),
    path("bookmarks/", BookmarkListView.as_view(), name="bookmark-list"),
]