feat: Initial commit for Saqel Platform architecture, backend, Docker, and documentation

This commit is contained in:
Hamza-Ayed
2026-08-26 15:45:55 +03:00
commit d53b64500a
177 changed files with 19909 additions and 0 deletions
@@ -0,0 +1,43 @@
<?php
namespace App\Jobs;
use App\Contracts\AiService;
use App\Models\User;
use App\Services\ProgressTrackingService;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Throwable;
class AnalyzeStudentPerformance implements ShouldQueue
{
use Queueable;
public int $tries = 3;
public function __construct(public int $studentId) {}
public function handle(ProgressTrackingService $tracking, AiService $ai): void
{
/** @var User|null $student */
$student = User::query()->find($this->studentId);
if ($student === null) {
return;
}
try {
$payload = $ai->analyzeStudentPerformance($tracking->buildPerformanceSnapshot($student));
} catch (Throwable $exception) {
report($exception);
return;
}
$student->aiReports()->create([
'type' => 'weakness_analysis',
'payload' => $payload,
'summary' => is_string($payload['summary'] ?? null) ? $payload['summary'] : null,
]);
}
}