Skip to content

[#477] Remove obsolete hacker class logic from check-in#478

Merged
DVidal1205 merged 2 commits into
mainfrom
blade/check-in-fix
Jun 27, 2026
Merged

[#477] Remove obsolete hacker class logic from check-in#478
DVidal1205 merged 2 commits into
mainfrom
blade/check-in-fix

Conversation

@DVidal1205

@DVidal1205 DVidal1205 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Why

Hacker check-in was still coupled to the completed Knight Hacks VIII class system. That behavior assigned and balanced classes, applied class-specific admission rules, rendered class controls and results, and granted hardcoded KH8 Discord roles even though upcoming BloomKnights check-in is classless.

This PR makes hacker check-in classless and limits event-role assignment to BloomKnights while leaving the legacy nullable database column untouched for a future database-configurable system.

What

Closes: #477

  • Removed class assignment, balancing, admission checks, VIP bypasses, role grants, messages, inputs, and response data from hacker check-in.
  • Explicitly transitions confirmed hackers to checkedin for Check-in events.
  • Grants only the environment-specific BloomKnights Discord role during the initial check-in transition:
    • Production: 1510751065786683412
    • Development: 1520492619921227836
  • Keeps Discord lookup and role failures non-blocking and audit-logged.
  • Removed class selectors and class results from QR and manual check-in.
  • Replaced class/lanyard copy with generic badge guidance.
  • Deleted the unused duplicate scanner and obsolete KH8/class constants, utilities, types, and unused procedures.
  • Kept HackerAttendee.class as an inert nullable legacy column; no migration was generated.
  • Retained the existing client-supplied hackathonId and eventPoints fields for this scoped change.

No environment variables, dependencies, migrations, or deployment configuration were changed.

Test Plan

Completed locally:

  • pnpm format
  • pnpm lint
  • pnpm typecheck
  • Targeted typechecks for Blade, API, database, constants, and utilities packages
  • Blade production build using the repository-compatible pinned Node runtime
  • Verified production and development resolve to their expected BloomKnights role IDs
  • Verified Blade serves successfully on port 3000
  • Audited active check-in code for removed class inputs, constants, utilities, response fields, and procedures
  • git diff --check

Still to verify against an integrated event/Discord environment:

  1. Check in a confirmed BloomKnights hacker through a Check-in event and verify status, attendance, points, and the development Discord role.
  2. Verify the legacy class column remains null.
  3. Verify a non-Bloom hackathon check-in grants no hackathon or class role.
  4. Simulate Discord lookup/role failure and verify the audit log is written while database check-in succeeds.
  5. Recheck duplicate prevention, repeated check-in behavior, and non-Check-in event eligibility.

Screenshots were not captured; the UI change removes the obsolete class selector/result and updates the success guidance.

Checklist

  • Database: No schema changes, OR I ran pnpm db:generate and committed the generated files in packages/db/drizzle/
  • Environment Variables: No environment variables changed, OR I have contacted the Development Lead to modify them on Coolify BEFORE merging.

Summary by CodeRabbit

  • Bug Fixes
    • Simplified event check-in flows to remove class-based assignment, making check-ins more consistent.
    • Updated check-in confirmations and results to focus on attendance status rather than class details.
    • Removed the QR scanner pop-up and class selection from manual check-in screens.
    • Adjusted related data displays and docs to reflect the current check-in behavior.

Co-authored-by: Codex <codex@openai.com>
@DVidal1205 DVidal1205 added Bug Something isn't working Major Big change - 2+ reviewers required Blade Change modifies code in Blade app API Change modifies code in the global API/tRPC package labels Jun 27, 2026
@DVidal1205 DVidal1205 self-assigned this Jun 27, 2026
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 0d671777-3aa7-4b36-bf35-7d691a51f8e9

📥 Commits

Reviewing files that changed from the base of the PR and between 53d49b0 and c5d2a2a.

📒 Files selected for processing (12)
  • apps/blade/src/app/_components/admin/club/members/scanner.tsx
  • apps/blade/src/app/_components/admin/hackathon/check-in/manual-entry-form.tsx
  • apps/blade/src/app/_components/shared/scanner.tsx
  • docs/DATABASE-USAGE.md
  • packages/api/src/routers/hackers/mutations.ts
  • packages/api/src/routers/hackers/queries.ts
  • packages/consts/src/hackathons/bloomknights.ts
  • packages/consts/src/hackathons/index.ts
  • packages/consts/src/hackathons/kh8.ts
  • packages/db/src/schemas/knight-hacks.ts
  • packages/utils/src/hackathons.ts
  • packages/utils/src/index.ts

📝 Walkthrough

Walkthrough

Removes the Knight Hacks VIII hacker class assignment system from check-in. Deletes kh8.ts constants, HACKER_CLASSES/HackerClass/AssignedClassCheckinSchema DB exports, and getClassTeam utility. Adds bloomknights.ts constants with a single EVENT_ROLE_ID. Updates eventCheckIn to skip class logic and assign only the BloomKnights Discord event role. Strips class UI from scanner and manual entry form. Removes getPointsByClass and getTopHackers TRPC procedures.

Changes

Hacker class removal and BloomKnights migration

Layer / File(s) Summary
DB schema and constants cleanup
packages/db/src/schemas/knight-hacks.ts, packages/consts/src/hackathons/bloomknights.ts, packages/consts/src/hackathons/index.ts, packages/utils/src/index.ts
Removes HACKER_CLASSES, HackerClass, AssignedClassCheckinSchema, and all KH8 role constants; changes HackerAttendee.class $type to string | null; adds bloomknights.ts with EVENT_ROLE_ID; updates the hackathons barrel export.
eventCheckIn mutation: class removal and BloomKnights role
packages/api/src/routers/hackers/mutations.ts
Derives hackathonId with an UNAUTHORIZED guard; removes assignedClassCheckin schema validation and class field from queries; replaces transaction-based class assignment and multi-role Discord logic with a single EVENT_ROLE_ID assignment for BloomKnights; simplifies response payload.
Remove getPointsByClass and getTopHackers
packages/api/src/routers/hackers/queries.ts
Narrows imports, drops HackerAttendee.class from getHacker projection, and removes two public TRPC procedures.
Class UI removal from scanner and manual entry
apps/blade/src/app/_components/shared/scanner.tsx, apps/blade/src/app/_components/admin/hackathon/check-in/manual-entry-form.tsx, docs/DATABASE-USAGE.md
Removes assignedClass state, class dropdown helpers, class display in the persistent dialog, and assignedClassCheckin from form schemas; updates docs to mark HackerAttendee.class as legacy.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • KnightHacks/forge#374: Updates the hacker check-in client flow using eventCheckIn in scanner.tsx, the same mutation surface this PR modifies to remove class logic.
  • KnightHacks/forge#381: Introduced hackathons.getClassTeam in @forge/utils, which this PR removes along with its consuming class-display paths in the scanner UI.

Suggested reviewers

  • DGoel1602
✨ 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 blade/check-in-fix

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.

Comment thread docs/DATABASE-USAGE.md Outdated
@DVidal1205 DVidal1205 marked this pull request as ready for review June 27, 2026 18:56
@DVidal1205 DVidal1205 added this pull request to the merge queue Jun 27, 2026
Merged via the queue into main with commit 96cf3b1 Jun 27, 2026
10 of 11 checks passed
@DVidal1205 DVidal1205 deleted the blade/check-in-fix branch June 27, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Change modifies code in the global API/tRPC package Blade Change modifies code in Blade app Bug Something isn't working Major Big change - 2+ reviewers required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove obsolete hacker class logic from check-in

2 participants