from django.urls import path

from . import views

app_name = "management"

urlpatterns = [
    path("", views.HomeView.as_view(), name="home"),
    path("notifications/mark-all-read/", views.NotificationMarkAllReadView.as_view(), name="notification_mark_all_read"),
    # People
    path("members/", views.MemberListView.as_view(), name="member_list"),
    path("memberships/", views.MembershipListView.as_view(), name="membership_list"),
    path("memberships/mark-paid/", views.MembershipMarkPaidView.as_view(), name="membership_mark_paid"),
    path("memberships/export/", views.MembershipExportPdfView.as_view(), name="membership_export_pdf"),
    path("memberships/<uuid:pk>/mark-fully-paid/", views.MembershipMarkFullyPaidView.as_view(), name="membership_mark_fully_paid"),
    path("memberships/<uuid:pk>/record-payment/", views.MembershipRecordPaymentView.as_view(), name="membership_record_payment"),
    path("memberships/send-invoices/", views.MembershipSendInvoicesView.as_view(), name="membership_send_invoices"),
    path("memberships/send-invoice-reminders/", views.MembershipSendInvoiceRemindersView.as_view(), name="membership_send_invoice_reminders"),
    path("memberships/<uuid:pk>/invoice/", views.DuesInvoiceDetailView.as_view(), name="membership_invoice_detail"),
    path("memberships/<uuid:pk>/invoice/pdf/", views.DuesInvoicePdfView.as_view(), name="membership_invoice_pdf"),
    path("members/new/", views.MemberCreateView.as_view(), name="member_create"),
    path("members/import/template/", views.MemberImportTemplateView.as_view(), name="member_import_template"),
    path("members/import/", views.MemberImportView.as_view(), name="member_import"),
    path("members/import/confirm/", views.MemberImportConfirmView.as_view(), name="member_import_confirm"),
    path("members/<uuid:pk>/", views.MemberDetailView.as_view(), name="member_detail"),
    path("members/<uuid:pk>/edit/", views.MemberUpdateView.as_view(), name="member_update"),
    path("members/<uuid:pk>/delete/", views.MemberDeleteView.as_view(), name="member_delete"),
    path("members/<uuid:pk>/attach-family/", views.MemberAttachToFamilyView.as_view(), name="member_attach_family"),
    path("members/<uuid:pk>/grant-login/", views.MemberGrantLoginView.as_view(), name="member_grant_login"),
    path("members/<uuid:pk>/referee-eligibility/", views.MemberRefereeEligibilityUpdateView.as_view(), name="member_referee_eligibility_update"),
    path("members/<uuid:pk>/detach-family/<uuid:family_pk>/", views.MemberDetachFromFamilyView.as_view(), name="member_detach_family"),
    path("members/<uuid:pk>/requirements/<uuid:requirement_pk>/complete/", views.MemberRequirementCompleteView.as_view(), name="member_requirement_complete"),
    path("members/<uuid:pk>/requirements/<uuid:requirement_pk>/bypass/", views.MemberRequirementBypassView.as_view(), name="member_requirement_bypass"),
    path("members/<uuid:pk>/requirements/<uuid:requirement_pk>/incomplete/", views.MemberRequirementIncompleteView.as_view(), name="member_requirement_incomplete"),
    path("members/<uuid:pk>/requirements/<uuid:requirement_pk>/document/", views.MemberRequirementDocumentView.as_view(), name="member_requirement_document"),
    # Sign-up (admin only)
    path("signup/", views.SignupDashboardView.as_view(), name="signup_list"),
    path("signup/approve-all-clean/", views.SignupApproveAllCleanView.as_view(), name="signup_approve_all_clean"),
    path("signup/<uuid:pk>/approve/", views.SignupApproveOneView.as_view(), name="signup_approve_one"),
    path("signup/<uuid:pk>/place-in-team/", views.SignupPlaceInTeamView.as_view(), name="signup_place_in_team"),
    path("families/", views.FamilyListView.as_view(), name="family_list"),
    path("families/new/", views.FamilyCreateView.as_view(), name="family_create"),
    path("families/<uuid:pk>/", views.FamilyDetailView.as_view(), name="family_detail"),
    path("families/<uuid:pk>/add-child/", views.FamilyAddChildView.as_view(), name="family_add_child"),
    path("families/<uuid:pk>/add-parent/", views.FamilyAddParentView.as_view(), name="family_add_parent"),
    path("families/<uuid:family_pk>/members/<uuid:member_pk>/role/", views.FamilyMembershipRoleUpdateView.as_view(), name="family_membership_role_update"),
    # Club setup (admin only)
    path("positions/", views.PositionListView.as_view(), name="position_list"),
    path("positions/new/", views.PositionCreateView.as_view(), name="position_create"),
    path("positions/<uuid:pk>/edit/", views.PositionUpdateView.as_view(), name="position_update"),
    path("positions/<uuid:pk>/delete/", views.PositionDeleteView.as_view(), name="position_delete"),
    path("roles/", views.ClubRoleListView.as_view(), name="role_list"),
    path("roles/new/", views.ClubRoleCreateView.as_view(), name="role_create"),
    path("roles/<uuid:pk>/revoke/", views.ClubRoleRevokeView.as_view(), name="role_revoke"),
    path("parent-claims/", views.ParentClaimListView.as_view(), name="parent_claim_list"),
    path("parent-claims/<uuid:pk>/approve/", views.ParentClaimApproveView.as_view(), name="parent_claim_approve"),
    path("parent-claims/<uuid:pk>/reject/", views.ParentClaimRejectView.as_view(), name="parent_claim_reject"),
    path("groups/", views.GroupListView.as_view(), name="group_list"),
    path("groups/new/", views.GroupCreateView.as_view(), name="group_create"),
    path("groups/<uuid:pk>/", views.GroupDetailView.as_view(), name="group_detail"),
    path("groups/<uuid:pk>/edit/", views.GroupUpdateView.as_view(), name="group_update"),
    path("groups/<uuid:pk>/delete/", views.GroupDeleteView.as_view(), name="group_delete"),
    path("groups/<uuid:pk>/bulk-add/", views.GroupBulkAddView.as_view(), name="group_bulk_add"),
    path("groups/<uuid:pk>/members/<uuid:membership_pk>/remove/", views.GroupMemberRemoveView.as_view(), name="group_member_remove"),
    # Teams
    path("teams/", views.TeamListView.as_view(), name="team_list"),
    path("teams/new/", views.TeamCreateView.as_view(), name="team_create"),
    path("teams/<uuid:pk>/", views.TeamDetailView.as_view(), name="team_detail"),
    path("teams/<uuid:pk>/edit/", views.TeamUpdateView.as_view(), name="team_update"),
    path("teams/<uuid:pk>/delete/", views.TeamDeleteView.as_view(), name="team_delete"),
    path("teams/<uuid:pk>/roster/<uuid:season_pk>/add/", views.TeamRosterAddView.as_view(), name="team_roster_add"),
    path("teams/<uuid:pk>/roster/<uuid:season_pk>/bulk-add/", views.TeamBulkAddView.as_view(), name="team_bulk_add"),
    path("teams/<uuid:pk>/roster/<uuid:membership_pk>/edit/", views.TeamRosterUpdateView.as_view(), name="team_roster_update"),
    path("teams/<uuid:pk>/roster/<uuid:membership_pk>/remove/", views.TeamRosterRemoveView.as_view(), name="team_roster_remove"),
    path("teams/<uuid:pk>/staff/<uuid:season_pk>/add/", views.TeamStaffAddView.as_view(), name="team_staff_add"),
    path("teams/<uuid:pk>/staff/<uuid:assignment_pk>/edit/", views.TeamStaffUpdateView.as_view(), name="team_staff_update"),
    path("teams/<uuid:pk>/staff/<uuid:assignment_pk>/remove/", views.TeamStaffRemoveView.as_view(), name="team_staff_remove"),
    path("teams/<uuid:pk>/photo/<uuid:season_pk>/set/", views.TeamPhotoSetView.as_view(), name="team_photo_set"),
    path("teams/<uuid:pk>/photo/<uuid:season_pk>/delete/", views.TeamPhotoDeleteView.as_view(), name="team_photo_delete"),
    path("referees/", views.RefereeListView.as_view(), name="referee_list"),
    path("referees/management/", views.RefereeManagementDashboardView.as_view(), name="referee_management"),
    path("referee-levels/", views.RefereeLevelListView.as_view(), name="referee_level_list"),
    path("referee-levels/new/", views.RefereeLevelCreateView.as_view(), name="referee_level_create"),
    path("referee-levels/<uuid:pk>/edit/", views.RefereeLevelUpdateView.as_view(), name="referee_level_update"),
    path("referee-levels/<uuid:pk>/delete/", views.RefereeLevelDeleteView.as_view(), name="referee_level_delete"),
    # News
    path("news/", views.NewsListView.as_view(), name="news_list"),
    path("news/new/", views.NewsCreateView.as_view(), name="news_create"),
    path("news/<uuid:pk>/", views.NewsDetailView.as_view(), name="news_detail"),
    path("news/<uuid:pk>/edit/", views.NewsUpdateView.as_view(), name="news_update"),
    path("news/<uuid:pk>/delete/", views.NewsDeleteView.as_view(), name="news_delete"),
    path("news/<uuid:pk>/submit-for-review/", views.NewsSubmitForReviewView.as_view(), name="news_submit_for_review"),
    path("news/<uuid:pk>/publish/", views.NewsPublishView.as_view(), name="news_publish"),
    path("news/<uuid:pk>/unpublish/", views.NewsUnpublishView.as_view(), name="news_unpublish"),
    path("news/<uuid:pk>/photos/", views.NewsPhotoUploadView.as_view(), name="news_photo_upload"),
    path("news/<uuid:pk>/photos/<uuid:photo_pk>/set-main/", views.NewsPhotoSetMainView.as_view(), name="news_photo_set_main"),
    path("news/<uuid:pk>/photos/<uuid:photo_pk>/delete/", views.NewsPhotoDeleteView.as_view(), name="news_photo_delete"),
    # Calendar
    path("events/", views.EventListView.as_view(), name="event_list"),
    path("events/new/", views.EventCreateView.as_view(), name="event_create"),
    path("events/<uuid:pk>/", views.EventDetailView.as_view(), name="event_detail"),
    path("events/<uuid:pk>/edit/", views.EventUpdateView.as_view(), name="event_update"),
    path("events/<uuid:pk>/delete/", views.EventDeleteView.as_view(), name="event_delete"),
    path("events/<uuid:pk>/detach/", views.EventDetachView.as_view(), name="event_detach"),
    path("events/<uuid:pk>/fetch-game-info/", views.EventFetchGameInfoView.as_view(), name="event_fetch_game_info"),
    path("events/<uuid:pk>/referees/assign/", views.EventRefereeAssignView.as_view(), name="event_referee_assign"),
    path("events/<uuid:pk>/referees/add-external/", views.EventRefereeAddExternalView.as_view(), name="event_referee_add_external"),
    path("events/<uuid:pk>/referees/<uuid:referee_pk>/remove/", views.EventRefereeRemoveView.as_view(), name="event_referee_remove"),
    path("events/<uuid:pk>/referees/<uuid:referee_pk>/fee/", views.EventRefereeFeeUpdateView.as_view(), name="event_referee_fee_update"),
    path("events/<uuid:pk>/referees/form-pdf/", views.EventRefereeFormPdfView.as_view(), name="event_referee_form_pdf"),
    path("events/rbihf-import/", views.RBIHFImportView.as_view(), name="rbihf_import"),
    path("events/rbihf-import/confirm/", views.RBIHFImportConfirmView.as_view(), name="rbihf_import_confirm"),
    path("event-series/new/", views.EventSeriesCreateView.as_view(), name="event_series_create"),
    path("event-series/<uuid:pk>/", views.EventSeriesDetailView.as_view(), name="event_series_detail"),
    path("event-series/<uuid:pk>/edit/", views.EventSeriesUpdateView.as_view(), name="event_series_update"),
    path("event-series/<uuid:pk>/delete/", views.EventSeriesDeleteView.as_view(), name="event_series_delete"),
    path("event-series/<uuid:pk>/stop/", views.EventSeriesStopView.as_view(), name="event_series_stop"),
    path("event-series/<uuid:pk>/generate/", views.EventSeriesGenerateView.as_view(), name="event_series_generate"),
    path("locations/", views.LocationListView.as_view(), name="location_list"),
    path("locations/new/", views.LocationCreateView.as_view(), name="location_create"),
    path("locations/<uuid:pk>/edit/", views.LocationUpdateView.as_view(), name="location_update"),
    path("locations/<uuid:pk>/delete/", views.LocationDeleteView.as_view(), name="location_delete"),
    path("opponents/", views.OpponentListView.as_view(), name="opponent_list"),
    path("opponents/new/", views.OpponentCreateView.as_view(), name="opponent_create"),
    path("opponents/<uuid:pk>/edit/", views.OpponentUpdateView.as_view(), name="opponent_update"),
    path("opponents/<uuid:pk>/delete/", views.OpponentDeleteView.as_view(), name="opponent_delete"),
    # Sponsors (admin only)
    path("sponsors/", views.SponsorListView.as_view(), name="sponsor_list"),
    path("sponsors/new/", views.SponsorCreateView.as_view(), name="sponsor_create"),
    path("sponsors/<uuid:pk>/edit/", views.SponsorUpdateView.as_view(), name="sponsor_update"),
    path("sponsors/<uuid:pk>/delete/", views.SponsorDeleteView.as_view(), name="sponsor_delete"),
    # Shop (admin only)
    path("shop/products/", views.ProductListView.as_view(), name="product_list"),
    path("shop/orders/", views.OrderListView.as_view(), name="order_list"),
    path("shop/discounts/", views.DiscountListView.as_view(), name="discount_list"),
    path("shop/invoices/", views.InvoiceListView.as_view(), name="invoice_list"),
    # Forms
    path("forms/", views.FormListView.as_view(), name="form_list"),
    path("forms/<uuid:pk>/submissions/", views.SubmissionListView.as_view(), name="submission_list"),
    # Evaluations (placeholder -- see ARCHITECTURE.md §5.8, nothing built yet)
    path("evaluations/", views.EvaluationsComingSoonView.as_view(), name="evaluations"),
    # Settings (admin only)
    path("settings/", views.ClubSettingsView.as_view(), name="club_settings"),
    path("settings/email-previews/<str:key>/render/", views.EmailPreviewRenderView.as_view(), name="email_preview_render"),
    path("settings/pdf-previews/<str:key>/render/", views.PDFPreviewRenderView.as_view(), name="pdf_preview_render"),
    path("settings/onboarding-requirements/", views.OnboardingRequirementListView.as_view(), name="onboarding_requirement_list"),
    path("settings/onboarding-requirements/new/", views.OnboardingRequirementCreateView.as_view(), name="onboarding_requirement_create"),
    path("settings/onboarding-requirements/<uuid:pk>/edit/", views.OnboardingRequirementUpdateView.as_view(), name="onboarding_requirement_update"),
    path("settings/onboarding-requirements/<uuid:pk>/delete/", views.OnboardingRequirementDeleteView.as_view(), name="onboarding_requirement_delete"),
]
