Warn the user of potential duplicates
Created by: ZeHiro
It appears when there is a difference in the real balance (ie the one on the bank website) and the displayed one by kresus is a real problem for some users, and prevents them to use kresus day to day. This often happens when some duplicates are imported by Kresus.
A simple way to manage this would be to warn the user of potential duplicates, so that s.he can fix this manually.
Here is my solution proposal :
- On fetching new operation, also fetch account balance from weboob
- No need to save it in the DB as new operations/balance is always refetched on startup of kresus (so just a memory save is enough, map with a key which is the account DB id could make it)
- In the /all/ request, include the lastFetchedBalance for each accound
- Add a warning when the client detected a difference between lastFetchedBalance and sum(operations)+initialAmount. This would allow to avoid to detect several times the duplicates in client. An email warn could also be sent, if the detection is also done on the server side.