Skip to content

fix(web): showtime chips buy the exact showing — per-showtime ticketUrl from payload - #76

Merged
BIBOYANG425 merged 1 commit into
mainfrom
fix/showtimes-chip-purchase-links
Jul 13, 2026
Merged

fix(web): showtime chips buy the exact showing — per-showtime ticketUrl from payload#76
BIBOYANG425 merged 1 commit into
mainfrom
fix/showtimes-chip-purchase-links

Conversation

@BIBOYANG425

@BIBOYANG425 BIBOYANG425 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Why

Pressing a time pill on the showtimes card opened a Fandango title search — not a purchase. The AMC per-showing checkout URLs (live since this morning's spool-agent deploy) never reached the card payload, and the web chips had a hardcoded search placeholder from before AMC went live.

What

  • ShowtimeV1 and CinemaV1 gain optional ticketUrl (additive v:1, old payloads parse and render unchanged).
  • Chip href priority: per-showtime ticketUrl (AMC exact-showing checkout) → cinema ticketUrl → legacy title search (old payloads only).
  • Contract doc updated; the Fandango linkout is documented as a legacy fallback (the affiliate program is defunct).
  • Agent side (spool-agent, shipping separately) threads AMC purchaseUrl per showtime through marshal → source → card composer, with composer tests.

Tests

Chip prefers the per-showtime link, falls back to the cinema link, keeps the legacy search for old payloads, and format-grouped showings carry per-chip links. Full suite 731 green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Showtimes can now link directly to tickets for a specific showtime.
    • Ticket links prioritize showtime-specific URLs, then cinema-level URLs.
    • Older showtime data continues to use the existing fallback search link.
  • Documentation

    • Updated the shared showtime payload contract to document optional ticket URLs.

…rl from payload

Pressing a time pill on the /agent-showtimes card could not purchase
anything: every chip's href was ticketLinkout(film.title), a Fandango title
SEARCH (and the Fandango affiliate program is defunct — the page removed,
FlexOffers/Admitad list it inactive). The real AMC purchase URLs never
reached the card.

The payload (additive v:1) now carries ticket links and the chip href
resolves in priority order:
  1. the showtime's own ticketUrl — AMC per-showing checkout deep link
  2. the cinema's ticketUrl — source-level fallback
  3. ticketLinkout(title) — legacy title search, old payloads only

ShowtimeV1 and CinemaV1 gain optional ticketUrl; buildFilmSections threads
the cinema fallback; contract doc updated (shared-payloads.md). Agent side
ships the matching payload fields (spool-agent: per-showtime purchaseUrl
threaded marshal → source → card composer).

Tests: chip prefers per-showtime link, falls back to cinema link, legacy
payloads keep the search fallback, and format-grouped showings carry
per-chip links. 731 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
movie-list Ready Ready Preview, Comment Jul 13, 2026 8:53pm
movie-list-mvp Ready Ready Preview, Comment Jul 13, 2026 8:53pm

@supabase

supabase Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project emulyralduiitxuigboj because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The showtimes payload contract now accepts optional showtime- and cinema-level ticket URLs. Chip rendering prioritizes those links and retains the legacy Fandango fallback, with tests covering standard and format-grouped showings.

Changes

Showtime Ticket Links

Layer / File(s) Summary
Payload ticket URL contracts
services/agentShowtimesCard.ts, docs/contracts/shared-payloads.md
Adds optional ticketUrl fields to showtime and cinema types and to the v1 shared payload schema.
Ticket link resolution and coverage
services/agentShowtimesCard.ts, services/__tests__/agentShowtimesCard.test.ts, docs/contracts/shared-payloads.md
Passes cinema-level links through view construction and resolves chip links as showtime URL, cinema URL, then legacy Fandango search; tests cover each priority path and grouped showings.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: showtime chips now use per-showtime ticketUrl links for exact showings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/showtimes-chip-purchase-links

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
services/__tests__/agentShowtimesCard.test.ts (1)

119-189: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a test for the full priority chain (showtime ticketUrl over cinema ticketUrl).

The three new tests each exercise two levels of the priority chain, but none verify that a per-showtime ticketUrl takes precedence over a cinema-level ticketUrl when both are present. A test combining both would close the gap and confirm the complete resolution order in a single case.

🧪 Suggested test
it('per-showtime ticketUrl takes priority over cinema-level ticketUrl', () => {
  const buy = 'https://www.amctheatres.com/showtimes/all/2026-07-13/bay-street/all/111';
  const cinemaBuy = 'https://www.amctheatres.com/movie-theatres/bay-street-16';
  const view = buildShowtimesView(
    singleFilmPayload({
      cinemas: [
        cinema({
          ticketUrl: cinemaBuy,
          films: [
            {
              movieGluId: 100,
              title: 'Dune: Part Two',
              times: [
                { start: '2026-07-12T19:30:00-07:00', label: '7:30 PM', ticketUrl: buy },
                { start: '2026-07-12T22:00:00-07:00', label: '10:00 PM' },
              ],
            },
          ],
        }),
      ],
    }),
  );
  if (view.kind !== 'loaded') throw new Error('expected loaded');
  const chips = view.cinemas[0].films[0].sections[0].chips;
  expect(chips[0].href).toBe(buy);        // showtime wins
  expect(chips[1].href).toBe(cinemaBuy);  // linkless sibling falls to cinema
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@services/__tests__/agentShowtimesCard.test.ts` around lines 119 - 189, Add a
test alongside the existing href-priority tests that sets both cinema.ticketUrl
and per-showtime ticketUrl using buildShowtimesView. Assert the showtime chip
uses its own ticketUrl, while a linkless sibling falls back to the cinema-level
URL, covering the complete priority chain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@services/__tests__/agentShowtimesCard.test.ts`:
- Around line 119-189: Add a test alongside the existing href-priority tests
that sets both cinema.ticketUrl and per-showtime ticketUrl using
buildShowtimesView. Assert the showtime chip uses its own ticketUrl, while a
linkless sibling falls back to the cinema-level URL, covering the complete
priority chain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0704909-5a30-4384-986c-9710c0a41d55

📥 Commits

Reviewing files that changed from the base of the PR and between b46b460 and 16bb5ec.

📒 Files selected for processing (3)
  • docs/contracts/shared-payloads.md
  • services/__tests__/agentShowtimesCard.test.ts
  • services/agentShowtimesCard.ts

@BIBOYANG425
BIBOYANG425 merged commit f64e5f7 into main Jul 13, 2026
6 checks passed
@BIBOYANG425
BIBOYANG425 deleted the fix/showtimes-chip-purchase-links branch July 13, 2026 20:58
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.

1 participant