From c6c9dd64a8c9f1252f1fc2b0b3b74e6036fa4c7f Mon Sep 17 00:00:00 2001 From: Maxime Pommier Date: Thu, 4 Apr 2019 17:00:48 +0200 Subject: [PATCH] [capabilities.bank] Add the relationship between the credentials owner (PSU) and the account For now, there are three values: - owner: The PSU own the account - co-owner: There are at least 2 owners on this account - attorney: It's not the PSU property, but it can manage it (ex: It's children accounts) --- weboob/capabilities/bank.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/weboob/capabilities/bank.py b/weboob/capabilities/bank.py index 44f075c982..b1b8302863 100644 --- a/weboob/capabilities/bank.py +++ b/weboob/capabilities/bank.py @@ -36,7 +36,7 @@ __all__ = [ 'CapBank', 'BaseAccount', 'Account', 'Loan', 'Transaction', 'AccountNotFound', - 'AccountType', + 'AccountType', 'AccountOwnership', 'CapBankWealth', 'Investment', 'CapBankPockets', 'Pocket', 'CapBankTransfer', 'Transfer', 'Recipient', 'TransferError', 'TransferBankError', 'TransferInvalidAmount', 'TransferInsufficientFunds', @@ -263,6 +263,18 @@ class AccountOwnerType(object): """association account""" +class AccountOwnership(object): + """ + Relationship between the credentials owner (PSU) and the account + """ + OWNER = u'owner' + """The PSU is the account owner""" + CO_OWNER = u'co-owner' + """The PSU is the account co-owner""" + ATTORNEY = u'attorney' + """The PSU is the account attorney""" + + class Account(BaseAccount): """ Bank account. @@ -293,6 +305,7 @@ class Account(BaseAccount): balance = DecimalField('Balance on this bank account') coming = DecimalField('Sum of coming movements') iban = StringField('International Bank Account Number', mandatory=False) + ownership = StringField('Relationship between the credentials owner (PSU) and the account') # cf AccountOwnership class # card attributes paydate = DateField('For credit cards. When next payment is due.') -- GitLab