feat(scan): confirm before welcome check-in, with print warning

The staff scanner checked attendees in silently, and the default session
mode never prints — so a welcome-desk scan could check someone in with no
badge and no confirmation.

- new read-only RPC preview_welcome_checkin(qr): resolves the attendee and
  reports already + will_print (mirrors the exact welcome_checkin enqueue
  condition: first check-in AND a layout exists). Staff/admin only; checks
  nobody in, enqueues nothing.
- attendee Scan screen previews first and shows a Yes/No sheet: "You are
  checking in [Name]. By confirming, you will print this person's label."
  Only Yes runs welcome_checkin. Session check-in unchanged (never prints).
- badge_print_tests.sql +8 assertions (109 total); ScanPage + welcome specs
  drive the confirm step; new CONV-CHECKIN-003 (No cancels, Yes checks in).
- docs: rpcs.md, printing.md, releases/2026-10-19.md.

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
committed 2026-10-19 09:45:20 +02:00
1 parent 00c89c1b48
commit 65dcf64c4e
11 files changed
+348 -7

No files matched your search

+41 -2
View File
@@ -24,8 +24,11 @@ test.describe('Welcome Check-In + attendee access', () => {
await scan.setStaffMode();
await scan.setWelcomeMode();
// Scan ATTENDEE_NEW (manual code = the QR payload).
// Scan ATTENDEE_NEW (manual code = the QR payload). A confirmation popup
// appears first; the attendee is only checked in after confirming.
await scan.scanCode(ID.attendeeNew.qrToken);
await expect(scan.welcomeConfirm()).toBeVisible();
await scan.confirmWelcome();
await expect(scan.welcomeResult()).toBeVisible();
// Backend state is persisted: ATTENDEE_NEW is now welcome-checked-in.
@@ -42,8 +45,10 @@ test.describe('Welcome Check-In + attendee access', () => {
await scan.setStaffMode();
await scan.setWelcomeMode();
// Manual code input (the same token the QR would carry).
// Manual code input (the same token the QR would carry); confirm the popup.
await scan.scanCode(ID.attendeeNew.qrToken);
await expect(scan.welcomeConfirm()).toBeVisible();
await scan.confirmWelcome();
await expect(scan.welcomeResult()).toBeVisible();
// Equivalent backend state: welcome-checked-in, no session check-in created.
@@ -53,6 +58,39 @@ test.describe('Welcome Check-In + attendee access', () => {
expect(db.sessionCheckins(ID.attendeeNew.email)).toEqual([]);
});
test('CONV-CHECKIN-003 welcome scan shows a confirm popup; No cancels, Yes checks in', async ({ page }) => {
const app = new AppPage(page, APP_URL);
const scan = new ScanPage(page);
await login(page, APP_URL, ID.staff);
await app.waitForAdmitted();
await app.gotoTab('scan');
await scan.setStaffMode();
await scan.setWelcomeMode();
// Scanning shows a confirmation naming the attendee and the print warning,
// but does NOT check them in yet.
await scan.scanCode(ID.attendeeNew.qrToken);
const confirm = scan.welcomeConfirm();
await expect(confirm).toBeVisible();
await expect(confirm).toContainText(/You are checking in/);
await expect(confirm).toContainText(/print this person's label/i);
expect(db.isWelcomeCheckedIn(ID.attendeeNew.email)).toBe(false);
// "No" dismisses the popup and leaves the attendee unchecked in.
await scan.declineWelcome();
await expect(confirm).toBeHidden();
await new Promise((r) => setTimeout(r, 300));
expect(db.isWelcomeCheckedIn(ID.attendeeNew.email)).toBe(false);
// Scanning again and choosing "Yes" performs the check-in.
await scan.scanCode(ID.attendeeNew.qrToken);
await expect(scan.welcomeConfirm()).toBeVisible();
await scan.confirmWelcome();
await expect(scan.welcomeResult()).toBeVisible();
expect(await db.waitForWelcomeCheckedIn(ID.attendeeNew.email)).toBe(true);
});
test('CONV-ATT-AUTH-001 first-time attendee is gated before welcome check-in', async ({ page }) => {
const app = new AppPage(page, APP_URL);
@@ -85,6 +123,7 @@ test.describe('Welcome Check-In + attendee access', () => {
await sScan.setStaffMode();
await sScan.setWelcomeMode();
await sScan.scanCode(ID.attendeeNew.qrToken);
await sScan.confirmWelcome();
await expect(sScan.welcomeResult()).toBeVisible();
// 3. The attendee's open browser lifts the gate automatically (4s poll) —
+4 -1
View File
@@ -64,9 +64,12 @@ test.describe('Session Check-In', () => {
await app.waitForAdmitted();
await app.gotoTab('scan');
// 1. Welcome check-in only (no session).
// 1. Welcome check-in only (no session). A confirmation popup appears
// first; confirm it before the attendee is checked in.
await scan.setWelcomeMode();
await scan.scanCode(ID.attendeeA.qrToken);
await expect(scan.welcomeConfirm()).toBeVisible();
await scan.confirmWelcome();
await expect(scan.welcomeResult()).toBeVisible();
expect(await db.waitForWelcomeCheckedIn(ID.attendeeA.email)).toBe(true);