diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 2bcde85..d4cc57d 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -17,16 +17,13 @@ class Entry extends Model protected $guarded = []; - protected $hasCheckedScoreSheets = false; - - public $final_scores_array; // Set by TabulationService - - public $scoring_complete; // Set by TabulationService - - public $is_doubler; // Set by DoublerService - protected $with = ['flags']; + public function totalScore(): HasOne + { + return $this->hasOne(EntryTotalScore::class); + } + public function student(): BelongsTo { return $this->belongsTo(Student::class); @@ -98,7 +95,7 @@ class Entry extends Model public function removeFlag($flag): void { - // remove related auditionFlag where flag_name = $flag + // remove the related auditionFlag where flag_name = $flag $this->flags()->where('flag_name', $flag)->delete(); $this->load('flags'); } @@ -120,11 +117,6 @@ class Entry extends Model return $this->hasOne(Seat::class); } - public function calculatedScores(): HasMany - { - return $this->hasMany(CalculatedScore::class); - } - public function scopeForSeating(Builder $query): void { $query->where('for_seating', 1); diff --git a/app/Models/EntryTotalScore.php b/app/Models/EntryTotalScore.php index ca07e2b..9ec59ea 100644 --- a/app/Models/EntryTotalScore.php +++ b/app/Models/EntryTotalScore.php @@ -4,6 +4,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; class EntryTotalScore extends Model { @@ -13,4 +14,9 @@ class EntryTotalScore extends Model 'seating_subscore_totals' => 'json', 'advancement_subscore_totals' => 'json', ]; + + public function entry(): BelongsTo + { + return $this->belongsTo(Entry::class); + } }