from django.urls import include, path, re_path
from django.conf.urls import url
from django.contrib import admin
from ticketingApps import views
from django.contrib.auth import views as auth_views
app_name = "ticketingApps"
urlpatterns = [
    re_path(r'^$', views.IndexPage.as_view(), name="index"),
    re_path(r'^theater/list/$', views.TheaterListView.as_view(), name="theater-list"),
    re_path(r'^theater/entry/$', views.AddTheater.as_view(), name="add-theater"),
    re_path(r'^showings/list/$', views.ShowingsList.as_view(), name="showings-list"),
    re_path(r'^showings/(?P<pk>\d+)/detail/$', views.ShowingDetail.as_view(), name="showing-detail"),
    re_path(r'^ticket/print/(?P<orderId>\d+)/$', views.PrintTicket.as_view(), name="print-ticket"),
    re_path(r'^theater/search/$',views.TheaterSearchResults.as_view(), name="search-theater"),
    re_path(r'^accounts/login/$', auth_views.LoginView.as_view(), name='login'),
    re_path(r'^accounts/logout/$', auth_views.LogoutView.as_view(next_page="/"), name='logout'),
    re_path(r'^signup/$', views.Signup.as_view(), name='sign-up'),
    re_path(r'^hello/$',views.Welcome.as_view(), name='welcome'),
    re_path(r'^login_success/$',views.login_success,name='login_success'),
    re_path(r'^manager/$',views.ManagerLanding.as_view(),name='manager-landing'),
    re_path(r'^manager/theaters/$',views.ManagedTheaters.as_view(),name='theaters-filtered'),
    re_path(r'^manager/theaters/add_showing/(?P<theaterId>\d+)/$',views.AddShowing.as_view(),name='add-showing'),
    re_path(r'^manager/theaters/(?P<theaterId>\d+)/add_room/$', views.AddRoom.as_view(),name='add-room'),
    re_path(r'^manager/movie/add_movie/$', views.AddMovie.as_view(),name='add-movie'),
    re_path(r'^manager/movie/edit/(?P<pk>\d+)/$', views.EditMovie.as_view(), name='edit-movie'),
    re_path(r'^manager/movie/list/$',views.ListMovies.as_view(),name='list-movies'),
    re_path(r'^manager/movie/list/search/$', views.SearchMovies.as_view(),name='search-movies'),
    re_path(r'^manager/theater/(?P<pk>\d+)/delete/$', views.DeleteTheater.as_view(), name='delete-theater'),
    re_path(r'^manager/theater/(?P<pk>\d+)/details/$', views.TheaterDetail.as_view(), name='theater-detail'),
    re_path(r'^manager/theater/room/(?P<pk>\d+)/delete/$', views.DeleteRoom.as_view(), name='delete-room'),
    re_path(r'^manager/theater/showing/(?P<pk>\d+)/delete/$', views.DeleteShowing.as_view(), name='delete-showing'),
    re_path(r'^manager/theater/(?P<pk>\d+)/employee/add/$', views.AssociateEmployee.as_view(), name='add-employee'),
    re_path(r'^manager/showings/list/$', views.ManagedShowings.as_view(), name='managed-showings-list'),
    re_path(r'^manager/showings/list/filtered/$', views.ManagedShowingsSearchResults.as_view(), name='managed-showing-search'),
    re_path(r'^manager/pricing/group/create/$', views.CreatePricingGroup.as_view(), name="price-group-create"),
    re_path(r'^manager/pricing/point/create/$', views.CreatePricePoint.as_view(), name='price-point-create'),
    re_path(r'^manager/pricing/promocode/$', views.CreatePromoCode.as_view(), name='promo-code-create'),
    re_path(r'^manager/pricing/promocode/(?P<pk>\d+)/delete/$', views.DeletePromoCodes.as_view(), name='promo-code-delete'),
    re_path(r'^manager/pricing/promocode/list/$', views.ListPromoCodes.as_view(), name='promo-code-list'),
    re_path(r'^manager/pricing/group/list/$', views.ListPricingGroup.as_view(), name='price-group-list'),
    re_path(r'^showings/(?P<pk>\d+)/stats/$', views.ShowingAnalytics.as_view(), name='showing-stats'),
    re_path(r'^showings/(?P<showing>\d+)/order/$', views.SeatSelectionPage.as_view(), name='seat-selection'),
    re_path(r'^showings/order/ticketType/$', views.TicketTypeSelectionPage.as_view(), name='ticket-type'),
    re_path(r'^showings/order/payment/(?P<numberTix>\d+)/(?P<orderId>\d+|-\d+)$', views.SimpleOrderPage.as_view(), name='order'),
    re_path(r'^showings/order/charge/$', views.charge, name="charge"),
    re_path(r'^showings/search/$', views.ShowingsSearchResults.as_view(), name='showing-search'),
    re_path(r'^mytickets/$', views.UserTicketsListing.as_view(), name='ticket-list'),    
]
