Example #1
0
def total_wallets():
    period = get_period()
    total = WalletService.total_wallets(period)
    return jsonify({'total': total})
Example #2
0
def get_transactions():
    return serialize(TransactionService.get_transactions(get_period()),
                     TransactionSerializer)
Example #3
0
def add_wallet():
    name = request.args.get('name')
    amount = int(request.args.get('amount'))
    period = get_period()
    wallet = WalletService.add_wallet(name, amount, period)
    return serialize(wallet, WalletSerializer)
Example #4
0
def get_wallet_names():
    period = get_period()
    wallet_names = WalletService.get_wallet_names(period)
    return jsonify(wallet_names)
Example #5
0
def get_wallets():
    period = get_period()
    return serialize(WalletService.get_wallets(period), WalletSerializer)
Example #6
0
def total_budgets():
    period = get_period()
    total = BudgetService.total_budgets(period.year, period.month)
    return jsonify({'total': total})
Example #7
0
def add_budget():
    name = request.args.get('name')
    amount = int(request.args.get('amount'))
    period = get_period()
    budget = BudgetService.add_budget(name, amount, period.year, period.month)
    return serialize(budget, BudgetSerializer)
Example #8
0
def get_budget_names():
    period = get_period()
    budget_names = BudgetService.get_budget_names(period.year, period.month)
    return jsonify(budget_names)
Example #9
0
def get_budgets():
    period = get_period()
    return serialize(BudgetService.get_budgets(period.year, period.month),
                     BudgetSerializer)