# urls.py
from django.urls import path

from events.views.rsvp import post_step_activities
from . import views

app_name = "events"

urlpatterns = [
    
    # Main event page
    path("events/<slug:slug>/", views.event, name="event"),
    
    # Invite URL, can only be used once
    path("invite/<slug:slug>", views.invite_redirect, name="invite"),
    
    # RSVP Form
    path("rsvp/<uuid:code>/page/<str:page>", views.rsvp_base_page, name="rsvp-base"),
    path("htmx/rsvp/<str:id>/page/<str:page>", views.rsvp_pages, name="rsvp-pages"),
    
    path(
        "htmx/rsvp/<str:id>/navigate/<str:page>",
        views.page_change,
        name="rsvp-page-change",
    ),
    
    path(
        "htmx/rsvp/<str:id>/post/email",
        views.post_step_email,
        name="rsvp-post-email",
    ),
    
    path(
        "htmx/rsvp/<str:id>/post/guest",
        views.post_step_guest,
        name="rsvp-post-guest"
    ),
    
    path(
        "htmx/rsvp/<str:id>/delete/guest/<str:gid>",
        views.delete_step_guest,
        name="rsvp-delete-guest"
    ),
    
    path(
        "htmx/rsvp/<str:id>/post/activity/<str:aid>",
        views.post_step_activities,
        name="rsvp-post-activity"
    ),
    
    # POST response for RSVP-scoped question
    path(
        "htmx/rsvp/<str:id>/post/question/<str:qid>/",
        views.post_response_rsvp,
        name="rsvp-post-response",
    ),

    # POST response for Guest-scoped question
    path(
        "htmx/rsvp/<str:id>/post/question/<str:qid>/guest/<str:gid>/",
        views.post_response_guest,
        name="rsvp-post-response-guest",
    ),
    
    path(
        "htmx/rsvp/<str:id>/post/notes",
        views.post_step_notes,
        name="rsvp-post-notes",
    ),
    
    path(
        "htmx/rsvp/<str:id>/start",
        views.rsvp_start,
        name="rsvp-start",
    ),
    
    path(
        "htmx/rsvp/<str:id>/restart",
        views.rsvp_restart,
        name="rsvp-restart",
    ),
    
    path(
        "htmx/rsvp/<str:id>/update",
        views.rsvp_update,
        name="rsvp-update",
    ),
    
    path(
        "htmx/rsvp/<str:id>/decline",
        views.rsvp_decline,
        name="rsvp-decline",
    ),

]
