from flask import Blueprint, request, jsonify from core.bll import bllengine from flask_cors import cross_origin from flask_jwt_extended import create_access_token, get_jwt, jwt_required from reqhandlers.blocklist import BLOCKLIST import datetime from datetime import timedelta dbbilling = Blueprint('dbbilling', __name__) @dbbilling.route('/dbbilling/reqtest') def retest(): return "success" # 1.1. Create @dbbilling.route('/dbbilling/create', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbbilling(): req = request.json resp = bllengine.dbbilling_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbbilling.route('/dbbilling/readonecond', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def readOnedbbillingwithCondition(): req = request.json resp = bllengine.dbbilling_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbbilling.route('/dbbilling/readmanycond', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def reaManydbbillingwithCond(): req = request.json resp = bllengine.dbbilling_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbbilling.route('/dbbilling/readall', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def readManydbbillingwithoutCond(): req = request.json resp = bllengine.dbbilling_processreadall(req) return jsonify(resp) # 1.5. Delete One Conditional @dbbilling.route('/dbbilling/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbbillingwithcondition(): req = request.json resp = bllengine.dbbilling_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbbilling.route('/dbbilling/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbbillingwithcondition(): req = request.json resp = bllengine.dbbilling_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbbilling.route('/dbbilling/updateall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbbilling(): req = request.json resp = bllengine.dbbilling_processupdateall(req) return jsonify(resp) """