5 add endpoint to return suitable dates for all participants#13
Merged
TyostoKarry merged 3 commits intoOct 22, 2025
Merged
Conversation
- Implemented GET /api/v1/event/{id}/results to return dates suitable for all participants.
- Added EventResultResponse DTO with companion logic to compute suitable dates.
Chose to invoke getEventById() directly in the controller instead of adding a separate service method, as the result computation is a simple derived transformation rather than service-layer logic. When no votes exist or no suitable dates are found, an empty list is returned instead of raising an error.
- Skip creating a vote entry when no voted dates are provided - Prevents hidden database entries that blocked the results endpoint from showing valid dates
- Add unit tests covering /api/v1/event/{id}/results endpoint
- Include cases for aggregated results, no votes, no suitable dates, and event not found
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.
GET /api/v1/event/{id}/resultsendpoint inEventControllerEventResultResponseshowing dates all participants can attendEventResultResponseDTOfromEvent()companion logic to compute suitable dates by intersecting participants votesEventService.addVote()to skip adding empty votes and prevent hidden entries that affected result accuracygetEventResultsNOTE: The result computation is implemented in the DTO’s companion object rather than the service layer, as it’s a simple derived transformation of existing event data, not a business operation requiring service logic.