fix financial and certificates

This commit is contained in:
root
2026-06-05 01:51:08 -04:00
parent d28d11e2e5
commit ad968eaff7
94 changed files with 9654 additions and 214 deletions
@@ -0,0 +1,29 @@
<?php
namespace App\Services\Grading\Snapshots;
use App\Models\SemesterScore;
use App\Models\SemesterScoreSnapshot;
class SemesterScoreSnapshotService
{
public function createForScore(SemesterScore $score, array $input, array $calculation, ?int $actorId = null): SemesterScoreSnapshot
{
return SemesterScoreSnapshot::query()->create([
'student_id' => $score->student_id,
'school_id' => $score->school_id,
'class_section_id' => $score->class_section_id,
'semester' => $score->semester,
'school_year' => $score->school_year,
'grading_profile_id' => null,
'grading_profile_version' => $score->calculation_policy_version ?: 'strong_v1',
'calculation_mode' => $score->calculation_mode ?: 'strong',
'calculation_policy_version' => $score->calculation_policy_version ?: 'strong_v1',
'input_json' => $input,
'calculation_json' => $calculation,
'semester_score' => $score->semester_score,
'calculated_by' => $actorId,
'calculated_at' => now(),
]);
}
}