Merge branch 'main' into bot

This commit is contained in:
Florian Kellermann 2022-05-13 12:32:58 +02:00 committed by GitHub
commit aadfba74f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
146 changed files with 129 additions and 94 deletions

View File

@ -33,20 +33,23 @@ def get_portfolio():
# Otherwise calculate portfolio
if transactions is not None:
for row in transactions:
data = {
"isin": row[0],
"comment": row[1],
"count": row[2],
# "calculated_price": row[3],
"last_transaction": row[4],
'current_price': 0
}
if row[2] == 0:
continue
else:
data = {
"isin": row[0],
"comment": row[1],
"count": row[2],
# "calculated_price": row[3],
"last_transaction": row[4],
'current_price': 0
}
# Add current share value to portfolio
query_share_price = db.session.query(SharePrice).filter_by(isin=row[0]).order_by(SharePrice.date.desc()).first()
if query_share_price is not None:
data['current_price'] = query_share_price.as_dict()['price']
# Add current share value to portfolio
query_share_price = db.session.query(SharePrice).filter_by(isin=row[0]).order_by(SharePrice.date.desc()).first()
if query_share_price is not None:
data['current_price'] = query_share_price.as_dict()['price']
return_portfolio.append(data)
return_portfolio.append(data)
return make_response(return_portfolio, 200, "Successfully loaded symbols")

View File

@ -67,7 +67,7 @@ def get_transaction():
return_transactions = []
# Get all transactions
transactions = db.session.query(Transaction).filter_by(email=email).all()
transactions = db.session.query(Transaction).filter_by(email=email).order_by(Transaction.time.desc()).all()
# Iterate over transactions and add them to return_transactions
if transactions is not None:

Binary file not shown.

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 382 KiB

After

Width:  |  Height:  |  Size: 382 KiB

View File

Before

Width:  |  Height:  |  Size: 305 KiB

After

Width:  |  Height:  |  Size: 305 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 893 B

After

Width:  |  Height:  |  Size: 893 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Some files were not shown because too many files have changed in this diff Show More