Fix Laravel Pint formatting
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class SemesterScore extends BaseModel
|
||||
@@ -39,26 +38,26 @@ class SemesterScore extends BaseModel
|
||||
public $timestamps = true;
|
||||
|
||||
protected $casts = [
|
||||
'student_id' => 'integer',
|
||||
'school_id' => 'integer',
|
||||
'class_section_id' => 'integer',
|
||||
'updated_by' => 'integer',
|
||||
'student_id' => 'integer',
|
||||
'school_id' => 'integer',
|
||||
'class_section_id' => 'integer',
|
||||
'updated_by' => 'integer',
|
||||
|
||||
// averages/scores: keep decimal to avoid float drift
|
||||
'homework_avg' => 'decimal:2',
|
||||
'quiz_avg' => 'decimal:2',
|
||||
'project_avg' => 'decimal:2',
|
||||
'midterm_exam_score' => 'decimal:2',
|
||||
'final_exam_score' => 'decimal:2',
|
||||
'attendance_score' => 'decimal:2',
|
||||
'homework_avg' => 'decimal:2',
|
||||
'quiz_avg' => 'decimal:2',
|
||||
'project_avg' => 'decimal:2',
|
||||
'midterm_exam_score' => 'decimal:2',
|
||||
'final_exam_score' => 'decimal:2',
|
||||
'attendance_score' => 'decimal:2',
|
||||
'participation_score' => 'decimal:2',
|
||||
'ptap_score' => 'decimal:2',
|
||||
'test_avg' => 'decimal:2',
|
||||
'semester_score' => 'decimal:2',
|
||||
'snapshot_id' => 'integer',
|
||||
'ptap_score' => 'decimal:2',
|
||||
'test_avg' => 'decimal:2',
|
||||
'semester_score' => 'decimal:2',
|
||||
'snapshot_id' => 'integer',
|
||||
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
/* ============================================================
|
||||
@@ -100,7 +99,7 @@ class SemesterScore extends BaseModel
|
||||
public function scopeForTerm(Builder $q, string $semester, string $schoolYear): Builder
|
||||
{
|
||||
return $q->where('semester', $semester)
|
||||
->where('school_year', $schoolYear);
|
||||
->where('school_year', $schoolYear);
|
||||
}
|
||||
|
||||
public function scopeForClassSection(Builder $q, ?int $classSectionId): Builder
|
||||
@@ -126,8 +125,8 @@ class SemesterScore extends BaseModel
|
||||
}
|
||||
|
||||
$keys = [
|
||||
'student_id' => (int) $data['student_id'],
|
||||
'semester' => (string) $data['semester'],
|
||||
'student_id' => (int) $data['student_id'],
|
||||
'semester' => (string) $data['semester'],
|
||||
'school_year' => (string) $data['school_year'],
|
||||
];
|
||||
|
||||
@@ -155,27 +154,27 @@ class SemesterScore extends BaseModel
|
||||
$required = $updating ? 'sometimes' : 'required';
|
||||
|
||||
return [
|
||||
'student_id' => [$required, 'integer', 'min:1'],
|
||||
'semester' => [$required, 'string', 'max:20'],
|
||||
'school_year' => [$required, 'string', 'max:20'],
|
||||
'student_id' => [$required, 'integer', 'min:1'],
|
||||
'semester' => [$required, 'string', 'max:20'],
|
||||
'school_year' => [$required, 'string', 'max:20'],
|
||||
|
||||
'school_id' => ['nullable', 'integer', 'min:1'],
|
||||
'school_id' => ['nullable', 'integer', 'min:1'],
|
||||
'class_section_id' => ['nullable', 'integer', 'min:1'],
|
||||
'updated_by' => ['nullable', 'integer', 'min:1'],
|
||||
'updated_by' => ['nullable', 'integer', 'min:1'],
|
||||
|
||||
'homework_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'quiz_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'project_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'midterm_exam_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'final_exam_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'attendance_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'homework_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'quiz_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'project_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'midterm_exam_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'final_exam_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'attendance_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'participation_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'ptap_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'test_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'semester_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'calculation_mode' => ['nullable', 'string', 'in:legacy,strong'],
|
||||
'ptap_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'test_avg' => ['nullable', 'numeric', 'min:0'],
|
||||
'semester_score' => ['nullable', 'numeric', 'min:0'],
|
||||
'calculation_mode' => ['nullable', 'string', 'in:legacy,strong'],
|
||||
'calculation_policy_version' => ['nullable', 'string', 'max:50'],
|
||||
'snapshot_id' => ['nullable', 'integer', 'min:1'],
|
||||
'snapshot_id' => ['nullable', 'integer', 'min:1'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user