Exemplo n.º 1
0
    def reserve_resource(self, rid, status, form):
        dao = ResourceDetailsDAO()
        result = dao.updateAvailability(rid, status)

        transactionHandler = TransactionHandler()
        transactionHandler.insertTransaction(form, rid)

        return jsonify(Reserved=result)
Exemplo n.º 2
0
    def purchase_resource(self, rid, status, form):
        dao = ResourceDetailsDAO()

        # Adding compatibility with transaction
        transactionHandler = TransactionHandler()
        transactionHandler.insertTransaction(form, rid)

        result = dao.updateAvailability(rid, status)
        return jsonify(Reserved=result)
Exemplo n.º 3
0
def get_Transaction_by_quantity(quantity):
    if request.method == 'GET':
        return TransactionHandler().getTransactionByQuantity(quantity)
Exemplo n.º 4
0
def get_Transaction_by_date(date):
    if request.method == 'GET':
        return TransactionHandler().getTransactionByDate(date)
Exemplo n.º 5
0
def get_all_purchases():
    if request.method == 'GET':
        return TransactionHandler().getAllPurchases()
Exemplo n.º 6
0
def get_purchase_by_id(tid):
    if request.method == 'GET':
        return TransactionHandler().getPurchaseById(tid)
Exemplo n.º 7
0
def get_Transaction_by_resource(rid):
    if request.method == 'GET':
        return TransactionHandler().getTransactionByResource(rid)
Exemplo n.º 8
0
def get_Transaction_by_payer(payer_id):
    if request.method == 'GET':
        return TransactionHandler().getTransactionByPayer(payer_id)
Exemplo n.º 9
0
def settings(tid):
    if request.method == 'PUT':
        return TransactionHandler().updateTransaction(tid, request.form)
Exemplo n.º 10
0
def delete_transaction(tid):
    if request.method == 'DELETE':
        return TransactionHandler().deleteTransaction(tid)
Exemplo n.º 11
0
def add_transaction():
    if request.method == 'POST':
        return TransactionHandler().insertTransaction(request.form)
Exemplo n.º 12
0
def get_resource_by_transaction(tid):
    if request.method == 'GET':
        return TransactionHandler().getResourceByTransactionId(tid)
Exemplo n.º 13
0
def get_supplier_by_transaction(tid):
    if request.method == 'GET':
        return TransactionHandler().getSupplierByTransactionId(tid)
Exemplo n.º 14
0
def get_payer_payment_by_transaction(tid):
    if request.method == 'GET':
        return TransactionHandler().getPayerPaymentInfoByTransactionId(tid)
Exemplo n.º 15
0
def count_Transaction():
    if request.method == 'GET':
        return TransactionHandler().countTransactions()
Exemplo n.º 16
0
def get_Transaction_by_supplier_payment(supplier_pid):
    if request.method == 'GET':
        return TransactionHandler().getTransactionBySupplierPaymentInfo(
            supplier_pid)
Exemplo n.º 17
0
def transaction_info():
    if request.method == 'POST':
        return TransactionHandler().insertTransaction(request.form)
    else:
        if not request.args:
            return TransactionHandler().getAllTransactions()
Exemplo n.º 18
0
def get_Transaction_by_id(tid):
    if request.method == 'GET':
        return TransactionHandler().getTransactionById(tid)
    elif request.method == 'DELETE':
        return TransactionHandler().deleteTransaction(tid)
Exemplo n.º 19
0
def get_Transaction_by_supplier(supplier_id):
    if request.method == 'GET':
        return TransactionHandler().getTransactionBySupplier(supplier_id)
Exemplo n.º 20
0
def get_all_reservations():
    if request.method == 'GET':
        return TransactionHandler().getAllReservations()
Exemplo n.º 21
0
def get_Transaction_by_amount(amount):
    if request.method == 'GET':
        return TransactionHandler().getTransactionByAmount(amount)
Exemplo n.º 22
0
def get_reservation_by_id(tid):
    if request.method == 'GET':
        return TransactionHandler().getReservationById(tid)