from django.urls import path, include
from rest_framework.routers import DefaultRouter
from core.api_views import BookmarkViewSet, TeamViewSet, ApiStatusView
from core.views import (
    BookmarkListView, BookmarkCreateView, BookmarkDetailView, 
    BookmarkUpdateView, BookmarkDeleteView,
    TeamListView, TeamDetailView, BookmarkShareToggleView,
    BookmarkRegenerateView, SummaryUpdateView, ExtractionUpdateView,
    UserActivityLogView
)

router = DefaultRouter()
router.register(r'bookmarks', BookmarkViewSet, basename='api-bookmark')
router.register(r'teams', TeamViewSet, basename='api-team')

urlpatterns = [
    path("", BookmarkListView.as_view(), name="home"),
    path("bookmark/add/", BookmarkCreateView.as_view(), name="bookmark-add"),
    path("bookmark/<int:pk>/", BookmarkDetailView.as_view(), name="bookmark-detail"),
    path("bookmark/<int:pk>/edit/", BookmarkUpdateView.as_view(), name="bookmark-edit"),
    path("bookmark/<int:pk>/delete/", BookmarkDeleteView.as_view(), name="bookmark-delete"),
    path("bookmark/<int:pk>/regenerate/", BookmarkRegenerateView.as_view(), name="bookmark-regenerate"),
    path("bookmark/<int:pk>/summary/update/", SummaryUpdateView.as_view(), name="summary-update"),
    path("bookmark/<int:pk>/extraction/update/", ExtractionUpdateView.as_view(), name="extraction-update"),
    path("bookmark/<int:pk>/share/<int:team_id>/", BookmarkShareToggleView.as_view(), name="bookmark-share-toggle"),
    
    path("teams/", TeamListView.as_view(), name="team-list"),
    path("teams/<int:pk>/", TeamDetailView.as_view(), name="team-detail"),
    
    path("activity/", UserActivityLogView.as_view(), name="activity-log"),
    
    path("api/status/", ApiStatusView.as_view(), name="api-status"),
    path("api/", include(router.urls)),
]
