Sort and refactor gateway functions
Description
There are several functions in gateway classes that are redundant and/or that would fit better into other gateways and could be moved. It might be a good idea to sort/move/join them after #9 (closed) is done to make the gateways more clear.
Should be discussed first: is it preferable to have less gateway functions for clearer code or to have more specific functions for less load on the database?
For example: FoodsaverGateway.getOne_foodsaver
requests many fields but is sometimes used if only a few fields are needed.
Goal
Clearer code, maybe less load on the database
Proposal
- Find redundant functions and combine them, e.g. with default values for function parameters
- Pull logic out of the gateways into the transaction classes, so that gateway functions only represent one or a few SQL requests per function
- Gateways should not depend on other gateways to avoid circular references. The transaction classes can call whatever they need from different gateways.
- We should try to avoid between transaction classes, too. Some of their functions could be moved to static utility functions.