Commit a060c8c3 authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Vincent A

[nalo] fill Investment.asset_category

parent e1f70792
......@@ -74,4 +74,5 @@ class NaloBrowser(LoginBrowser):
inv.label = item['name']
inv.portfolio_share = item['share']
inv.valuation = account.balance * inv.portfolio_share
inv.asset_category = item['asset_type']
yield inv
......@@ -70,6 +70,14 @@ class HistoryPage(LoggedPage, JsonPage):
pass
# using site labels
ASSET_TYPE = {
'risky': 'Actions',
'risk_free': 'Obligations',
'guaranteed': 'Fonds à capital garanti',
}
class InvestPage(LoggedPage, JsonPage):
ENCODING = 'utf-8'
......@@ -91,4 +99,5 @@ class InvestPage(LoggedPage, JsonPage):
'isin': line['isin'],
'name': line['name'],
'share': float_to_decimal(line['weight']) / 100,
'asset_type': ASSET_TYPE[line['risk_type']],
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment