from django.urls import path

from apps.smehub.showcasing import views

app_name = "smehub_showcasing"

urlpatterns = [
    # Hub landing — re-homes Events / Challenges / Catalogue / My entries (Slice B.2).
    path("", views.ShowcasingHubView.as_view(), name="hub"),

    # Admin dashboard
    path("admin/dashboard/", views.ShowcasingAdminDashboardView.as_view(), name="admin_dashboard"),

    # Showcase events — public
    path("events/", views.ShowcaseEventListView.as_view(), name="event_list"),
    path("events/new/", views.ShowcaseEventCreateView.as_view(), name="event_create"),
    path("events/<int:pk>/", views.ShowcaseEventDetailView.as_view(), name="event_detail"),
    path("events/<int:pk>/edit/", views.ShowcaseEventUpdateView.as_view(), name="event_update"),
    path("events/<int:pk>/publish/", views.showcase_publish_view, name="event_publish"),
    path("events/<int:pk>/revert/", views.showcase_revert_view, name="event_revert"),
    path("events/<int:pk>/go-live/", views.showcase_go_live_view, name="event_go_live"),
    path("events/<int:pk>/join/", views.showcase_event_join_view, name="event_join"),
    path("events/<int:pk>/conclude/", views.showcase_conclude_view, name="event_conclude"),
    path("events/<int:pk>/apply/", views.ApplyToEventView.as_view(), name="event_apply"),
    path("events/<int:pk>/applications/", views.EventApplicationsView.as_view(), name="event_applications"),
    path(
        "events/<int:pk>/applications/confirm/",
        views.confirm_event_participants_view,
        name="event_confirm_participants",
    ),
    path(
        "events/<int:pk>/applications/finalise/",
        views.finalise_event_selection_view,
        name="event_finalise_selection",
    ),
    path("events/<int:pk>/attendance/", views.EventAttendanceView.as_view(), name="event_attendance"),

    # Innovation challenges
    path("challenges/", views.ChallengeListView.as_view(), name="challenge_list"),
    path("challenges/new/", views.ChallengeCreateView.as_view(), name="challenge_create"),
    path("challenges/<int:pk>/", views.ChallengeDetailView.as_view(), name="challenge_detail"),
    path("challenges/<int:pk>/edit/", views.ChallengeUpdateView.as_view(), name="challenge_update"),
    path("challenges/<int:pk>/rubric/", views.ChallengeRubricView.as_view(), name="challenge_rubric"),
    path("challenges/<int:pk>/publish/", views.challenge_publish_view, name="challenge_publish"),
    path("challenges/<int:pk>/apply/", views.ApplyToChallengeView.as_view(), name="challenge_apply"),
    path(
        "challenges/<int:pk>/applications/",
        views.ChallengeApplicationsView.as_view(),
        name="challenge_applications",
    ),
    path(
        "challenges/<int:pk>/applications/confirm/",
        views.confirm_challenge_participants_view,
        name="challenge_confirm_participants",
    ),
    # Slice B.3b/c — judging transition + winners UI.
    path(
        "challenges/<int:pk>/to-judging/",
        views.challenge_transition_to_judging_view,
        name="challenge_to_judging",
    ),
    path(
        "challenges/<int:pk>/announce-winners/",
        views.ChallengeAnnounceWinnersView.as_view(),
        name="challenge_announce_winners",
    ),

    # Application flows
    path("applications/<int:pk>/reject/", views.reject_application_view, name="application_reject"),
    path("applications/<int:pk>/withdraw/", views.withdraw_application_view, name="application_withdraw"),
    path("applications/<int:pk>/score/", views.PitchScoringView.as_view(), name="pitch_scoring"),
    path(
        "applications/<int:pk>/publish-to-catalogue/",
        views.PublishToCatalogueView.as_view(),
        name="catalogue_publish",
    ),
    path("my-applications/", views.MyApplicationsView.as_view(), name="my_applications"),

    # Innovation catalogue
    path("catalogue/", views.InnovationCatalogueView.as_view(), name="innovation_catalogue"),
    path("catalogue/<int:pk>/", views.InnovationDetailView.as_view(), name="innovation_detail"),
    path("catalogue/<int:pk>/update/", views.UpdateCatalogueView.as_view(), name="catalogue_update"),

    # Deal rooms
    path("deal-rooms/", views.MyDealRoomsView.as_view(), name="my_deal_rooms"),
    path("deal-rooms/new/", views.DealRoomOpenView.as_view(), name="deal_room_open"),
    path("deal-rooms/<int:pk>/", views.DealRoomDetailView.as_view(), name="deal_room_detail"),
    path("deal-rooms/<int:pk>/message/", views.deal_room_message_view, name="deal_room_message"),
    path("deal-rooms/<int:pk>/document/", views.deal_room_document_view, name="deal_room_document"),
    path("deal-rooms/<int:pk>/close/", views.deal_room_close_view, name="deal_room_close"),
    path("deal-rooms/<int:pk>/formalise/", views.formalise_agreement_view, name="agreement_formalise"),
]
