Skip to content

(Task 1) Feature: filter Races by Visible - #1

Open
Cuttsy27 wants to merge 1 commit into
mainfrom
feature/filter-races-by-visibility
Open

Cuttsy27 wants to merge 1 commit into
mainfrom
feature/filter-races-by-visibility

Conversation

@Cuttsy27

@Cuttsy27 Cuttsy27 commented Aug 1, 2025

Copy link
Copy Markdown
Owner

Changes

  • added optional bool visible to proto filter message
  • updated applyFilter to add clause to sql string if visible is not null
  • added tests for the applyFilter method
  • added tests for the racing service

Summary

To filter by a Race's Visible property, we add the optional bool visible property to the ListRacesRequestFilter protobuf message. The property is optional because both true and false are valid values for the visible property and we can use nil to determine if the filter is set, then filter by visible = true or visible = false races.

Example

curl -X "POST" "http://localhost:8000/v1/list-races"
-H 'Content-Type: application/json'
-d $'{
"filter": { "visible": true }
}'

Tests

  • We test the updated applyFilter method on the races repo for 100% coverage.
  • We test the racing service by mocking the races repo to ensure it correctly handles race filtering.

…o filter message. updated applyFilter to add clause to sql string if visible is not null
@Cuttsy27 Cuttsy27 changed the title Filter Races by Visible Feature: Filter Races by Visible Aug 4, 2025
@Cuttsy27 Cuttsy27 changed the title Feature: Filter Races by Visible Feature: filter Races by Visible Aug 4, 2025
@Cuttsy27 Cuttsy27 changed the title Feature: filter Races by Visible (Task 1) Feature: filter Races by Visible Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant