refactor: enforce clean layer separation across repository, service, and controller #216
Merged
Conversation
georgweiss
reviewed
May 7, 2026
georgweiss
reviewed
May 7, 2026
Collaborator
georgweiss
left a comment
There was a problem hiding this comment.
Added in-line comment
87d7588 to
a6dbe48
Compare
575892c to
6c44109
Compare
|
jacomago
reviewed
May 8, 2026
6c44109 to
85b3acb
Compare
|
simon-ess
reviewed
May 21, 2026
Contributor
|
Also, now that you have reverted one commit... maybe just remove both commits from the PR? |
576f05e to
f5e9f6f
Compare
|
simon-ess
reviewed
May 21, 2026
Contributor
simon-ess
left a comment
There was a problem hiding this comment.
There are still several bare Exceptions being caught and rethrown. There may be more, I stopped looking after 3.
f5e9f6f to
edebe70
Compare
|
Repositories must not know about HTTP. Replace all ResponseStatusException throws in ChannelRepository, TagRepository, and PropertyRepository with StorageException (for ES IO failures) or the existing typed domain exceptions (ChannelValidationException for bad query windows). Add a StorageException handler to V0ExceptionHandler mapping it to 500. The NOT_FOUND status used in findById catch blocks was also wrong: those are IO/connection failures, not 404s - replaced with StorageException.
…itory boundaries Services should preferably not depend on Spring types. Replace MultiValueMap<String, String> with Map<String, List<String>> in all service method signatures and repository public APIs. Controllers pass their MultiValueMap directly — no conversion needed since MultiValueMap IS a Map<String, List<String>>. Also replaces internal LinkedMultiValueMap usages in TagRepository and PropertyRepository scroll loops, MetricsService metric-combination generation, ChannelProcessorService.processAllChannels, and ChannelFinderEpicsService with standard java.util equivalents.
@repository and @configuration must not be combined on the same class. The @configuration annotation was causing repositories to participate in Spring's configuration processing, which is incorrect. Remove it from all three repositories and drop the now-unused import.
Add ChannelDto, TagDto, PropertyDto, SearchResultDto, ScrollDto under web/v0/dto/ and corresponding static mappers under web/v0/mapper/. All five controllers now map to/from DTOs; the service and domain layers are unchanged. This isolates the v0 API shape from the domain model so a future v1 API can evolve its own DTOs without touching service or repository code.
…nd repository boundaries" This reverts commit 2def995.
Contributor
|
I'd approve it but I do not seem to have permission to do so. |
edebe70 to
66d767a
Compare
|
|
jacomago
approved these changes
May 22, 2026
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.



Pushes the codebase toward cleaner layering: repositories are pure persistence adapters, services have no web framework dependencies, and the HTTP boundary is explicit.
Also adds a v0 DTO layer ahead of a planned v1 API, so the two can evolve independently without touching the service or domain layers.