feat: auto-register walk-in attendees during check-in

- Automatically register users who scan QR code but aren't pre-registered
- Mark walk-in registrations with wasWalkIn flag
- Show different success messages for walk-ins vs pre-registered attendees
- Check in walk-ins immediately upon registration
- Remove 'not registered' error - now handles walk-ins gracefully
- Update both QR scan and manual check-in to support walk-ins
This commit is contained in:
2025-11-20 19:10:29 +00:00
parent 2102f053da
commit 57b7cd2308
4 changed files with 66 additions and 17 deletions

View File

@@ -582,20 +582,12 @@ export const eventController = {
// Find or create the attendee user
const attendeeUserId = await findOrCreateUser(clerkUserId);
// Check in the attendee
// Check in the attendee (will auto-register if not registered)
const result = await eventService.checkInAttendee(id, attendeeUserId);
res.json(result);
} catch (error: any) {
console.error('Error checking in attendee:', error);
if (error.message.includes('not registered')) {
return res.status(404).json({
code: 'NOT_REGISTERED',
message: error.message,
timestamp: new Date().toISOString(),
});
}
if (error.message.includes('already checked in')) {
return res.status(409).json({