Add setting to enable nomination ensembles and select a ruleset.

This commit is contained in:
Matt Young 2025-02-02 17:13:29 -06:00
parent f83ba6e806
commit 8055de4778
3 changed files with 47 additions and 1 deletions

View File

@ -24,7 +24,8 @@ class AuditionSettings extends Controller
'organizerName' => ['required'], 'organizerName' => ['required'],
'organizerEmail' => ['required', 'email'], 'organizerEmail' => ['required', 'email'],
'registrationCode' => ['required'], 'registrationCode' => ['required'],
'fee_structure' => ['required', 'in:oneFeePerEntry,oneFeePerStudent'], // Options should align with the boot method of InvoiceDataServiceProvider 'fee_structure' => ['required', 'in:oneFeePerEntry,oneFeePerStudent'],
// Options should align with the boot method of InvoiceDataServiceProvider
'late_fee' => ['nullable', 'numeric', 'min:0'], 'late_fee' => ['nullable', 'numeric', 'min:0'],
'school_fee' => ['nullable', 'numeric', 'min:0'], 'school_fee' => ['nullable', 'numeric', 'min:0'],
'payment_address' => ['required'], 'payment_address' => ['required'],
@ -32,6 +33,8 @@ class AuditionSettings extends Controller
'payment_state' => ['required', 'max:2'], 'payment_state' => ['required', 'max:2'],
'payment_zip' => ['required', 'min:5'], 'payment_zip' => ['required', 'min:5'],
'advanceTo' => ['nullable'], 'advanceTo' => ['nullable'],
'nomination_ensemble_rules' => ['required', 'in:disabled,scobda'],
// Options should align with the boot method of NominationEnsembleServiceProvider
]); ]);
// Olympic Scoring Switch // Olympic Scoring Switch

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
// Check if invoicing_enabled setting exists
$exists = DB::table('site_settings')
->where('setting_key', 'nomination_ensemble_rules')
->exists();
// If it doesn't insert the new row
if (! $exists) {
DB::table('site_settings')->insert([
'setting_key' => 'nomination_ensemble_rules',
'setting_value' => 'disabled',
]);
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
}
};

View File

@ -19,6 +19,16 @@
<x-form.body-grid columns="12" class="m-3"> <x-form.body-grid columns="12" class="m-3">
<x-form.field label_text="Registration Code" name="registrationCode" colspan="3" :value="auditionSetting('registrationCode')"/> <x-form.field label_text="Registration Code" name="registrationCode" colspan="3" :value="auditionSetting('registrationCode')"/>
<x-form.field label_text="Next Event Name" name="advanceTo" colspan="4" :value="auditionSetting('advanceTo')"/> <x-form.field label_text="Next Event Name" name="advanceTo" colspan="4" :value="auditionSetting('advanceTo')"/>
<x-form.select name="nomination_ensemble_rules" colspan="4">
<x-slot:label>Nomination Ensemble Rules</x-slot:label>
{{-- Values should be one of the options in the boot method NominationEnsembleServiceProvider --}}
<option value="disabled" {{ auditionSetting('nomination_ensemble_rules') === 'disabled' ? 'selected':'' }}>
No Nomination Ensembles
</option>
<option value="scobda" {{ auditionSetting('nomination_ensemble_rules') === 'scobda' ? 'selected':'' }}>
SCOBDA Rules
</option>
</x-form.select>
</x-form.body-grid> </x-form.body-grid>
</x-layout.page-section> </x-layout.page-section>