Repository navigation
feat(events): implement manual check-in - #278
Merged
Merged
Conversation
Add CheckInAction, after-commit domain event, audit transition records, per-day duplicate protection, Admin panel single/bulk check-in actions, and feature coverage for manual and multi-day check-ins.
Tighten nullable access, make enrollment response matching exhaustive, and add Eloquent builder generics to Events scopes.
Use Builder<self> for Event model scopes so PHPStan resolves the generic type to the model instead of the Event facade.
Extract enrollment status transition logic from CheckInAction into a reusable TransitionEnrollmentAction, so future transitions (attended, cancelled) reuse the same pattern. The action accepts an optional timestamp to preserve the check-in record's actual time. Move check-in exceptions out of EnrollmentException into a dedicated CheckInException, respecting the bounded context boundary between the CheckIn and Enrollment modules.
11 tasks
… CheckInAction Replace the monolithic CheckInAction with two classes: - CheckInService: internal shared flow (validation, record creation, transition, event dispatch) - ManualCheckInAction: public action with clean signature, delegates to CheckInService Callers no longer pass CheckInMethod or payload internals.
danielhe4rt
requested changes
May 23, 2026
danielhe4rt
left a comment
Contributor
There was a problem hiding this comment.
tá maneiro doggers, só arruma umas coisas ai
… transition actions - Rename CheckInService -> CheckInAction, accepts CheckInDTO - ManualCheckInAction accepts ManualCheckInDTO - TransitionEnrollmentAction accepts TransitionEnrollmentDTO - Move TIMESTAMP_MAP to EnrollmentStatus::timestampColumn()
danielhe4rt
reviewed
May 23, 2026
danielhe4rt
reviewed
May 23, 2026
danielhe4rt
approved these changes
May 23, 2026
danielhe4rt
pushed a commit
that referenced
this pull request
Jun 4, 2026
## Summary ### Solve: #244 Implements manual check-in: organizers mark participants as present via the Admin panel. Creates a check-in record and transitions enrollment status. Covers single-day and multi-day events with duplicate prevention, date range validation, audit trail, and bulk check-in. ## What was implemented ### `CheckInAction` — Core action - Accepts enrollment, method (enum), payload (array), event_date (Carbon date) - Validates enrollment status is `confirmed` or `checked_in` - Validates event_date is within the event's date range - Validates no existing check-in for the same enrollment + date - Creates `events_check_ins` record with `method=manual`, `payload={actor_user_id}`, `event_date`, `checked_in_at=now` - First check-in transitions enrollment from `confirmed` → `checked_in` - Subsequent check-ins (multi-day) only create the check-in record - Records audit trail (`triggered_by=admin`, `actor_user_id=organizer`) - Dispatches `ParticipantCheckedIn` domain event (`ShouldDispatchAfterCommit`) ### Admin panel — `EnrollmentsRelationManager` - "Check In" action on enrollment records (visible when status is `confirmed` or `checked_in`) - Date picker defaulting to today, constrained to event date range - Bulk "Check In Selected" action for multiple participants - Check-in history column per enrollment ### `TransitionEnrollmentAction` Extracted reusable action for enrollment status transitions, used by the check-in flow and available for future transitions (`attended`, `cancelled`). ### `CheckInException` Check-in validation errors moved to the CheckIn module boundary (`CheckIn/Exceptions/`) instead of leaking into `EnrollmentException`. ## Acceptance criteria - [x] Organizer can mark a participant as checked in from Admin panel - [x] Check-in record created in `events_check_ins` with method=manual and correct date - [x] First check-in transitions enrollment from `confirmed` → `checked_in` - [x] Subsequent check-ins (multi-day) create records without re-transitioning - [x] Duplicate check-in on same date is rejected - [x] Check-in outside event date range is rejected - [x] Bulk check-in action works for multiple participants - [x] `ParticipantCheckedIn` domain event is dispatched - [x] Transition audit trail records the organizer - [x] Feature tests: single, multi-day, duplicate, date range, status validation - [x] Pint passes ## Files changed ### New (8 files) | File | Purpose | |---|---| | `app-modules/events/src/CheckIn/Actions/CheckInAction.php` | Core check-in action (validate, create record, transition, dispatch) | | `app-modules/events/src/CheckIn/Exceptions/CheckInException.php` | Check-in specific exceptions (invalid status, outside range, duplicate, invalid actor) | | `app-modules/events/src/CheckIn/Events/ParticipantCheckedIn.php` | Domain event dispatched after check-in (`ShouldDispatchAfterCommit`) | | `app-modules/events/src/Enrollment/Actions/TransitionEnrollmentAction.php` | Reusable action for enrollment status transitions with audit trail | | `app-modules/events/lang/en/check_in.php` | English check-in exception messages | | `app-modules/events/lang/pt_BR/check_in.php` | Brazilian Portuguese check-in exception messages | | `app-modules/events/database/factories/CheckInFactory.php` | Factory for CheckIn model | | `app-modules/events/tests/Feature/CheckInActionTest.php` | 6 feature tests (single, multi-day, duplicate, date range, status, actor) | ### Modified (11 files) | File | What changed | |---|---| | `app-modules/events/src/CheckIn/Models/CheckIn.php` | Added `checked_in_at` to fillable, casts, phpdocs | | `app-modules/events/database/migrations/2026_05_22_000001_add_checked_in_at_to_events_check_ins_table.php` | Added `checked_in_at` column to `events_check_ins` | | `app-modules/events/src/Enrollment/Models/Enrollment.php` | Added `checkIns()` hasMany relationship | | `app-modules/events/src/Enrollment/Enums/EnrollmentStatus.php` | Added `CheckedIn` case with transition rules | | `app-modules/events/src/Enrollment/Exceptions/EnrollmentException.php` | Added `invalidTransition()`; removed check-in exceptions (moved to CheckInException) | | `app-modules/events/src/Enrollment/Actions/EnrollUserAction.php` | Import adjustment | | `app-modules/events/src/Event/Models/Event.php` | Relationship additions for enrollment policy | | `app-modules/events/lang/en/exceptions.php` | Added `invalid_transition` key; removed check-in keys | | `app-modules/events/lang/pt_BR/exceptions.php` | Added `invalid_transition` key; removed check-in keys | | `app-modules/events/tests/Feature/EventResourceTest.php` | 5 tests: Filament CRUD, single + bulk check-in, check-in history | | `app-modules/panel-admin/src/Filament/Resources/Events/RelationManagers/EnrollmentsRelationManager.php` | "Check In" action, bulk "Check In Selected", check-in history column, date picker |
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
Solve: #244
Implements manual check-in: organizers mark participants as present via the Admin panel. Creates a check-in record and transitions enrollment status. Covers single-day and multi-day events with duplicate prevention, date range validation, audit trail, and bulk check-in.
What was implemented
CheckInAction— Core actionconfirmedorchecked_inevents_check_insrecord withmethod=manual,payload={actor_user_id},event_date,checked_in_at=nowconfirmed→checked_intriggered_by=admin,actor_user_id=organizer)ParticipantCheckedIndomain event (ShouldDispatchAfterCommit)Admin panel —
EnrollmentsRelationManagerconfirmedorchecked_in)TransitionEnrollmentActionExtracted reusable action for enrollment status transitions, used by the check-in flow and available for future transitions (
attended,cancelled).CheckInExceptionCheck-in validation errors moved to the CheckIn module boundary (
CheckIn/Exceptions/) instead of leaking intoEnrollmentException.Acceptance criteria
events_check_inswith method=manual and correct dateconfirmed→checked_inParticipantCheckedIndomain event is dispatchedFiles changed
New (8 files)
app-modules/events/src/CheckIn/Actions/CheckInAction.phpapp-modules/events/src/CheckIn/Exceptions/CheckInException.phpapp-modules/events/src/CheckIn/Events/ParticipantCheckedIn.phpShouldDispatchAfterCommit)app-modules/events/src/Enrollment/Actions/TransitionEnrollmentAction.phpapp-modules/events/lang/en/check_in.phpapp-modules/events/lang/pt_BR/check_in.phpapp-modules/events/database/factories/CheckInFactory.phpapp-modules/events/tests/Feature/CheckInActionTest.phpModified (11 files)
app-modules/events/src/CheckIn/Models/CheckIn.phpchecked_in_atto fillable, casts, phpdocsapp-modules/events/database/migrations/2026_05_22_000001_add_checked_in_at_to_events_check_ins_table.phpchecked_in_atcolumn toevents_check_insapp-modules/events/src/Enrollment/Models/Enrollment.phpcheckIns()hasMany relationshipapp-modules/events/src/Enrollment/Enums/EnrollmentStatus.phpCheckedIncase with transition rulesapp-modules/events/src/Enrollment/Exceptions/EnrollmentException.phpinvalidTransition(); removed check-in exceptions (moved to CheckInException)app-modules/events/src/Enrollment/Actions/EnrollUserAction.phpapp-modules/events/src/Event/Models/Event.phpapp-modules/events/lang/en/exceptions.phpinvalid_transitionkey; removed check-in keysapp-modules/events/lang/pt_BR/exceptions.phpinvalid_transitionkey; removed check-in keysapp-modules/events/tests/Feature/EventResourceTest.phpapp-modules/panel-admin/src/Filament/Resources/Events/RelationManagers/EnrollmentsRelationManager.php