Closed RichDom2185 closed 4 months ago
After spending some time thinking about it, I figured this might be a good way to separate out the logic:
This design would also mean it would make it easier to make operations that involve multiple models atomic, simply by calling the individual structs' methods. An example of this atomicity issue was introduced in #102, where the usergroups
data are dependent on the users themselves having been created prior to the operation. We can simply expose an create/update function from the UserGroups model that calls the methods from the individual structs (since they belong to the same package).
Part of #14.
Part of #54.
Part of #81.
This design would remove coupling from the actual DB layer (as well as between models and its associations), as none of the SQL statements would actually be executed (but still allows to check for correctness of behaviour, especially when checking against potentially nullable/non-nullable values).