Auditionadmin 68 #85

Merged
okorpheus merged 11 commits from auditionadmin-68 into master 2024-10-31 17:22:49 +00:00
3 changed files with 55 additions and 1 deletions
Showing only changes of commit 8f7a333898 - Show all commits

View File

@ -6,6 +6,7 @@ namespace App\Actions\Tabulation;
use App\Exceptions\TabulationException; use App\Exceptions\TabulationException;
use App\Models\BonusScore; use App\Models\BonusScore;
use App\Models\CalculatedScore;
use App\Models\Entry; use App\Models\Entry;
use App\Services\AuditionService; use App\Services\AuditionService;
use App\Services\EntryService; use App\Services\EntryService;
@ -42,8 +43,15 @@ class AllowForOlympicScoring implements CalculateEntryScore
$this->isEntryANoShow($entry); $this->isEntryANoShow($entry);
$this->areAllJudgesIn($entry); $this->areAllJudgesIn($entry);
$this->areAllJudgesValid($entry); $this->areAllJudgesValid($entry);
$calculatedScores = $this->getJudgeTotals($mode, $entry);
CalculatedScore::create([
'entry_id' => $entry->id,
'mode' => $mode,
'calculatedScore' => $calculatedScores,
]);
return $this->getJudgeTotals($mode, $entry); return $calculatedScores;
// return $this->getJudgeTotals($mode, $entry);
}); });
} }

View File

@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class CalculatedScore extends Model
{
use HasFactory;
protected $guarded = [];
protected $casts = ['calculatedScore' => 'json'];
}

View File

@ -0,0 +1,31 @@
<?php
use App\Models\Entry;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('calculated_scores', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Entry::class)->constrained()->cascadeOnDelete()->cascadeOnUpdate();
$table->string('mode');
$table->json('calculatedScore');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('calculated_scores');
}
};