Logic flow consistency - #2135
Open
bfoley12 wants to merge 28 commits into
Open
Conversation
…onService instead of repo and service
The previous commit referenced this too. I think that one was for project-groups
…cope) to a Policy pattern each repo still declares scope, but the creation of the scope is handled through a single Policy pattern in scope.py
…c into the service Repositories should be thin interfaces into the MongoDB collection, not deciding ownership, managing server-owned fields, etc.
…ative from all projects referencing it prevents dangling references after removing an Initiative
repos only need user info to set a scope, not persistently
…cumentIn for write/update operations
…nt with the MongoDb<Resource>Repository form
…s into a single 'count_matching' method uses pymongo directly to allow flexible queries. Can be scoped to a user or global
…ons' as useless forward service now relies on the MongoDbRepository.download directly
db tests were still relying on old function declarations.
…ports successes/failures as BulkWriteSummary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Previously, some routers talked to the service AND the repo, and the repo knew a lot about the broader domain and business logic. This branch strengthened the relationships and clarified the boundaries. Routers now exclusively call service methods, which know about domain models and how they relate, as well as the shape of the domain repo. The repo exposes thin (when possible) methods for interacting with the underlying DB.
Major changes: