diff --git a/app/Http/Controllers/Admin/AuditionSettings.php b/app/Http/Controllers/Admin/AuditionSettings.php index 8481279..6083f20 100644 --- a/app/Http/Controllers/Admin/AuditionSettings.php +++ b/app/Http/Controllers/Admin/AuditionSettings.php @@ -21,9 +21,15 @@ class AuditionSettings extends Controller 'organizerName' => ['required'], 'organizerEmail' => ['required', 'email'], 'registrationCode' => ['required'], - 'late_fee' => ['nullable', 'numeric'], - 'school_fee' => ['nullable', 'numeric'], + 'fee_structure' => ['required', 'in:oneFeePerEntry,oneFeePerStudent'], // Options should align with the boot method of InvoiceDataServiceProvider + 'late_fee' => ['nullable', 'numeric', 'min:0'], + 'school_fee' => ['nullable', 'numeric', 'min:0'], ]); + + // Store currency values as cents + $validData['late_fee'] = $validData['late_fee'] * 100; + $validData['school_fee'] = $validData['school_fee'] * 100; + // TODO implement olympic scoring foreach ($validData as $key => $value) { Settings::set($key, $value); diff --git a/resources/views/admin/audition-settings.blade.php b/resources/views/admin/audition-settings.blade.php index 8dc2b2a..eb338cf 100644 --- a/resources/views/admin/audition-settings.blade.php +++ b/resources/views/admin/audition-settings.blade.php @@ -42,12 +42,19 @@ Fee Structure - One fee per entry - One fee per student + {{-- Values should be one of the options in the boot method InvoiceDataServiceProvider --}} + One fee per entry + One fee per student - one late fee per student if any of their entries are late - - + + diff --git a/resources/views/dashboard/invoice.blade.php b/resources/views/dashboard/invoice.blade.php index c29d66a..fa7e453 100644 --- a/resources/views/dashboard/invoice.blade.php +++ b/resources/views/dashboard/invoice.blade.php @@ -2,9 +2,9 @@ Invoice - {{ $school->name }} - - - + + + Student Name Audition @@ -24,7 +24,7 @@ @endforeach - + Totals