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.
This commit is contained in:
Lago committed 2026-10-19 09:45:20 +02:00
1 parent c980effddc
commit 9a6e2e5c2a
11 files changed
+348 -7

No files matched your search

+23
View File
@@ -77,6 +77,29 @@ export class ScanPage {
return this.page.getByTestId('welcome-checkin-result');
}
/** The welcome check-in confirmation popup (shown after a welcome scan,
* before the attendee is actually checked in). */
welcomeConfirm(): ReturnType<Page['locator']> {
return this.page.getByTestId('welcome-checkin-confirm');
}
/** Confirm the pending welcome check-in (the "Yes, check in" button). */
async confirmWelcome(): Promise<void> {
await this.page.getByTestId('welcome-checkin-confirm-yes').click();
}
/** Decline the pending welcome check-in (the "No" button). */
async declineWelcome(): Promise<void> {
await this.page.getByRole('button', { name: 'No', exact: true }).click();
}
/** Scan a welcome code and confirm the popup in one step. */
async scanWelcome(code: string): Promise<void> {
await this.scanCode(code);
await this.welcomeConfirm().waitFor({ state: 'visible' });
await this.confirmWelcome();
}
/** Dismiss the open result sheet (the "Scan next" button) so the backdrop
* no longer intercepts clicks on the mode/toggle controls. */
async dismissResult(): Promise<void> {