Skip to content

fix(scanners): hide swag in Door Check and sessions in Swag Pickup#281

Merged
JacobCoffee merged 1 commit intomainfrom
fix/scanner-category-split
Apr 28, 2026
Merged

fix(scanners): hide swag in Door Check and sessions in Swag Pickup#281
JacobCoffee merged 1 commit intomainfrom
fix/scanner-category-split

Conversation

@JacobCoffee
Copy link
Copy Markdown
Member

Summary

  • Door Check was showing T-Shirt categories and Swag Pickup was showing Tutorials / Sponsor Presentations / Summits — both pages call `/check_in/redeemable/` which returns the union of every redeemable category and `CategorySerializer` only emits `(id, name)`, so the client had nothing to discriminate on.
  • Filter the response client-side by category name in each page's `ngOnInit`:
    • Door Check keeps categories not matching `/shirt|swag/i`.
    • Swag Pickup keeps categories matching `/shirt|swag/i`.
  • Products are also filtered to those whose surviving category is in the kept set, so "All sessions in this category" + the search list don't leak through.

A comment in each `ngOnInit` points at the proper long-term fix (expose `render_type` on `CategorySerializer` in `pycon-site` and filter on `render_type === 10` for presentations).

Effect — given `pycon-site/fixtures/inventory.json`

Page Categories shown after fix
Door Check Tutorials, Sponsor Presentations, Job Fair Add-On, Summits and Events, PyLadies Auction
Swag Pickup Conference T-Shirts, Charlas T-Shirts, PyLadies T-Shirts

Test plan

  • `make serve`, sign in as someone with check-in permissions.
  • Open Door Check: chips contain only sessions/events (no shirts). Pick Tutorials → product list is tutorial sessions only.
  • Open Swag Pickup: chips contain only T-Shirt categories. Pick Conference T-Shirts → product list is shirt sizes only.
  • Scan a real attendee QR on each page; redemption flow still works (server-side `?mode=…` filter is unchanged).

🤖 Generated with Claude Code

Both scanner pages call /check_in/redeemable/ to populate their category
chips and product list, and that endpoint returns the full union of
redeemable categories (sessions + merchandise). CategorySerializer only
emits (id, name), so there's no render_type or other discriminator on
the wire — the result is that Door Check showed t-shirt categories and
Swag Pickup showed Tutorials / Sponsor Presentations / Summits / etc.

Filter the response client-side by category name:
- Door Check keeps anything *not* matching /shirt|swag/i.
- Swag Pickup keeps anything *matching* /shirt|swag/i.

Products are filtered to those whose category survived, so the "All
sessions in this category" / search list also stays consistent.

Both filters carry a comment pointing at the long-term fix (expose
render_type on CategorySerializer in pycon-site).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JacobCoffee JacobCoffee merged commit 16858f0 into main Apr 28, 2026
2 checks passed
@JacobCoffee JacobCoffee deleted the fix/scanner-category-split branch April 28, 2026 02:32
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