Skip to content

Support updating for sale propagated on seasons#241

Merged
bverbeken merged 4 commits intomasterfrom
support-updating-forSalePropagated-on-seasons
Nov 5, 2025
Merged

Support updating for sale propagated on seasons#241
bverbeken merged 4 commits intomasterfrom
support-updating-forSalePropagated-on-seasons

Conversation

@bverbeken
Copy link
Copy Markdown
Member

Add support for updating the forSalePropagated flag on seasons.

Note that, to make this possible, I introduced a new client.seasons.update() method. Previously, seasons would get updated through client.event.update(...). But forSalePropagated is a very specific flag for the season only, so it makes sense to have client.seasons.update() I feel.

To keep this clean, I did the same as what we do with creating and updating events: an abstract SeasonsParams superclass, with 2 concrete subclasses CreateSeasonParams and UpdateSeasonParams. Note that this will require a major release (since SeasonParams can no longer be instantiated).

@bverbeken bverbeken requested review from Copilot, mroloux and schaloner and removed request for Copilot and mroloux November 5, 2025 15:13
Copy link
Copy Markdown
Member

@mroloux mroloux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SeasonParams to be an abstract generic class using the curiously recurring template pattern (CRTP)
  • Created CreateSeasonParams and UpdateSeasonParams subclasses extending SeasonParams
  • Implemented Seasons.update() method to update season properties
  • Updated all existing test files to use CreateSeasonParams instead of SeasonParams

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.

Comment thread src/main/java/seatsio/seasons/Seasons.java Outdated
Comment thread src/main/java/seatsio/seasons/Seasons.java Outdated
Comment thread src/test/java/seatsio/reports/events/EventReportsTest.java Outdated
Comment thread src/test/java/seatsio/events/UseSeasonObjectStatusTest.java Outdated
Comment thread src/test/java/seatsio/events/UpdateEventTest.java Outdated
Comment thread src/test/java/seatsio/events/OverrideSeasonObjectStatusTest.java Outdated
Comment thread src/test/java/seatsio/events/ChangeObjectStatusInBatchTest.java Outdated
Comment thread src/main/java/seatsio/seasons/SeasonParams.java
@bverbeken bverbeken requested a review from Copilot November 5, 2025 15:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bverbeken bverbeken merged commit c481b32 into master Nov 5, 2025
8 checks passed
@bverbeken bverbeken deleted the support-updating-forSalePropagated-on-seasons branch November 5, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants