Rewrite tabulation #14

Merged
okorpheus merged 43 commits from rewrite-tabulation into master 2024-07-14 05:36:29 +00:00
1 changed files with 15 additions and 1 deletions
Showing only changes of commit 83ee56717d - Show all commits

View File

@ -8,6 +8,7 @@ use App\Exceptions\TabulationException;
use App\Models\Audition;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\Cache;
use function is_numeric;
class RankAuditionEntries
{
@ -60,12 +61,25 @@ class RankAuditionEntries
$rank = 1;
foreach ($entries as $entry) {
$entry->rank = $rank;
$rank++;
if ($mode === 'seating') {
if ($entry->hasFlag('declined')) {
$entry->rank = 'Declined';
} elseif ($entry->hasFlag('no_show')) {
$entry->rank = 'No Show';
} elseif ($entry->hasFlag('failed_prelim')) {
$entry->rank = 'Failed Prelim';
}
}
if (is_numeric($entry->rank)) {
$rank++;
}
}
return $entries;
}
protected function basicValidation($mode, Audition $audition): void
{
if ($mode !== 'seating' && $mode !== 'advancement') {