feat: add sliding window trip generation for By Games mode

Adds a trip duration stepper (2-21 days) to the By Games planning mode.
When users select specific games, the planner now generates ALL possible
N-day windows containing those games (e.g., 7-day trips starting on
different days), finding additional games in each window to maximize
route options.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-11 19:19:46 -06:00
parent 3f80a16201
commit dcd5edb229
4 changed files with 64 additions and 8 deletions

View File

@@ -137,6 +137,9 @@ final class TripCreationViewModel {
var followTeamId: UUID?
var useHomeLocation: Bool = true
// Game First Mode - Trip duration for sliding windows
var gameFirstTripDuration: Int = 7
// MARK: - Dependencies
private let planningEngine = TripPlanningEngine()
@@ -407,7 +410,8 @@ final class TripCreationViewModel {
allowRepeatCities: allowRepeatCities,
selectedRegions: selectedRegions,
followTeamId: followTeamId,
useHomeLocation: useHomeLocation
useHomeLocation: useHomeLocation,
gameFirstTripDuration: gameFirstTripDuration
)
// Build planning request
@@ -589,7 +593,10 @@ final class TripCreationViewModel {
numberOfDrivers: numberOfDrivers,
maxDrivingHoursPerDriver: maxDrivingHoursPerDriver,
allowRepeatCities: allowRepeatCities,
selectedRegions: selectedRegions
selectedRegions: selectedRegions,
followTeamId: followTeamId,
useHomeLocation: useHomeLocation,
gameFirstTripDuration: gameFirstTripDuration
)
return convertToTrip(option: option, preferences: preferences)
}