示例#1
0
def new() -> Transaction:
    sheet = TransactionSheet()
    transaction = Transaction()

    transaction.title = request.json['title']
    transaction.value = request.json['value']
    transaction.type = request.json['type']
    transaction.category = request.json['category']

    sheet.add(transaction)

    return jsonify(transaction.__dict__), 201
示例#2
0
def newTransaction():
    clear()
    header()
    print('Nova Transação')
    print('')
    print('\033[0;34m')
    print('Tipos: E = Entrada e S = Saída')
    print('\033[0;97m')
    print('')

    transaction = Transaction()
    transaction.title = str(input('Título: '))
    transaction.value = str(input('Valor: ')).replace(",", ".")
    transaction.type = str(input('Tipo: '))
    transaction.category = str(input('Categoria: '))
    sheet.add(transaction)