In https://github.com/Tanzania-AI-Community/twiga/blob/development/scripts/crons/helpers/database.py we are creating a new DB connection, as well as new queries. These queries are agnostic to the cronjob status or the app status, so they can be stored in https://github.com/Tanzania-AI-Community/twiga/blob/development/app/database/db.py with the rest of queries. The dev should also check which queries are very similar in both files so that we group them into one single query, simplifying the code and reducing the technical debt
In https://github.com/Tanzania-AI-Community/twiga/blob/development/scripts/crons/helpers/database.py we are creating a new DB connection, as well as new queries. These queries are agnostic to the cronjob status or the app status, so they can be stored in https://github.com/Tanzania-AI-Community/twiga/blob/development/app/database/db.py with the rest of queries. The dev should also check which queries are very similar in both files so that we group them into one single query, simplifying the code and reducing the technical debt