dbilayer_oracle/reqhandlers/dbinvoice.py

91 lines
2.3 KiB
Python
Raw Normal View History

2023-05-15 18:06:03 +05:30
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
dbinvoice = Blueprint('dbinvoice', __name__)
@dbinvoice.route('/dbinvoice/reqtest')
def retest():
return "success"
# 1.1. Create
@dbinvoice.route('/dbinvoice/create', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbinvoice():
req = request.json
resp = bllengine.dbinvoice_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dbinvoice.route('/dbinvoice/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedbinvoicewithCondition():
req = request.json
resp = bllengine.dbinvoice_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dbinvoice.route('/dbinvoice/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydbinvoicewithCond():
req = request.json
resp = bllengine.dbinvoice_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dbinvoice.route('/dbinvoice/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydbinvoicewithoutCond():
req = request.json
resp = bllengine.dbinvoice_processreadmanywithoutcond(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dbinvoice.route('/dbinvoice/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedbinvoicewithcondition():
req = request.json
resp = bllengine.dbinvoice_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dbinvoice.route('/dbinvoice/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedbinvoicewithcondition():
req = request.json
resp = bllengine.dbinvoice_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dbinvoice.route('/dbinvoice/updateall', methods=["POST"])
@cross_origin()
##@jwt_required()
#@cache.cached(timeout=50)
def createdbinvoice():
req = request.json
resp = bllengine.dbinvoice_processupdateall(req)
return jsonify(resp)
"""