From 9cf025154a0b41fc076474d89d9867600ec1e0d5 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Mon, 30 Jun 2025 08:27:54 -0500 Subject: [PATCH] Update TotalEntryScores action to recognize an insufficient number of judges. --- app/Actions/Tabulation/TotalEntryScores.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Actions/Tabulation/TotalEntryScores.php b/app/Actions/Tabulation/TotalEntryScores.php index 1e2a252..d7c0a4b 100644 --- a/app/Actions/Tabulation/TotalEntryScores.php +++ b/app/Actions/Tabulation/TotalEntryScores.php @@ -34,8 +34,9 @@ class TotalEntryScores // deal with seating scores // TODO: Consider a rewrite to pull the scoreSheets from the entry model so they may be preloaded $scoreSheets = ScoreSheet::where('entry_id', $entry->id)->orderBy('seating_total', 'desc')->get(); - // bail out if there are no score sheets - if ($scoreSheets->count() == 0) { + // bail out if there are not enough score sheets + $assignedJudges = $entry->audition->judges()->count(); + if ($scoreSheets->count() == 0 || $scoreSheets->count() < $assignedJudges) { return; } if (auditionSetting('olympic_scoring' && $scoreSheets->count() > 2)) {