fix financial and certificates
This commit is contained in:
@@ -21,7 +21,7 @@ class PromotionEligibilityServiceTest extends TestCase
|
||||
$studentId = $this->seedStudent();
|
||||
$this->seedClassChain();
|
||||
$this->seedAssignment($studentId, 701, '2025-2026');
|
||||
$this->seedScores($studentId, '2025-2026', 80.0, 75.0);
|
||||
$this->seedDecision($studentId, '2025-2026', 77.5, 'promoted');
|
||||
|
||||
$service = $this->makeService();
|
||||
$record = $service->evaluateStudent($studentId, '2025-2026', 1);
|
||||
@@ -41,7 +41,7 @@ class PromotionEligibilityServiceTest extends TestCase
|
||||
$studentId = $this->seedStudent();
|
||||
$this->seedClassChain();
|
||||
$this->seedAssignment($studentId, 701, '2025-2026');
|
||||
$this->seedScores($studentId, '2025-2026', 50.0, 55.0);
|
||||
$this->seedDecision($studentId, '2025-2026', 52.5, 'retained');
|
||||
|
||||
$service = $this->makeService();
|
||||
$record = $service->evaluateStudent($studentId, '2025-2026', 1);
|
||||
@@ -72,7 +72,7 @@ class PromotionEligibilityServiceTest extends TestCase
|
||||
$studentId = $this->seedStudent();
|
||||
$this->seedClassChain();
|
||||
$this->seedAssignment($studentId, 901, '2025-2026');
|
||||
$this->seedScores($studentId, '2025-2026', 90.0, 90.0);
|
||||
$this->seedDecision($studentId, '2025-2026', 90.0, 'promoted');
|
||||
|
||||
// Mark Youth as terminal
|
||||
\App\Models\LevelProgression::query()->where('current_level_name', 'Youth')->update(['is_terminal' => 1]);
|
||||
@@ -90,7 +90,7 @@ class PromotionEligibilityServiceTest extends TestCase
|
||||
$studentId = $this->seedStudent();
|
||||
$this->seedClassChain();
|
||||
$this->seedAssignment($studentId, 701, '2025-2026');
|
||||
$this->seedScores($studentId, '2025-2026', 80.0, 80.0);
|
||||
$this->seedDecision($studentId, '2025-2026', 80.0, 'promoted');
|
||||
|
||||
$service = $this->makeService();
|
||||
$service->evaluateStudent($studentId, '2025-2026', 99);
|
||||
@@ -159,11 +159,18 @@ class PromotionEligibilityServiceTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
private function seedScores(int $studentId, string $schoolYear, float $fall, float $spring): void
|
||||
private function seedDecision(int $studentId, string $schoolYear, float $score, string $decision): void
|
||||
{
|
||||
DB::table('semester_scores')->insert([
|
||||
['student_id' => $studentId, 'class_section_id' => 0, 'school_year' => $schoolYear, 'semester' => 'fall', 'semester_score' => $fall],
|
||||
['student_id' => $studentId, 'class_section_id' => 0, 'school_year' => $schoolYear, 'semester' => 'spring', 'semester_score' => $spring],
|
||||
DB::table('student_decisions')->insert([
|
||||
'student_id' => $studentId,
|
||||
'school_year' => $schoolYear,
|
||||
'class_section_name' => '3A',
|
||||
'year_score' => $score,
|
||||
'decision' => $decision,
|
||||
'source' => 'manual',
|
||||
'notes' => 'Seeded test decision',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user