from django.urls import include, path
from rest_framework.routers import DefaultRouter

from .views import JobDescriptionViewSet, LinkedInAuthView

router = DefaultRouter()
router.register("", JobDescriptionViewSet, basename="job")

urlpatterns = [
    # LinkedIn OAuth helper (must precede the router's <pk> catch-all)
    path("linkedin/auth-url/", LinkedInAuthView.as_view(), name="linkedin-auth-url"),
    path("linkedin/callback/", LinkedInAuthView.as_view(), name="linkedin-callback"),
    path("linkedin/status/", LinkedInAuthView.as_view(), name="linkedin-status"),
    path("linkedin/connect-token/", LinkedInAuthView.as_view(), name="linkedin-connect-token"),
    path("", include(router.urls)),
]
