from flask import Blueprint
from src.utils.decorators import handle_exceptions, token_required
from src.controller.schools import login_func, principal_func, upload_func

schools_bp = Blueprint('schools', __name__)


@schools_bp.route("/school-login", methods=['POST'])
@handle_exceptions
def login():
    return login_func()


@schools_bp.route("/upload_file", methods=['POST'])
@handle_exceptions
@token_required(role="school")
def upload():
    return upload_func()

@schools_bp.route("/add-principal", methods=['POST'])
@handle_exceptions
@token_required(role="school")
def add_principal():
    return principal_func()