Skip to content

feat(events): implement manual check-in - #278

Merged
danielhe4rt merged 7 commits into
feat/eventsfrom
feat/manual-check-in
May 23, 2026
Merged

danielhe4rt merged 7 commits into
feat/eventsfrom
feat/manual-check-in

Conversation

@davicbtoliveira

@davicbtoliveira davicbtoliveira commented May 23, 2026 •

Copy link
Copy Markdown
Member

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

  • Organizer can mark a participant as checked in from Admin panel
  • Check-in record created in events_check_ins with method=manual and correct date
  • First check-in transitions enrollment from confirmed → checked_in
  • Subsequent check-ins (multi-day) create records without re-transitioning
  • Duplicate check-in on same date is rejected
  • Check-in outside event date range is rejected
  • Bulk check-in action works for multiple participants
  • ParticipantCheckedIn domain event is dispatched
  • Transition audit trail records the organizer
  • Feature tests: single, multi-day, duplicate, date range, status validation
  • 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

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.
@davicbtoliveira davicbtoliveira self-assigned this May 23, 2026
@davicbtoliveira davicbtoliveira linked an issue May 23, 2026 that may be closed by this pull request
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 danielhe4rt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
danielhe4rt merged commit e8914ad into feat/events May 23, 2026
@danielhe4rt
danielhe4rt deleted the feat/manual-check-in branch May 23, 2026 20:37
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 |
@davicbtoliveira davicbtoliveira linked an issue Jun 8, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(events): manual check-in feat(events): participation module MVP

2 participants