-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API-34441 introduce POA request models #16803
Conversation
Generated by 🚫 Danger |
819a5ba
to
59a8110
Compare
59a8110
to
301c6d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point it has become apparent that there is a good place between the BGS transport layer and the domain logic (service) layer for a persistence (or model) layer. In this PR (combined with a following PR) we have:
The clearest example for the niceness of the model layer so far is that POA request find is implemented under the hood with
readPOARequestByPtcpntId
since there is no way to get a POA request directly by the proc ID (but our representation's ID is a redundant composite key to adapt to BGS).Right now this model layer only consists of immutable values with
Data
from Ruby's standard library and then a few functions (e.g. find and update) which are really more like repository functions. In particular, we aren't using anything really big likeActiveModel
for stuff likeActiveModel::Dirty
dirty tracking or validations. In my opinion these encourage a not great architecture that tends to conflate domain logic and persistence logic which Rails is known for.I plan to take another look at the division between POA request search as it exists in the service and model layer to see if anything can be more direct in that code.