fix(universal): restore CHILD_SWAP + MINIMUM_HEIGHT attraction tags#192
Merged
Conversation
The /places migration in #191 silently dropped the attraction tags the legacy POI build emitted (HasChildSwap → CHILD_SWAP, MinHeightInInches → MINIMUM_HEIGHT). Reporter noticed Harry Potter and the Forbidden Journey losing its 48" minimum height in Orlando. The new feed exposes the same data under place_type.attributes[]: - has_child_swap (string "true"/"false") - minimum_rider_height_inches (string) Read both in placeToEntity for ATTRACTION-type emissions only (matches the legacy surface — only rides had these), emit via TagBuilder. Verified live against the real /places feed: - Harry Potter and the Forbidden Journey: 48 in + CHILD_SWAP ✓ - Despicable Me Minion Mayhem: 40 in + CHILD_SWAP ✓ Added 6 unit tests covering present/absent/zero/non-numeric height values, has_child_swap true/false, and that non-ATTRACTION types (Show / Dining) don't pick up these tags even if the upstream feed ever includes them on a non-ride.
Contributor
There was a problem hiding this comment.
Pull request overview
Restores legacy Universal attraction tag emission (CHILD_SWAP and MINIMUM_HEIGHT) that was lost during the /places feed migration by reading equivalent values from place_type.attributes[] and mapping them onto ATTRACTION entities via TagBuilder.
Changes:
- Add an
attr()helper and emitCHILD_SWAP/MINIMUM_HEIGHTtags for ATTRACTION entities inplaceToEntity. - Add unit tests covering tag emission and non-emission cases for the
/placesattribute mapping.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/parks/universal/universal.ts | Reads /places attributes and emits legacy attraction tags for child swap + minimum height. |
| src/parks/universal/tests/places.test.ts | Adds unit tests validating the restored tag mapping behavior. |
| }, | ||
| }; | ||
| const tags = placeToEntity(both, DESTINATION, TZ)?.tags ?? []; | ||
| expect(tags.length).toBe(2); |
Comment on lines
+168
to
+174
| test('Non-Ride entities (Show / Dining) do NOT receive height/child-swap tags', () => { | ||
| const showWithAttrs: UniversalPlace = { | ||
| ...showPlace, | ||
| place_type: {type: 'Show', attributes: [{name: 'minimum_rider_height_inches', value: '36'}]}, | ||
| }; | ||
| expect(placeToEntity(showWithAttrs, DESTINATION, TZ)?.tags ?? []).toEqual([]); | ||
| }); |
- 'both tags' test now asserts the exact tags (CHILD_SWAP + MINIMUM_HEIGHT with height/unit), and explicitly verifies the unrelated express_pass / mfdo_enabled attributes do not produce extra tags. - 'Non-Ride entities' test now covers BOTH Show and Dining (matches the test name's claim — it previously only covered Show).
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.
Summary
Follow-up to #191. The
/placesmigration silently dropped the attraction tags the legacy POI build emitted (HasChildSwap → CHILD_SWAP,MinHeightInInches → MINIMUM_HEIGHT). Reporter noticed Harry Potter and the Forbidden Journey losing its 48" minimum height in Orlando during the migration tool run.The new feed exposes the same data under
place_type.attributes[]:placeToEntitynow reads both and emits the matchingTagBuilderoutputs, scoped to ATTRACTION-type entities only (matches the legacy surface — only rides carried these).Verification (live
/placesfeed)CHILD_SWAP,MINIMUM_HEIGHT48 inCHILD_SWAP,MINIMUM_HEIGHT40 inTest plan
places.test.tscovering: height-tag emitted, child-swap-tag emitted, both-together, non-Ride types do NOT pick up the tags,has_child_swap="false"doesn't emit,minimum_rider_height_inches="0"and non-numeric values don't emit.npm test -- src/parks/universal→ 30 / 30 pass.npm run dev -- universalorlando→ 4/4.npm run dev -- universalstudios→ 4/4.Scope guard
Intentionally NOT adding tags for other attributes the new feed exposes (
express_pass,mfdo_enabled,is_kid_friendly, etc.). This PR restores the legacy surface only — broader tag coverage is a separate scope.🤖 Generated with Claude Code