feat: testing suite and bug fixes (Fasa 11)

- AuthTest, ProgramTest, CheckinTest, QuestionnaireTest, CertificateTest — 19 feature tests, 35 total pass
- ProgramFactory with published() state
- UserFactory: is_admin=true default, nonAdmin() state
- Fix attendance_source column name in StatisticsController (was: source)
- Fix route(dashboard) → route(admin.dashboard) in all Breeze auth controllers
- Remove irrelevant Breeze boilerplate tests (Profile, Example, Registration)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Saufi
2026-05-17 00:23:38 +08:00
parent a41ff59009
commit 700fbd1bcc
19 changed files with 493 additions and 187 deletions

View File

@@ -28,9 +28,9 @@ class StatisticsController extends Controller
// Attendance by source
$bySource = $program->attendances()
->selectRaw('source, COUNT(*) as total')
->groupBy('source')
->pluck('total', 'source')
->selectRaw('attendance_source, COUNT(*) as total')
->groupBy('attendance_source')
->pluck('total', 'attendance_source')
->toArray();
// Certificate status breakdown
@@ -88,8 +88,8 @@ class StatisticsController extends Controller
$summary = [
'total_attendances' => $program->attendances()->count(),
'pre_registered' => $program->attendances()->where('source', 'pre_registered_staff')->count(),
'walk_in' => $program->attendances()->where('source', 'walk_in_external')->count(),
'pre_registered' => $program->attendances()->where('attendance_source', 'pre_registered_staff')->count(),
'walk_in' => $program->attendances()->where('attendance_source', 'walk_in_external')->count(),
'total_certificates' => $program->certificates()->count(),
'generated_certs' => $program->certificates()->whereIn('status', ['generated', 'emailed', 'downloaded'])->count(),
'downloaded_certs' => $program->certificates()->where('status', 'downloaded')->count(),
@@ -111,7 +111,7 @@ class StatisticsController extends Controller
$a->participant->name,
$a->participant->agency ?: '',
$a->attendance_session,
$a->source,
$a->attendance_source,
$a->checked_in_at->format('d/m/Y H:i'),
]);