From 17ddb8a57b6fb08404b69ebbba9b353660da77f7 Mon Sep 17 00:00:00 2001 From: Florent Fourcot Date: Mon, 8 Jul 2013 21:23:06 +0200 Subject: [PATCH] Add Investment objects and iter_investment in ICapBank --- weboob/capabilities/bank.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/weboob/capabilities/bank.py b/weboob/capabilities/bank.py index d9cc3772..8110eaf8 100644 --- a/weboob/capabilities/bank.py +++ b/weboob/capabilities/bank.py @@ -148,6 +148,19 @@ class Transaction(CapBaseObject): label, self.amount) +class Investment(CapBaseObject): + """ + Investment in a financial market. + """ + + label = StringField('Label of stocks') + quantity = IntField('Quantity of stocks') + unitprice = DecimalField('Buy price of one stock') + unitvalue = DecimalField('Current value of one stock') + valuation = DecimalField('Total current valuation of the Investment') + diff = DecimalField('Difference between the buy cost and the current valuation') + + class Transfer(CapBaseObject): """ Transfer from an account to a recipient. @@ -250,3 +263,14 @@ class ICapBank(ICapCollection): :raises: :class:`AccountNotFound`, :class:`TransferError` """ raise NotImplementedError() + + def iter_investment(self, account): + """ + Iter investment of a market account + + :param account: account to get investments + :type account: :class:`Account` + :rtype: iter[:class:`Investment`] + :raises: :class:`AccountNotFound` + """ + raise NotImplementedError()