feat: add utility scripts to automate internship journal review, approval, and summary generation processes
This commit is contained in:
@@ -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";
|
||||
Reference in New Issue
Block a user