from flask import Blueprint, request, jsonify
#from werkzeug.security import generate_password_hash, check_password_hash
from utils.email import send_email, send_gmail
from flask_jwt_extended import create_access_token, jwt_required, get_jwt_identity

from models.audit import Audit, AuditModel

import os

auth_bp = Blueprint("settings", __name__)
audit = Audit()

@auth_bp.route("/documente_juridice/add", methods=["POST"])
@jwt_required()
def documente_juridice_add():
    data = request.get_json()
    user_id = get_jwt_identity()
    if 'category' not in data:
        entry = AuditModel(user_id=user_id, action=f"Attempt to create a new category", status='400 - Missing category')
        audit.new_entry(entry)
    