From fba625c3165f57ef17e23e7014f9b6659158b290 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 25 Jun 2025 15:25:10 -0500 Subject: [PATCH] Create action for entering no_show and failed_prelim flags --- app/Actions/Tabulation/EnterNoShow.php | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 app/Actions/Tabulation/EnterNoShow.php diff --git a/app/Actions/Tabulation/EnterNoShow.php b/app/Actions/Tabulation/EnterNoShow.php new file mode 100644 index 0000000..5d3e0d0 --- /dev/null +++ b/app/Actions/Tabulation/EnterNoShow.php @@ -0,0 +1,55 @@ +audition->hasFlag('seats_published')) { + throw new AuditionAdminException('Cannot enter a no-show for an entry in an audition where seats are published'); + } + if ($entry->audition->hasFlag('advancement_published')) { + throw new AuditionAdminException('Cannot enter a no-show for an entry in an audition where advancement is published'); + } + DB::table('score_sheets')->where('entry_id', $entry->id)->delete(); + + ScoreSheet::where('entry_id', $entry->id)->delete(); + BonusScore::where('entry_id', $entry->id)->delete(); + EntryTotalScore::where('entry_id', $entry->id)->delete(); + if ($flagType == 'failed-prelim') { + $msg = 'Failed prelim has been entered for '.$entry->audition->name.' #'.$entry->draw_number.' (ID: '.$entry->id.').'; + $entry->addFlag('failed_prelim'); + } else { + $entry->addFlag('no_show'); + $msg = 'No Show has been entered for '.$entry->audition->name.' #'.$entry->draw_number.' (ID: '.$entry->id.').'; + } + + return $msg; + } +}