fix(seaworld): type evening event hours as TICKETED_EVENT, not OPERATING#264
Merged
Conversation
On event days the SeaWorld hours API returns a second open_hours block for the same date: the park's daytime session plus a separate evening event (e.g. Aquatica Orlando summer nights, 09:00-19:30 normal then 20:00-23:00). Both arrive type-less, so emitting them all as OPERATING made the event masquerade as, and downstream overwrite, the normal operating hours. Group open_hours by date, keep the earliest session as OPERATING, and mark any later same-date block as TICKETED_EVENT. Applies to the whole SeaWorld / Busch Gardens family (their evening events are separately ticketed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review found the earlier "earliest block = OPERATING" rule inverts if an event opens before normal hours (pre-opening early-entry) or at midnight — the event would be labelled OPERATING and the real hours TICKETED_EVENT. There is no event flag on the hours entries, and the /events endpoint is a noisy mixed list (festivals, shows, private events; 500s for some parks) that doesn't reliably map to an hours block. Classify by time of day instead: the block overlapping core midday (12:00-16:00 local) is the OPERATING session; every other same-date block is a TICKETED_EVENT. Falls back to the longest block if none overlaps (evening-only day). Robust to evening, pre-opening, midnight, and overnight events, and to a short day paired with a longer event. Verified across the family: no date resolves to more than one OPERATING block, and no peripheral (non-OPERATING) block opens in the morning — i.e. hotel early-entry / extra-hours blocks can't leak into normal operating hours. All real event blocks (Howl-O-Scream, AquaGlow) are evening ticketed events. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…glitch) On some event days the API dates a daytime block's closes_at one day late (e.g. SeaWorld Orlando Howl-O-Scream: opens 09/18 09:00, closes_at dated 09/19 → a bogus 34-35h "operating" span). No real session or event runs >25h, so roll the close back one day when the span exceeds that. Legit past-midnight event closes (20:00->01:00, ~5h) are well under the threshold and untouched. 16 SeaWorld Orlando blocks corrected; live check shows 0 remaining >25h spans. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Aquatica Orlando (and any SeaWorld/Busch Gardens park with evening events) was showing its event hours as normal operating hours.
Cause
On event days the hours API returns a second
open_hoursblock for the same date — the daytime session plus a separate evening event after a gap:buildSchedulesmapped every block totype: OPERATING, so the event collided with / overwrote the day's real hours. The API entries carry no type field (onlyopens_at/closes_at/date), so the distinction is structural.Fix
Group
open_hoursby date; the earliest session isOPERATING, any later same-date block isTICKETED_EVENT. Verified against live data:Applies to the whole SeaWorld/Busch Gardens family — their evening events (Howl-O-Scream, summer nights, etc.) are separately ticketed, so
TICKETED_EVENTis correct.Tests
3 new
buildSchedulestests (event→TICKETED_EVENT + single OPERATING; single-block day stays OPERATING; earliest-block-wins regardless of API ordering). Full suite: 1498 pass.🤖 Generated with Claude Code