Fix by where no-shows would block seating.
This commit is contained in:
parent
929619e817
commit
bed3e13e01
|
|
@ -31,6 +31,7 @@ class AllJudgesCount implements CalculateEntryScore
|
||||||
$cacheKey = 'entryScore-'.$entry->id.'-'.$mode;
|
$cacheKey = 'entryScore-'.$entry->id.'-'.$mode;
|
||||||
|
|
||||||
return Cache::remember($cacheKey, 10, function () use ($mode, $entry) {
|
return Cache::remember($cacheKey, 10, function () use ($mode, $entry) {
|
||||||
|
$this->isEntryANoShow($entry);
|
||||||
$this->basicValidation($mode, $entry);
|
$this->basicValidation($mode, $entry);
|
||||||
$this->areAllJudgesIn($entry);
|
$this->areAllJudgesIn($entry);
|
||||||
$this->areAllJudgesValid($entry);
|
$this->areAllJudgesValid($entry);
|
||||||
|
|
@ -88,4 +89,11 @@ class AllJudgesCount implements CalculateEntryScore
|
||||||
throw new TabulationException('Score exists from a judge not assigned to this audition');
|
throw new TabulationException('Score exists from a judge not assigned to this audition');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function isEntryANoShow(Entry $entry): void
|
||||||
|
{
|
||||||
|
if ($entry->hasFlag('no_show')) {
|
||||||
|
throw new TabulationException('No Show');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ class AllowForOlympicScoring implements CalculateEntryScore
|
||||||
|
|
||||||
return Cache::remember($cacheKey, 10, function () use ($mode, $entry) {
|
return Cache::remember($cacheKey, 10, function () use ($mode, $entry) {
|
||||||
$this->basicValidation($mode, $entry);
|
$this->basicValidation($mode, $entry);
|
||||||
|
$this->isEntryANoShow($entry);
|
||||||
$this->areAllJudgesIn($entry);
|
$this->areAllJudgesIn($entry);
|
||||||
$this->areAllJudgesValid($entry);
|
$this->areAllJudgesValid($entry);
|
||||||
|
|
||||||
|
|
@ -134,4 +135,11 @@ class AllowForOlympicScoring implements CalculateEntryScore
|
||||||
throw new TabulationException('Score exists from a judge not assigned to this audition');
|
throw new TabulationException('Score exists from a judge not assigned to this audition');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function isEntryANoShow(Entry $entry): void
|
||||||
|
{
|
||||||
|
if ($entry->hasFlag('no_show')) {
|
||||||
|
throw new TabulationException('No Show');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ use App\Exceptions\TabulationException;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
use function is_numeric;
|
use function is_numeric;
|
||||||
|
|
||||||
class RankAuditionEntries
|
class RankAuditionEntries
|
||||||
|
|
@ -29,6 +30,12 @@ class RankAuditionEntries
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For a given audition, return a collection of entries ranked by total score. Each entry will have a
|
||||||
|
* property rank that either is their rank or a flag reflecting no-show, declined, or failed-prelim status
|
||||||
|
*
|
||||||
|
* @throws TabulationException
|
||||||
|
*/
|
||||||
public function calculateRank(string $mode, Audition $audition): Collection
|
public function calculateRank(string $mode, Audition $audition): Collection
|
||||||
{
|
{
|
||||||
$this->basicValidation($mode, $audition);
|
$this->basicValidation($mode, $audition);
|
||||||
|
|
@ -80,7 +87,6 @@ class RankAuditionEntries
|
||||||
return $entries;
|
return $entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function basicValidation($mode, Audition $audition): void
|
protected function basicValidation($mode, Audition $audition): void
|
||||||
{
|
{
|
||||||
if ($mode !== 'seating' && $mode !== 'advancement') {
|
if ($mode !== 'seating' && $mode !== 'advancement') {
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,10 @@ class SeatAuditionFormController extends Controller
|
||||||
$totalScoreColumn = $entry->score_totals[0] >= 0 ? $entry->score_totals[0] : $entry->score_message;
|
$totalScoreColumn = $entry->score_totals[0] >= 0 ? $entry->score_totals[0] : $entry->score_message;
|
||||||
$fullyScored = $entry->score_totals[0] >= 0;
|
$fullyScored = $entry->score_totals[0] >= 0;
|
||||||
}
|
}
|
||||||
|
// No Shows are fully scored
|
||||||
|
if ($entry->hasFlag('no_show')) {
|
||||||
|
$fullyScored = true;
|
||||||
|
}
|
||||||
$doublerData = $this->doublerService->entryDoublerData($entry);
|
$doublerData = $this->doublerService->entryDoublerData($entry);
|
||||||
$entryData[] = [
|
$entryData[] = [
|
||||||
'rank' => $entry->rank,
|
'rank' => $entry->rank,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue