reconstruction of the project
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Administrator;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class SaveAdminNotificationSubjectsRequest extends ApiFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'subjects' => ['required', 'array'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'subjects.required' => 'Subjects payload is required.',
|
||||
'subjects.array' => 'Subjects payload must be an array.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Administrator;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class SavePrintRecipientsRequest extends ApiFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'notify' => ['required', 'array'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'notify.required' => 'Notify payload is required.',
|
||||
'notify.array' => 'Notify payload must be an array.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Administrator;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class SendTeacherSubmissionNotificationsRequest extends ApiFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'notify' => ['required', 'array', 'min:1'],
|
||||
'missing_items' => ['nullable', 'array'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'notify.required' => 'Select at least one teacher to notify.',
|
||||
'notify.array' => 'Notify payload must be an array.',
|
||||
'notify.min' => 'Select at least one teacher to notify.',
|
||||
'missing_items.array' => 'Missing items payload must be an array.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Administrator;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class SubmitAdministratorAbsenceRequest extends ApiFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'dates' => ['required', 'array', 'min:1'],
|
||||
'dates.*' => ['required', 'date_format:Y-m-d'],
|
||||
'reason_type' => ['nullable', 'string', 'max:100'],
|
||||
'reason' => ['required', 'string', 'max:2000'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'dates.required' => 'At least one date is required.',
|
||||
'dates.array' => 'Dates must be submitted as an array.',
|
||||
'dates.min' => 'At least one date is required.',
|
||||
'dates.*.date_format' => 'Each date must be in Y-m-d format.',
|
||||
'reason.required' => 'Reason is required.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Administrator;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateEnrollmentStatusesRequest extends ApiFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
$allowedStatuses = [
|
||||
'admission under review',
|
||||
'payment pending',
|
||||
'enrolled',
|
||||
'withdraw under review',
|
||||
'refund pending',
|
||||
'withdrawn',
|
||||
'denied',
|
||||
'waitlist',
|
||||
];
|
||||
|
||||
return [
|
||||
'enrollment_status' => ['required', 'array', 'min:1'],
|
||||
'enrollment_status.*' => ['required', 'string', Rule::in($allowedStatuses)],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'enrollment_status.required' => 'Enrollment statuses are required.',
|
||||
'enrollment_status.array' => 'Enrollment statuses must be an array.',
|
||||
'enrollment_status.min' => 'At least one enrollment status is required.',
|
||||
'enrollment_status.*.in' => 'One or more enrollment statuses are invalid.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user