Delete bonus scores when an entry is flagged as a no show

This commit is contained in:
Matt Young 2024-11-22 10:41:05 -06:00
parent e2a41fdb9c
commit 9742cdbd76
1 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Tabulation;
use App\Http\Controllers\Controller;
use App\Models\BonusScore;
use App\Models\CalculatedScore;
use App\Models\Entry;
use App\Models\ScoreSheet;
@ -83,6 +84,7 @@ class EntryFlagController extends Controller
$entry->addFlag('no_show');
ScoreSheet::where('entry_id', $entry->id)->delete();
CalculatedScore::where('entry_id', $entry->id)->delete();
BonusScore::where('entry_id', $entry->id)->delete();
if (request()->input('noshow-type') == 'failprelim') {
$msg = 'Failed prelim has been entered for '.$entry->audition->name.' #'.$entry->draw_number.' (ID: '.$entry->id.').';
$entry->addFlag('failed_prelim');