feat: add analysis tools and dashboard views for intern data tracking and reporting

This commit is contained in:
Ümit Tunç
2026-08-31 12:57:06 +03:00
parent 3b0d2664e4
commit f1a579c8ee
15 changed files with 4793 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
<?php
require __DIR__ . '/../vendor/autoload.php';
$app = require_once __DIR__ . '/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
use App\Models\CareerApplication;
$internIds = [18, 19, 20, 22, 23, 25, 27, 28, 31, 32];
$interns = CareerApplication::whereIn('id', $internIds)->get();
echo "Testing verification & transcript completeness for " . $interns->count() . " interns:\n";
echo "========================================================================================\n";
$allPassed = true;
foreach ($interns as $intern) {
$hasCode = !empty($intern->certificate_code);
$hasTranscript = !empty($intern->transcript_markdown) && strlen($intern->transcript_markdown) > 500;
$isApproved = $intern->notebook_approved && $intern->notebook_supervisor_signed;
$entriesCount = $intern->journalEntries()->count();
$approvedEntries = $intern->journalEntries()->where('supervisor_approved', true)->count();
$status = ($hasCode && $hasTranscript && $isApproved && $entriesCount === $approvedEntries) ? "PASSED" : "FAILED";
if ($status === "FAILED") $allPassed = false;
echo sprintf(
"[%s] ID:%d | %s | Code: %s | TransLen: %d | ApprEntries: %d/%d | SupName: %s\n",
$status,
$intern->id,
str_pad($intern->name, 23),
$intern->certificate_code,
strlen($intern->transcript_markdown ?? ''),
$approvedEntries,
$entriesCount,
$intern->notebook_supervisor_name
);
}
echo "========================================================================================\n";
if ($allPassed) {
echo "SUCCESS: All 10 interns are fully validated with active certificate codes, custom academic transcripts, approved notebooks, and digital signatures!\n";
} else {
echo "ERROR: Some checks failed!\n";
}