Files
alrahma_sunday_school_api/app/Models/SemesterScoreSnapshot.php
T
2026-06-11 11:46:12 -04:00

45 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SemesterScoreSnapshot extends BaseModel
{
protected $table = 'semester_score_snapshots';
protected $fillable = [
'student_id',
'school_id',
'class_section_id',
'semester',
'school_year',
'grading_profile_id',
'grading_profile_version',
'calculation_mode',
'calculation_policy_version',
'input_json',
'calculation_json',
'semester_score',
'calculated_by',
'calculated_at',
];
protected $casts = [
'student_id' => 'integer',
'school_id' => 'integer',
'class_section_id' => 'integer',
'grading_profile_id' => 'integer',
'input_json' => 'array',
'calculation_json' => 'array',
'semester_score' => 'decimal:2',
'calculated_by' => 'integer',
'calculated_at' => 'datetime',
];
public function semesterScore(): BelongsTo
{
return $this->belongsTo(SemesterScore::class, 'snapshot_id');
}
}