"""
OAuth URL Configuration

URL routes for OAuth email integration endpoints.
"""

from django.urls import path
from .oauth_views import (
    OAuthStatusView,
    OAuthProvidersView,
    GoogleOAuthInitiateView,
    GoogleOAuthCallbackView,
    MicrosoftOAuthInitiateView,
    MicrosoftOAuthCallbackView,
    OAuthCredentialListView,
    OAuthCredentialDeleteView,
)

app_name = 'oauth'

urlpatterns = [
    # Status (admin only)
    path('status/', OAuthStatusView.as_view(), name='status'),
    # Providers (public - for login page)
    path('providers/', OAuthProvidersView.as_view(), name='providers'),

    # Google OAuth
    path('google/initiate/', GoogleOAuthInitiateView.as_view(), name='google-initiate'),
    path('google/callback/', GoogleOAuthCallbackView.as_view(), name='google-callback'),

    # Microsoft OAuth
    path('microsoft/initiate/', MicrosoftOAuthInitiateView.as_view(), name='microsoft-initiate'),
    path('microsoft/callback/', MicrosoftOAuthCallbackView.as_view(), name='microsoft-callback'),

    # Credential management
    path('credentials/', OAuthCredentialListView.as_view(), name='credential-list'),
    path('credentials/<int:credential_id>/', OAuthCredentialDeleteView.as_view(), name='credential-delete'),
]
