Repository navigation
Labels
Description
Parent
What to build
Implement the scheduled job that runs after an event ends and automatically marks final states: checked_in → attended (success) and confirmed → no_show (absent).
Job: ProcessEventClosureJob
- Implements
ShouldQueue,ShouldBeUnique(uniqueId = event_id) $backoff = [1, 5, 10]for exponential retry- Implements
failed()with logging - Logic:
- Load event with policy
- Determine attendance_requirement from policy
- For each enrollment with status
checked_in:- Count check-in records for this enrollment
- Calculate event days from
starts_attoends_at(inclusive date range) - Apply requirement:
all_days: check-in count == total event days →attendedany_day: check-in count >= 1 →attended(always true if checked_in)minimum_days(N): check-in count >= N →attended
- If requirement NOT met: →
no_show(was present some days but not enough) - If met: transition to
attended, setattended_at
- For each enrollment with status
confirmed(never checked in): →no_show - Record all transitions in audit trail (triggered_by=system)
- Dispatch
ParticipantAttendeddomain event for each newly attended enrollment (implementsShouldDispatchAfterCommit)
Scheduler:
- Register job to run periodically (every 15 minutes or hourly)
- Only processes events where
ends_at < now()AND has enrollments in non-terminal states - Or: dispatch job once per event via
event:closureartisan command
Admin panel — Status override:
- "Override Status" action on enrollment records
- Allows:
no_show → attended(admin corrects mistake),confirmed → checked_in(late arrival that missed formal check-in) - Requires reason text field
- Records transition with triggered_by=admin
Acceptance criteria
- Job transitions
checked_in → attendedwhen attendance requirement is met - Job transitions
confirmed → no_showfor participants who never checked in -
attendance_requirementis correctly evaluated:all_days: requires check-in on every day of the eventany_day: any single check-in sufficesminimum_days(N): requires N or more check-in days
- Job is idempotent — running twice produces same result (no duplicate transitions)
-
ShouldBeUniqueprevents duplicate job execution for same event -
ParticipantAttendeddomain event is dispatched for each newly attended enrollment - Admin can override status (no_show → attended) with reason
- All transitions are recorded in audit trail with triggered_by=system
- Feature tests: all_days met, all_days not met, any_day, minimum_days, no_show marking, admin override, idempotency
- Pint passes
Blocked by
- feat(events): manual check-in #244 (Check-in Manual — needs at least one check-in method to produce
checked_inenrollments)
Activity
[-]Events: Event Closure Job (attended + no_show)[/-][+]feat(events): event closure job (attended/no-show)[/+]feat(events): event closure job and admin status override (#312)
davicbtoliveira commentedon Jun 8, 2026
Issue closed by #312
feat: events module (#309)