from flask import Blueprint
from src.utils.decorators import handle_exceptions, token_required
from src.controller.principals import (
    login_func,
    dashboard_func,
    all_grades_func,
    section_progress_func
)

principals_bp = Blueprint("principals", __name__)

@principals_bp.route("/principal-login", methods=["POST"])
@handle_exceptions
def principal_login():
    return login_func()


@principals_bp.route("/principal-dashboard", methods=["POST"])
@handle_exceptions
@token_required(role="principal")
def principal_dashboard():
    return dashboard_func()


@principals_bp.route("/all-grade", methods=["GET"])
@handle_exceptions
@token_required(role="principal")
def get_all_grades():
    return all_grades_func()


@principals_bp.route("/principal-section-progress", methods=["POST"])
@handle_exceptions
@token_required(role="principal")
def get_principal_section_progress():
    return section_progress_func()
