Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 196 additions & 41 deletions backend/samfundet/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# imports
from __future__ import annotations

from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
from drf_spectacular.views import (
SpectacularAPIView,
SpectacularRedocView,
SpectacularSwaggerView,
)

from rest_framework import routers

Expand All @@ -11,6 +15,7 @@
import samfundet.view.event_views
import samfundet.view.sulten_views
import samfundet.view.general_views
import samfundet.view.recruitment.applicant_views
from samfundet.view import billig_views

from . import views
Expand Down Expand Up @@ -48,21 +53,53 @@

########## Recruitment ##########
router.register('recruitment', recruitment_views.RecruitmentView, 'recruitment')
router.register('recruitment-for-recruiter', recruitment_views.RecruitmentForRecruiterView, 'recruitment_for_recruiter')
router.register(
'recruitment-for-recruiter',
recruitment_views.RecruitmentForRecruiterView,
'recruitment_for_recruiter',
)
router.register('recruitment-stats', views.RecruitmentStatisticsView, 'recruitment_stats')
router.register('recruitment-separateposition', views.RecruitmentSeparatePositionView, 'recruitment_separateposition')
router.register(
'recruitment-separateposition',
views.RecruitmentSeparatePositionView,
'recruitment_separateposition',
)
router.register('recruitment-position', views.RecruitmentPositionView, 'recruitment_position')
router.register('recruitment-position-for-applicant', views.RecruitmentPositionForApplicantView, 'recruitment_position_for_applicant')
router.register('recruitment-applications-for-applicant', views.RecruitmentApplicationForApplicantView, 'recruitment_applications_for_applicant')
router.register('recruitment-applications-for-gang', recruitment_views.RecruitmentApplicationForGangView, 'recruitment_applications_for_gang')
router.register('recruitment-applications-for-position', views.RecruitmentApplicationForRecruitmentPositionView, 'recruitment_applications_for_position')
router.register(
'recruitment-position-for-applicant',
samfundet.view.recruitment.applicant_views.RecruitmentPositionForApplicantView,
'recruitment_position_for_applicant',
)
router.register(
'recruitment-applications-for-applicant',
samfundet.view.recruitment.applicant_views.RecruitmentApplicationForApplicantView,
'recruitment_applications_for_applicant',
)
router.register(
'recruitment-applications-for-gang',
recruitment_views.RecruitmentApplicationForGangView,
'recruitment_applications_for_gang',
)
router.register(
'recruitment-applications-for-position',
views.RecruitmentApplicationForRecruitmentPositionView,
'recruitment_applications_for_position',
)
router.register('interview', views.InterviewView, 'interview')

########## Billig ##########
# TODO: these will probably be replaced or removed when we actually connect to Billig
router.register('billig-event', billig_views.BilligEventReadOnlyModelViewSet, 'billig_event')
router.register('billig-price-group', billig_views.BilligPriceGroupReadOnlyModelViewSet, 'billig_price_group')
router.register('billig-ticket-group', billig_views.BilligTicketGroupReadOnlyModelViewSet, 'billig_ticket_group')
router.register(
'billig-price-group',
billig_views.BilligPriceGroupReadOnlyModelViewSet,
'billig_price_group',
)
router.register(
'billig-ticket-group',
billig_views.BilligTicketGroupReadOnlyModelViewSet,
'billig_ticket_group',
)

