Repository navigation
feat(events): bot check-in integration - #326
Merged
danielhe4rt merged 4 commits intoJun 14, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Events-module side of bot-triggered check-in (Discord/Twitch). The bot dispatches a
CheckInRequesteddomain event; Events listens (HandleBotCheckIn), resolves the user and enrollment, processes the check-in by reusing the numeric-code validation, and dispatches aCheckInProcessedresponse so the bot can reply to the member in chat. The bot is pure transport; Events owns the rules (ADR-0005).Flow:
CheckInRequested→HandleBotCheckIn→NumericCodeCheckInAction→CheckInProcessedCloses #248
What changed —
app-modules/eventssrc/CheckIn/Events/CheckInRequested.phpprovider,externalUserId,code,tenantId,eventId?(reserved, see below),channelContext.src/CheckIn/Events/CheckInProcessed.phpprovider,externalUserId,status,message,channelContext,enrollmentId?.src/CheckIn/Enums/BotCheckInStatus.phpSuccess/Errorstatus for the response event.src/CheckIn/Listeners/HandleBotCheckIn.phpFindExternalIdentity), resolves the enrollment, delegates toNumericCodeCheckInAction, dispatchesCheckInProcessed. CatchesExternalIdentityException/CheckInException→ error response.src/CheckIn/Exceptions/CheckInException.phpbotNoActiveEnrollment()andbotMultipleActiveEvents()factories.lang/en/check_in.php,lang/pt_BR/check_in.phpsrc/EventsServiceProvider.phpCheckInRequested → HandleBotCheckIn.Event resolution (the important bit)
The listener finds the user's check-in-able enrollments (
confirmed/checked_in) for a published event happening today, scoped to the tenant. When the user has more than one active event the same day (e.g. a morning and an evening online event), the typed code identifies which event — eachCheckInCodebelongs to a single event.This replaces an earlier date-only resolution that errored on any 2-same-day case, which would have wrongly blocked the legitimate morning+evening scenario. The single-event flow is unchanged; only a genuine collision (same code value on two same-day events the user is enrolled in) returns an ambiguity error pointing to the panel.
Acceptance criteria
CheckInRequesteddefined with proper payloadCheckInProcessedresponse dispatched with success/error statusNumericCodeCheckInAction)EventsServiceProvider— manual registration (Laravel event auto-discovery is disabled app-wide; matches the existingGenerateQrTokenOnConfirmedpattern)Test plan
Results:
HandleBotCheckInTest: 11/11Scenarios covered: success + success response · unlinked user · invalid code · no active enrollment · event not today · multiple events → typed code selects the right one · multiple events + non-matching code → invalid · same code on two events → ambiguity error · already checked in today · waitlisted enrollment ignored.
Out of scope (separate issues)
CheckInRequested(app-modules/bot-discord/) — separate concern, per the issue.eventId/ "path A") — the field stays reserved in the payload but is not honored; the typed code already resolves the event.