add school calendar logic

This commit is contained in:
root
2026-03-10 16:55:50 -04:00
parent 311bb93977
commit abebe0d9c0
25 changed files with 1358 additions and 750 deletions
@@ -0,0 +1,36 @@
<?php
namespace App\Http\Requests\Settings;
use App\Http\Requests\ApiFormRequest;
use App\Services\Settings\SchoolCalendar\SchoolCalendarContextService;
use Illuminate\Validation\Rule;
class SchoolCalendarStoreRequest extends ApiFormRequest
{
public function authorize(): bool
{
return auth()->check();
}
public function rules(): array
{
$eventTypes = app(SchoolCalendarContextService::class)->eventTypes();
return [
'title' => ['required', 'string', 'min:3', 'max:255'],
'description' => ['nullable', 'string'],
'event_type' => ['nullable', 'string', Rule::in($eventTypes)],
'date' => ['required', 'date_format:Y-m-d'],
'notify_parent' => ['nullable', 'boolean'],
'notify_teacher' => ['nullable', 'boolean'],
'notify_admin' => ['nullable', 'boolean'],
'no_school' => ['nullable', 'boolean'],
'school_year' => ['nullable', 'string', 'max:20'],
'semester' => ['nullable', 'string', 'max:20'],
'send_email_parent' => ['nullable', 'boolean'],
'send_email_teacher' => ['nullable', 'boolean'],
'send_email_admin' => ['nullable', 'boolean'],
];
}
}