Skip to content

Handle locked campsites in UseDirect/ReserveCalifornia provider#390

Open
aniketde wants to merge 1 commit intojuftin:mainfrom
aniketde:fix/reserve-california-locked-campsites
Open

Handle locked campsites in UseDirect/ReserveCalifornia provider#390
aniketde wants to merge 1 commit intojuftin:mainfrom
aniketde:fix/reserve-california-locked-campsites

Conversation

@aniketde
Copy link

@aniketde aniketde commented Mar 7, 2026

Summary

  • Treat locked campsites as available: When reservations are cancelled on ReserveCalifornia, sites enter a timed lock (typically until 8 AM the next day). Previously these were reported as "Unavailable" because only IsFree was checked. Now, sites with a future Lock timestamp are correctly treated as "Available".
  • Proper typing for Lock field: Changed Lock: Any to Lock: Optional[datetime.datetime] in the UseDirectAvailabilitySlice model.
  • Informational logging: When locked sites are detected, a log message tells users how many locked sites were found and that they will become bookable at their scheduled unlock time.

Fixes #329
Fixes #298

Test plan

  • Verified with live API: Crystal Cove Beach Cottages (campground 757) — previously returned 0 available sites, now correctly returns 15 locked sites as available
  • Verified all edge cases: IsFree=True → Available, Lock=future → Available, Lock=past → Unavailable, Lock=None → Unavailable
  • Verified Pydantic model parses Lock field correctly for null, datetime strings, and datetime objects
  • CLI end-to-end test confirms sites show up with booking links

When reservations are cancelled on ReserveCalifornia, the affected
campsites enter a locked state until a scheduled unlock time (typically
8 AM the next day). Previously, these sites were reported as
"Unavailable" because only the IsFree field was checked. Now, sites
with a future Lock timestamp are correctly treated as "Available".

Fixes juftin#329
Fixes juftin#298

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

ReserveCalifornia cancellations are locked Reserve California website availability not reflecting in Camply searching

1 participant