feat: add analysis tools and dashboard views for intern data tracking and reporting
This commit is contained in:
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user