Commit 927205bb authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[yomoni] Corrected account.number

Customers complained that we inserted the hash of the project as
'account.number' instead of the actual account number (such as 1254 5C
The project hash is necessary to access the account history so I added
an attribute account._project_id in order to perform these history

Closes: 10526@zendesk
parent 46b74fac
......@@ -113,6 +113,7 @@ class YomoniBrowser(APIBrowser):
a = Account() = "".join(me['numeroContrat'].split())
a.number = me['numeroContrat']
a.label = " ".join(me['supportEpargne'].split("_"))
a.type = Account.TYPE_LIFE_INSURANCE if "assurance vie" in a.label.lower() else \
Account.TYPE_MARKET if "compte titre" in a.label.lower() else \
......@@ -121,7 +122,7 @@ class YomoniBrowser(APIBrowser):
a.balance = CleanDecimal().filter(me['solde'])
a.currency = u'EUR' # performanceEuro, montantEuro everywhere in Yomoni JSON
a.iban = me['ibancompteTitre'] or NotAvailable
a.number = project['projectId']
a._project_id = project['projectId']
a.valuation_diff = CleanDecimal().filter(me['performanceEuro'])
a._startbalance = me['montantDepart']
......@@ -168,8 +169,8 @@ class YomoniBrowser(APIBrowser):
def iter_history(self, account):
if not in self.histories:
histories = []'/user/%s/project/%s/activity' % (self.users['userId'], account.number), method="OPTIONS")
for activity in [acc for acc in self.request('/user/%s/project/%s/activity' % (self.users['userId'], account.number), headers=self.request_headers)['activities'] \'/user/%s/project/%s/activity' % (self.users['userId'], account._project_id), method="OPTIONS")
for activity in [acc for acc in self.request('/user/%s/project/%s/activity' % (self.users['userId'], account._project_id), headers=self.request_headers)['activities'] \
if acc['details'] is not None]:
m ='([\d\,]+)(?=[\s]+€|[\s]+euro)', activity['details'])
if "Souscription" not in activity['title'] and not m:
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