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)
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #5
0
def getAllconsumer():
    if request.method == 'POST':
        print("REQUEST: ", request.json)
        return UserHandler().insertConsumerJson(request.json)
    if request.method == 'GET':
        return ConsumerHandler().getAllConsumer()
Beispiel #6
0
def getAllConsumer():

    if request.method == 'GET':
        return ConsumerHandler().getAllConsumers()
Beispiel #7
0
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)
Beispiel #8
0
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())
Beispiel #9
0
def getOrdersByConsumerId(consid):
    return ConsumerHandler().getOrdersByConsumerId(consid)
Beispiel #10
0
def getResourcesByConsumerId(consid):
    return ConsumerHandler().getResourcesByConsumerId(consid)
Beispiel #11
0
def getReservationByConsumerId(consid):
    return ConsumerHandler().getReservationByConsumerId(consid)
Beispiel #12
0
def getPayMethodByConsumerId(consid):
    return ConsumerHandler().getPayMethodByConsumerId(consid)
def getLatestConsumer():
    return ConsumerHandler().getLatestConsumer()