Support updating for sale propagated on seasons#241
Conversation
…Params class + added client.seasons.update
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new update method for seasons by refactoring the SeasonParams class hierarchy and adding support for updating season properties. The main change is converting SeasonParams into an abstract generic base class with two concrete implementations: CreateSeasonParams and UpdateSeasonParams.
Key changes:
- Refactored
SeasonParamsto be an abstract generic class using the curiously recurring template pattern (CRTP) - Created
CreateSeasonParamsandUpdateSeasonParamssubclasses extendingSeasonParams - Implemented
Seasons.update()method to update season properties - Updated all existing test files to use
CreateSeasonParamsinstead ofSeasonParams
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/seatsio/seasons/SeasonParams.java | Made abstract with generic type parameter to support method chaining in subclasses |
| src/main/java/seatsio/seasons/CreateSeasonParams.java | New concrete implementation for creating seasons |
| src/main/java/seatsio/seasons/UpdateSeasonParams.java | New concrete implementation for updating seasons |
| src/main/java/seatsio/seasons/Seasons.java | Added update method and updated create method default parameter; added unused imports |
| src/test/java/seatsio/seasons/UpdateSeasonTest.java | New test file covering season update functionality |
| src/main/java/seatsio/events/EventParams.java | Updated generic type parameter for consistency |
| src/test/java/seatsio/seasons/CreateSeasonTest.java | Updated to use CreateSeasonParams instead of SeasonParams |
| src/test/java/seatsio/seasons/CreatePartialSeasonTest.java | Updated to use CreateSeasonParams instead of SeasonParams |
| src/test/java/seatsio/seasons/AddEventsToPartialSeasonTest.java | Updated to use CreateSeasonParams instead of SeasonParams |
| src/test/java/seatsio/seasons/RemoveEventFromPartialSeasonTest.java | Updated to use CreateSeasonParams instead of SeasonParams |
| src/test/java/seatsio/reports/events/EventReportsTest.java | Updated to use CreateSeasonParams; has unused SeasonParams import |
| src/test/java/seatsio/events/UseSeasonObjectStatusTest.java | Updated to use CreateSeasonParams; has unused SeasonParams import |
| src/test/java/seatsio/events/UpdateEventTest.java | Updated to use CreateSeasonParams; has unused SeasonParams import |
| src/test/java/seatsio/events/OverrideSeasonObjectStatusTest.java | Updated to use CreateSeasonParams; has unused SeasonParams import |
| src/test/java/seatsio/events/ChangeObjectStatusInBatchTest.java | Updated to use CreateSeasonParams; has unused SeasonParams import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add support for updating the
forSalePropagatedflag on seasons.Note that, to make this possible, I introduced a new
client.seasons.update()method. Previously, seasons would get updated throughclient.event.update(...). ButforSalePropagatedis a very specific flag for the season only, so it makes sense to haveclient.seasons.update()I feel.To keep this clean, I did the same as what we do with creating and updating events: an abstract
SeasonsParamssuperclass, with 2 concrete subclassesCreateSeasonParamsandUpdateSeasonParams. Note that this will require a major release (sinceSeasonParamscan no longer be instantiated).