Skip to content

feat(events): numeric code check-in #245

@danielhe4rt

Description

@danielhe4rt

Parent

#237

What to build

Implement numeric code check-in: organizer generates a short-lived code bound to a specific date, participant enters it to check in. Also supports bot-triggered check-in via domain events.

Admin panel — Code management:

  • "Generate Check-in Code" action on Event resource
  • Fields: code (auto-generated or manual), event_date, valid_from, valid_until, max_uses (optional)
  • List of active/expired codes per event with usage stats
  • Code format: 4-6 digit numeric string

Extend CheckInAction (numeric_code path):

  • Validates: code exists for this event + event_date
  • Validates: now() BETWEEN valid_from AND valid_until
  • Validates: uses_count < max_uses (if max_uses is not null)
  • Atomically increments uses_count on the code record
  • Creates check-in record with method=numeric_code, payload={code: "4829"}
  • Same enrollment status transition logic as manual (confirmed → checked_in on first, record-only on subsequent)
  • Dispatches ParticipantCheckedIn

App panel — Code entry:

  • "Enter Check-in Code" form visible when enrollment is confirmed or checked_in (multi-day)
  • Input field for the numeric code
  • Validation errors: "Code expired", "Code already used maximum times", "Invalid code for today"
  • Success confirmation on valid check-in

Error handling:

  • Invalid code: 422 with "Invalid check-in code"
  • Expired code (valid_until passed): 422 with "Code has expired"
  • Exhausted code (uses_count >= max_uses): 422 with "Code has reached maximum uses"
  • Wrong date (code is for a different event_date): 422 with "Code is not valid for today"

Acceptance criteria

  • Organizer can generate numeric codes bound to a specific event date
  • Participant can enter code in App panel and get checked in
  • Code validation checks: existence, date match, time window, max uses
  • uses_count is incremented atomically on successful check-in
  • Expired/exhausted codes are rejected with clear error messages
  • Multi-day: participant can use different codes on different days
  • Check-in record stores method=numeric_code with code in payload
  • ParticipantCheckedIn domain event dispatched
  • Feature tests: valid code, expired code, exhausted code, wrong date, concurrent usage
  • Pint passes

Blocked by

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions