Replies: 2 comments 2 replies
-
|
After discussions with other developers facing similar challenges, I believe the most effective solution is to take a targeted approach for each banking institution. Instead of generalizing, we could implement an intuitive flow in which the user loads his or her data and selects the relevant bank. At that point, a dedicated parser (bank -> parser) specifically designed to interpret that bank's well-defined data format would be activated. Given the relative stability of bank export formats, the use of deterministic parsers would provide us with greater reliability in processing the data. This would greatly simplify both the detection and resolution of any errors. To further enhance this solution and foster collaboration, I would suggest encapsulating this logic in an external, open source library dedicated exclusively to our application and shared with the Mr. Rip community. In this way, we could benefit from the input of other developers and ensure more efficient maintenance over time. |
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone, I asked to start looking into this issue and I have it assigned. I can say my ideas go in both directions exposed until now. So, in my opinion the app should have a standard lower level way of importing data, and a higher level of code (that can be provided by the external library as suggested by @Ic3b3rg ) that will support different formats from different apps/banks. I started doing some experiments to see where this kind of approach can be stretched and I ended up doing it by using a .json file based mapping. The idea is to develop a piece of code that is capable of reading a .json (or even .yml) file and produce an output file that is in the format expected by the lower-level DB import code. So when this piece of code is in place, stable and reliable (in the external library or in the app itself, that will be decided later I think), the future contributor that wants to add support for a particular bank or app to import data FROM, will need just to write a simple .json or .yml file and add it as a source file. The app at that point will be capable of dynamically reading the list of supported banks/apps and show to the user said list. If the file is coherent with the app/bank rules then the import goes fine. Obviously everything needs to be designed as reversible so the export will come for free without much work. I'll attach an example .json file that already works in my fork of the repo (I've not yet pushed anything because everything is very experimental, but the fundametals are there). As you can see there are some fields in the file:
Let me know if any of this makes sense to you, and if you want to see the code in action feel free to reach me on Discord, I should be able to answer almost everyday. I think though that for different Sossoldi entitites we should use different import files, because a giant file that tries to map everything can become hard to maintain in the future. So if you want to import transactions, or accounts, or some other entity you should use different files to do so. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
BRAINSTORMING
Hi all, I'd like to discuss the design and implementation of the importing features with you (related to Issue #332). The idea is to create a modular system which can be improved in the future without re-designing and re-implementing everything. From an initial reasoning and based on the discussion in the Discord channel, this can be a way to implement the importing feature.
At the end of this message, I wrote some pros and cons of some implementation choices. I don't expect I've covered all critical parts, that's why I want to discuss this topic with you! :)
mappingscan be specified manually through the UI with a list ofinput="text"fields that the user fills or by uploading a file (format to decide)inputFile, more data must be put in these fields (more info below).Discussion points
fromXML(file, mappings){ db.store(..) }) and app-specific functions (e.g.fromMoneyManager(file){ fromXML(file, mappingsMM)})bankAccountandstartingValue[?] We can ask the user (within the UI) to create the bankAccunts and the current amount. Then, while processing all the transactions, we can calculate the initial amount before passing data to the next layer (MIDDLE)
bankAccountinstance since the beginning ensures that futureFOREIGN KEYs (transaction.idBankAccount->bankAccount.id) won't be a problem for the db consistency. Moreover we can process bursts of data instead of loading all thetransactionsin the memory and then processing them.[?] We can understand
bankAccountsby ourself and then the user corrects account amounts after the import ends.bankAccounts(even more if this field was not exported from the previous app).Beta Was this translation helpful? Give feedback.
All reactions