######## Lyche #########
# Lyche routes go here
Expand All @@ -72,48 +109,112 @@
urlpatterns = [
path('api/', include(router.urls)),
path('schema/', SpectacularAPIView.as_view(), name='schema'),
path('schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='samfundet:schema'), name='swagger_ui'),
path('schema/redoc/', SpectacularRedocView.as_view(url_name='samfundet:schema'), name='redoc'),
path(
'schema/swagger-ui/',
SpectacularSwaggerView.as_view(url_name='samfundet:schema'),
name='swagger_ui',
),
path(
'schema/redoc/',
SpectacularRedocView.as_view(url_name='samfundet:schema'),
name='redoc',
),
path('csrf/', samfundet.view.user_views.CsrfView.as_view(), name='csrf'),
path('login/', samfundet.view.user_views.LoginView.as_view(), name='login'),
path('register/', samfundet.view.user_views.RegisterView.as_view(), name='register'),
path('logout/', samfundet.view.user_views.LogoutView.as_view(), name='logout'),
path('password/change/', samfundet.view.user_views.ChangePasswordView.as_view(), name='change-password'),
path(
'password/change/',
samfundet.view.user_views.ChangePasswordView.as_view(),
name='change-password',
),
path('user/', samfundet.view.user_views.UserView.as_view(), name='user'),
path('groups/', samfundet.view.user_views.AllGroupsView.as_view(), name='groups'),
path('users/', samfundet.view.user_views.AllUsersView.as_view(), name='users'),
path('users-search-paginated/', samfundet.view.user_views.PaginatedSearchUsersView.as_view(), name='users_search_paginated'),
path('impersonate/', samfundet.view.user_views.ImpersonateView.as_view(), name='impersonate'),
path('events-per-day/', samfundet.view.event_views.EventPerDayView.as_view(), name='eventsperday'),
path('events-upcomming/', samfundet.view.event_views.EventsUpcomingView.as_view(), name='eventsupcomming'),
path('isclosed/', samfundet.view.general_views.IsClosedView().as_view(), name='isclosed'),
path(
'users-search-paginated/',
samfundet.view.user_views.PaginatedSearchUsersView.as_view(),
name='users_search_paginated',
),
path(
'impersonate/',
samfundet.view.user_views.ImpersonateView.as_view(),
name='impersonate',
),
path(
'events-per-day/',
samfundet.view.event_views.EventPerDayView.as_view(),
name='eventsperday',
),
path(
'events-upcomming/',
samfundet.view.event_views.EventsUpcomingView.as_view(),
name='eventsupcomming',
),
path(
'isclosed/',
samfundet.view.general_views.IsClosedView().as_view(),
name='isclosed',
),
path('home/', samfundet.view.general_views.HomePageView().as_view(), name='home'),
path('assign_group/', samfundet.view.user_views.AssignGroupView.as_view(), name='assign_group'),
path(
'assign_group/',
samfundet.view.user_views.AssignGroupView.as_view(),
name='assign_group',
),
path('webhook/', views.WebhookView.as_view(), name='webhook'),
path('gangtypes/<int:organization>/', samfundet.view.general_views.GangTypeOrganizationView.as_view(), name='gangsorganized'),
path(
'gangtypes/<int:organization>/',
samfundet.view.general_views.GangTypeOrganizationView.as_view(),
name='gangsorganized',
),
########## Lyche ##########
path('check-reservation/', samfundet.view.sulten_views.ReservationCheckAvailabilityView.as_view(), name='check_reservation'),
path('reservations/', samfundet.view.sulten_views.ReservationCreateView.as_view(), name='reservation-create'),
path(
'check-reservation/',
samfundet.view.sulten_views.ReservationCheckAvailabilityView.as_view(),
name='check_reservation',
),
path(
'reservations/',
samfundet.view.sulten_views.ReservationCreateView.as_view(),
name='reservation-create',
),
########## Recruitment ##########
path('active-recruitments/', views.ActiveRecruitmentsView.as_view(), name='active_recruitments'),
path('recruitment-positions/', views.RecruitmentPositionsPerRecruitmentView.as_view(), name='recruitment_positions'),
path(
'active-recruitments/',
views.ActiveRecruitmentsView.as_view(),
name='active_recruitments',
),
path(
'recruitment-positions/',
views.RecruitmentPositionsPerRecruitmentView.as_view(),
name='recruitment_positions',
),
path(
'recruitment-show-unprocessed-applicants/',
views.RecruitmentUnprocessedApplicationsPerRecruitment.as_view(),
name='recruitment_show_unprocessed_applicants',
),
path(
'recruitment-positions-gang-for-applicant/',
views.RecruitmentPositionsPerGangForApplicantView.as_view(),
samfundet.view.recruitment.applicant_views.RecruitmentPositionsPerGangForApplicantView.as_view(),
name='recruitment_positions_gang_for_applicants',
),
path(
'recruitment-shared-interview-groups/<int:recruitment_id>/',
views.RecruitmentInterviewGroupView.as_view(),
name='recruitment_shared_interviews',
),
path('recruitment-positions-gang-for-gangs/', views.RecruitmentPositionsPerGangForGangView.as_view(), name='recruitment_positions_gang_for_gangs'),
path('recruitment-set-interview/<slug:pk>/', views.RecruitmentApplicationSetInterviewView.as_view(), name='recruitment_set_interview'),
path(
'recruitment-positions-gang-for-gangs/',
views.RecruitmentPositionsPerGangForGangView.as_view(),
name='recruitment_positions_gang_for_gangs',
),
path(
'recruitment-set-interview/<slug:pk>/',
views.RecruitmentApplicationSetInterviewView.as_view(),
name='recruitment_set_interview',
),
path(
'recruitment-application-states-choices',
views.RecruitmentApplicationStateChoicesView.as_view(),
Expand Down Expand Up @@ -141,19 +242,39 @@
),
path(
'recruitment-application-interview-notes/<int:interview_id>/',
views.RecruitmentApplicationInterviewNotesView.as_view(),
samfundet.view.recruitment.applicant_views.RecruitmentApplicationInterviewNotesView.as_view(),
name='recruitment_application_interview_notes',
),
path('recruitment-withdraw-application/<int:pk>/', views.RecruitmentApplicationWithdrawApplicantView.as_view(), name='recruitment_withdraw_application'),
path('recruitment-user-priority-update/<slug:pk>/', views.RecruitmentApplicationApplicantPriorityView.as_view(), name='recruitment_user_priority_update'),
path(
'recruitment-withdraw-application/<int:pk>/',
samfundet.view.recruitment.applicant_views.RecruitmentApplicationWithdrawApplicantView.as_view(),
name='recruitment_withdraw_application',
),
path(
'recruitment-user-priority-update/<slug:pk>/',
samfundet.view.recruitment.applicant_views.RecruitmentApplicationApplicantPriorityView.as_view(),
name='recruitment_user_priority_update',
),
path(
'recruitment-withdraw-application-recruiter/<slug:pk>/',
views.RecruitmentApplicationWithdrawRecruiterView.as_view(),
name='recruitment_withdraw_application_recruiter',
),
path('active-recruitment-positions/', views.ActiveRecruitmentPositionsView.as_view(), name='active_recruitment_positions'),
path('rejected-applicants/', views.SendRejectionMailView.as_view(), name='rejected_applicants/'),
path('recruitment-applicants-without-interviews/<int:pk>/', views.ApplicantsWithoutInterviewsView.as_view(), name='applicants_without_interviews'),
path(
'active-recruitment-positions/',
views.ActiveRecruitmentPositionsView.as_view(),
name='active_recruitment_positions',
),
path(
'rejected-applicants/',
views.SendRejectionMailView.as_view(),
name='rejected_applicants/',
),
path(
'recruitment-applicants-without-interviews/<int:pk>/',
views.ApplicantsWithoutInterviewsView.as_view(),
name='applicants_without_interviews',
),
path(
'recruitment-applicants-without-three-interview-criteria/<int:pk>/',
views.ApplicantsWithoutThreeInterviewsCriteriaView.as_view(),
Expand All @@ -174,16 +295,50 @@
views.DownloadRecruitmentApplicationGangCSV.as_view(),
name='recruitment_download_gang_application_csv',
),
path('occupiedtimeslot/', views.OccupiedTimeslotView.as_view(), name='occupied_timeslots'),
path('occupiedtime-for-user/', views.OccupiedTimeslotForUserView.as_view(), name='occupiedtime_for_user'),
path(
'recruitment/<int:recruitment_id>/interviewer-availability/', views.InterviewerAvailabilityForDate.as_view(), name='interviewer-availability-for-date'
'occupiedtimeslot/',
views.OccupiedTimeslotView.as_view(),
name='occupied_timeslots',
),
path(
'occupiedtime-for-user/',
views.OccupiedTimeslotForUserView.as_view(),
name='occupiedtime_for_user',
),
path(
'recruitment/<int:recruitment_id>/interviewer-availability/',
views.InterviewerAvailabilityForDate.as_view(),
name='interviewer-availability-for-date',
),
path(
'recruitment-interview-availability/',
views.RecruitmentInterviewAvailabilityView.as_view(),
name='recruitment_interview_availability',
),
path(
'recruitment/<int:id>/availability/',
views.RecruitmentAvailabilityView.as_view(),
name='recruitment_availability',
),
path(
'feedback/',
samfundet.view.general_views.UserFeedbackView.as_view(),
name='feedback',
),
path(
'purchase-feedback/',
samfundet.view.event_views.PurchaseFeedbackView.as_view(),
name='purchase_feedback',
),
path(
'recruitment/<int:recruitment_id>/gang/<int:gang_id>/stats/',
views.GangApplicationCountView.as_view(),
name='gang-application-stats',
),
path(
'recruitment/<int:id>/positions-by-tags/',
samfundet.view.recruitment.applicant_views.PositionByTagsView.as_view(),
name='recruitment_positions_by_tags',
),
path('recruitment-interview-availability/', views.RecruitmentInterviewAvailabilityView.as_view(), name='recruitment_interview_availability'),
path('recruitment/<int:id>/availability/', views.RecruitmentAvailabilityView.as_view(), name='recruitment_availability'),
path('feedback/', samfundet.view.general_views.UserFeedbackView.as_view(), name='feedback'),
path('purchase-feedback/', samfundet.view.event_views.PurchaseFeedbackView.as_view(), name='purchase_feedback'),
path('recruitment/<int:recruitment_id>/gang/<int:gang_id>/stats/', views.GangApplicationCountView.as_view(), name='gang-application-stats'),
path('recruitment/<int:id>/positions-by-tags/', views.PositionByTagsView.as_view(), name='recruitment_positions_by_tags'),
path('recruitment/all-applications/', views.RecruitmentAllApplicationsPerRecruitmentView.as_view(), name='recruitment-all-applications'),
]
Loading
Loading