"""
academics/urls_report_cards.py

Include in your main urls.py:
    from django.urls import path, include
    urlpatterns = [
        ...
        path('', include('academics.urls_report_cards')),
    ]

Or merge into academics/urls.py.
"""

from django.urls import path
from academics.views_report_cards import (
    report_card_preview,
    report_card_pdf_download,
    bulk_class_pdf_download,
    ReportCardAPIView,
    BulkReportCardAPIView,
)

urlpatterns = [
    # ── Browser views ──────────────────────────────────────────
    # Preview a single report card as HTML in browser
    path(
        'report-card/<int:pk>/preview/',
        report_card_preview,
        name='rc-preview'
    ),
    # Download a single report card as PDF
    path(
        'report-card/<int:pk>/pdf/',
        report_card_pdf_download,
        name='rc-pdf'
    ),
    # Download all report cards for a class in a term as one merged PDF
    path(
        'report-card/bulk/<int:class_id>/<int:term_id>/',
        bulk_class_pdf_download,
        name='rc-bulk'
    ),

    # ── REST API ────────────────────────────────────────────────
    # GET  /api/report-cards/<pk>/pdf/     → single PDF
    path(
        'api/report-cards/<int:pk>/pdf/',
        ReportCardAPIView.as_view(),
        name='rc-api-pdf'
    ),
    # POST /api/report-cards/bulk/         → bulk PDF
    # Body: {"class_id": <int>, "term_id": <int>}
    path(
        'api/report-cards/bulk/',
        BulkReportCardAPIView.as_view(),
        name='rc-api-bulk'
    ),
]
