nit: move response types out of the models package #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While scanning through the code I saw that API response types where defined in
models, which should hold the DB structures. I think defining the API types in there is bad practice, we want to have separation between the internal data structures and what's exposed in the API.This PR does some refactoring and moves all structures defined in models that belong to the API interface in the api package.
I have a feeling (but didn't check) the types in model are also being directly JSON serialized (I get this feeling from the inlining of the
gorm.Modelstruct). This should also be avoided for the same reason as before.I think that kind of refactoring can probably be done by claude code/gemini without human intervention, but I didn't bother for this PR.
As a side note: What is the purpose of
AnswerVersions? why is the name plural? I assume theAnswerfield is a reference to the Answer ID column. Shouldn't it be marked as such in SQL through gorm annotations?This is just me raising what are clearly nits. If code quality is not a priority right now, just ignore them and feel free to close this PR :)