Skip to content

fix(universal): restore CHILD_SWAP + MINIMUM_HEIGHT attraction tags#192

Merged
cubehouse merged 2 commits into
mainfrom
fix/universal-restore-attraction-tags
May 25, 2026
Merged

fix(universal): restore CHILD_SWAP + MINIMUM_HEIGHT attraction tags#192
cubehouse merged 2 commits into
mainfrom
fix/universal-restore-attraction-tags

Conversation

@cubehouse
Copy link
Copy Markdown
Member

Summary

Follow-up to #191. The /places migration 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[]:

"attributes": [
  {"name": "has_child_swap", "value": "true"},
  {"name": "minimum_rider_height_inches", "value": "40"}
]

placeToEntity now reads both and emits the matching TagBuilder outputs, scoped to ATTRACTION-type entities only (matches the legacy surface — only rides carried these).

Verification (live /places feed)

Attraction Tag(s) emitted
Harry Potter and the Forbidden Journey (IOA) CHILD_SWAP, MINIMUM_HEIGHT 48 in
Despicable Me Minion Mayhem (USF) CHILD_SWAP, MINIMUM_HEIGHT 40 in

Test plan

  • 6 new unit tests in places.test.ts covering: 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

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.
Copilot AI review requested due to automatic review settings May 25, 2026 09:36
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

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 emit CHILD_SWAP / MINIMUM_HEIGHT tags for ATTRACTION entities in placeToEntity.
  • Add unit tests covering tag emission and non-emission cases for the /places attribute 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).
@cubehouse cubehouse merged commit 2fcb19c into main May 25, 2026
4 checks passed
@cubehouse cubehouse deleted the fix/universal-restore-attraction-tags branch May 25, 2026 09:57
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.

2 participants