def getALLConsumers(): if request.method == 'POST': return ConsumerHandler().insertConsumer(request.form) else: if not request.args: return ConsumerHandler().getAllConsumers() else: return ConsumerHandler().searchConsumers(request.args)
def getCConsumerById(consid): if request.method == 'GET': return ConsumerHandler().getConsumerById(consid) elif request.method == 'PUT': return ConsumerHandler().updateConsumer(consid, request.json) elif request.method == 'DELETE': return ConsumerHandler().deleteConsumer(consid) else: return jsonify(Error="Method not allowed."), 405
def getAllConsumer(): if request.method == 'POST': print("REQUEST: ", request.json) return ConsumerHandler().insertConsumerJson(request.json) else: if not request.json: return ConsumerHandler().getAllConsumer() else: return ConsumerHandler().searchConsumer(request.json)
def getConsumerById(cid): if request.method == 'GET': return ConsumerHandler().getConsumerById(cid) elif request.method == 'PUT': pass elif request.method == 'DELETE': pass else: return jsonify(Error = "Method not allowed"), 405
def getAllconsumer(): if request.method == 'POST': print("REQUEST: ", request.json) return UserHandler().insertConsumerJson(request.json) if request.method == 'GET': return ConsumerHandler().getAllConsumer()
def getAllConsumer(): if request.method == 'GET': return ConsumerHandler().getAllConsumers()
def getConsumerById(consumer_id): # orders specify if we are requesting, reserving or purchasing depending on its status if request.method == 'GET': return ConsumerHandler().getConsumerById(consumer_id)
def registerConsumer(): # orders specify if we are requesting, reserving or purchasing depending on its status if request.method == 'GET': return ConsumerHandler().getAllConsumers() elif request.method == 'POST': return ConsumerHandler().insert(request.get_json())
def getOrdersByConsumerId(consid): return ConsumerHandler().getOrdersByConsumerId(consid)
def getResourcesByConsumerId(consid): return ConsumerHandler().getResourcesByConsumerId(consid)
def getReservationByConsumerId(consid): return ConsumerHandler().getReservationByConsumerId(consid)
def getPayMethodByConsumerId(consid): return ConsumerHandler().getPayMethodByConsumerId(consid)
def getLatestConsumer(): return ConsumerHandler().getLatestConsumer()