feat: add utility scripts to automate internship journal review, approval, and summary generation processes

This commit is contained in:
Ümit Tunç
2026-08-07 23:14:20 +03:00
parent 9b719324cd
commit 9b91b3c847
10 changed files with 1435 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
require __DIR__ . '/../vendor/autoload.php';
$app = require_once __DIR__ . '/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
$interns = App\Models\CareerApplication::where('type', 'internship')->where('status', 'accepted')->with(['journalEntries' => function($q) {
$q->orderBy('day_number', 'asc');
}])->get();
$report = [];
foreach ($interns as $intern) {
$entriesCount = $intern->journalEntries->count();
if ($entriesCount == 0) continue;
$contents = [];
foreach ($intern->journalEntries as $e) {
$contents[] = "Gün " . $e->day_number . " (" . $e->date . "):\n" . mb_substr(strip_tags($e->content), 0, 400);
}
$report[] = [
'name' => $intern->name,
'repo' => $intern->github_repo,
'entries_count' => $entriesCount,
'snippets' => array_slice($contents, -3) // Last 3 entries
];
}
file_put_contents(__DIR__ . '/intern_code_summaries.json', json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
echo "Generated summaries for " . count($report) . " interns.\n";