from django.urls import path
from .views import (
    InstantConversationListView, InstantConversationCreateView, InstantConversationDeleteView,
    InstantMessageListView, InstantMessageCreateView,
    InstantMarkAsReadView, FileUploadView,
    InstantRecipientSearchView
)

urlpatterns = [
    # URLs pour messagerie instantanée
    path('conversations/', InstantConversationListView.as_view(), name='conversations'),
    path('create-conversation/', InstantConversationCreateView.as_view(), name='create_conversation'),
    path('send-message/', InstantMessageCreateView.as_view(), name='send_message'),
    path('conversations/mark-as-read/', InstantMarkAsReadView.as_view(), name='mark_as_read'),
    path('search-recipients/', InstantRecipientSearchView.as_view(), name='search_recipients'),
    path('upload-file/', FileUploadView.as_view(), name='upload_file'),

    # URLs avec paramètres - doivent être après les URLs statiques
    path('conversations/user/<int:user_id>/', InstantConversationListView.as_view(), name='conversations_by_user'),
    path('conversations/<uuid:conversation_id>/', InstantConversationDeleteView.as_view(), name='delete_conversation'),
    path('conversations/<uuid:conversation_id>/messages/', InstantMessageListView.as_view(), name='conversation_messages'),
]