GSoC 2020 with KDE
With some last minute work, the second phase of my project for Google Summer of Code is done. The evaluation results have arrived and I have passed successfully. I am thankful to my mentors for providing help and guidance throughout this project.
Here is the progress report for the work done in this phase.
As discussed in the previous posts, the library now uses SQLite databases for bank data handling. The proposed expectations from this phase were:
- Add database generating scripts for additional countries (Netherlands and Switzerland)
- Enable automatic database generation on build time
- Modifications in the library to enable it to accept databases of these additional countries
- Add support for checking of bankIds and accountIds of these countries
- Modifications in the command-line tool to take country as an option and call a suitable constructor.
- Add tests and documentation.
The work began with adding the python scripts for generating the databases for Netherlands and Switzerland. The input file for these scripts are downloaded from the respective banks’ websites and then the scripts are called during build.
After that, the databases were needed to be accepted by the library. So I created a new member in the class, country, and added methods to set its value by extracting the contents of the first field of the database. Then I added some queries based on the schema of these new databases.
Added code in
AccountNumberCheck::readDatabase() to read the databases depending on its country. Then added the checking code in
AccountNumberCheck::check() based on the specifications provided in the IBAN format registry.
With that done, it was needed to modify the command-line tool in accordance to these changes and enable it to receive the country code for which the tool has to be run. Here, I encountered a problem.
The ideal case would have been to create a constructor
AccountNumberCheck::AccountNumberCheck(const std::string& country) and use it. But the class already has a constructor
AccountNumberCheck::AccountNumberCheck(const std::string& filename) and thus it was not possible to create another constructor with the same signature.
So, I created a static method
AccountNumberCheck* createChecker(const std::string& country) which
creates the required object and returns a pointer to it. I used this in the command-line tool
to create checkers.
Finally, I added some simple tests in the CMake build system to run checks for each country and would add some more unit tests in the coming days.
With that done, the work of this phase was completed successfully. I am waiting for the review from my mentors to make any necessary changes if required.
See you in the next post.