Fix Pint formatting
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use App\Controllers\Admin\CompetitionWinnersController;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Mirrors legacy {@see \App\Controllers\Admin\CompetitionWinnersController::saveScores()} accepted fields.
|
||||
* Mirrors legacy {@see CompetitionWinnersController::saveScores()} accepted fields.
|
||||
*/
|
||||
class SaveCompetitionScoresRequest extends FormRequest
|
||||
{
|
||||
|
||||
@@ -3,6 +3,4 @@
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
/** Validation for updating competition settings (legacy `CompetitionWinnersController::update`). */
|
||||
class UpdateCompetitionWinnerRequest extends StoreCompetitionWinnerRequest
|
||||
{
|
||||
}
|
||||
class UpdateCompetitionWinnerRequest extends StoreCompetitionWinnerRequest {}
|
||||
|
||||
@@ -31,4 +31,4 @@ class SubmitAdministratorAbsenceRequest extends ApiFormRequest
|
||||
'reason.required' => 'Reason is required.',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\Api\Admin;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class IndexAdminProgressRequest extends FormRequest
|
||||
@@ -36,4 +35,4 @@ class IndexAdminProgressRequest extends FormRequest
|
||||
'status' => $this->filled('status') ? (string) $this->query('status') : '',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class SaveAdminNotificationSubjectsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
@@ -18,4 +16,4 @@ class SaveAdminNotificationSubjectsRequest extends FormRequest
|
||||
// dynamic structure: subjects[adminId][subjectKey]=true OR array of subject strings
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class SavePrintNotificationRecipientsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
@@ -17,4 +15,4 @@ class SavePrintNotificationRecipientsRequest extends FormRequest
|
||||
'notify' => ['required', 'array'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class SendTeacherSubmissionNotificationsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
@@ -19,4 +17,4 @@ class SendTeacherSubmissionNotificationsRequest extends FormRequest
|
||||
'missing_items' => ['nullable', 'array'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class StoreStudentAssignmentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
@@ -14,11 +12,11 @@ class StoreStudentAssignmentRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'student_id' => ['required', 'integer', 'exists:students,id'],
|
||||
'student_id' => ['required', 'integer', 'exists:students,id'],
|
||||
'class_section_id' => ['required', 'integer', 'exists:class_sections,id'],
|
||||
'semester' => ['nullable', 'string', 'max:50'],
|
||||
'school_year' => ['nullable', 'string', 'max:50'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'semester' => ['nullable', 'string', 'max:50'],
|
||||
'school_year' => ['nullable', 'string', 'max:50'],
|
||||
'description' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ class AdminAddAttendanceEntryRequest extends FormRequest
|
||||
'is_reported' => ['nullable', 'in:yes,no'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ class SaveAdminAttendanceRequest extends FormRequest
|
||||
'staff' => ['nullable', 'array'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ class SaveStaffAttendanceCellRequest extends FormRequest
|
||||
'reason' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ class TeacherSubmitAttendanceRequest extends FormRequest
|
||||
'teachers' => ['required', 'array', 'min:1'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ class UpdateAttendanceManagementRequest extends FormRequest
|
||||
'is_reported' => ['nullable'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ class ComposeAttendanceEmailRequest extends ApiFormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'code' => ['nullable', 'string'],
|
||||
'variant' => ['nullable', 'string'],
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'code' => ['nullable', 'string'],
|
||||
'variant' => ['nullable', 'string'],
|
||||
'incident_date' => ['nullable', 'date_format:Y-m-d'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ class RecordAttendanceTrackingRequest extends ApiFormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'date' => ['required', 'date_format:Y-m-d'],
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'date' => ['required', 'date_format:Y-m-d'],
|
||||
'parent_email' => ['nullable', 'email'],
|
||||
'parent_name' => ['nullable', 'string'],
|
||||
'parent_name' => ['nullable', 'string'],
|
||||
'subject_type' => ['nullable', 'string'],
|
||||
'semester' => ['nullable', 'string'],
|
||||
'school_year' => ['nullable', 'string'],
|
||||
'semester' => ['nullable', 'string'],
|
||||
'school_year' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ class SaveAttendanceNotificationNoteRequest extends ApiFormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'code' => ['required', 'string'],
|
||||
'note' => ['required', 'string'],
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'code' => ['required', 'string'],
|
||||
'note' => ['required', 'string'],
|
||||
'incident_date' => ['nullable', 'date_format:Y-m-d'],
|
||||
'to' => ['nullable', 'email'],
|
||||
'subject' => ['nullable', 'string'],
|
||||
'variant' => ['nullable', 'string'],
|
||||
'to' => ['nullable', 'email'],
|
||||
'subject' => ['nullable', 'string'],
|
||||
'variant' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ class SendAttendanceManualEmailRequest extends ApiFormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'to' => ['required', 'email'],
|
||||
'subject' => ['required', 'string'],
|
||||
'body_html' => ['required', 'string'],
|
||||
'code' => ['required', 'string'],
|
||||
'variant' => ['nullable', 'string'],
|
||||
'student_id' => ['required', 'integer', 'min:1'],
|
||||
'to' => ['required', 'email'],
|
||||
'subject' => ['required', 'string'],
|
||||
'body_html' => ['required', 'string'],
|
||||
'code' => ['required', 'string'],
|
||||
'variant' => ['nullable', 'string'],
|
||||
'incident_date' => ['nullable', 'date_format:Y-m-d'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ class RegisterRequest extends ApiFormRequest
|
||||
{
|
||||
public static function ruleset(): array
|
||||
{
|
||||
return (new self())->rules();
|
||||
return (new self)->rules();
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
|
||||
@@ -17,7 +17,7 @@ class BadgePrintStatusRequest extends FormRequest
|
||||
|
||||
if (is_string($userIds)) {
|
||||
$userIds = array_filter(array_map('trim', explode(',', $userIds)), 'strlen');
|
||||
} elseif (!is_array($userIds)) {
|
||||
} elseif (! is_array($userIds)) {
|
||||
$userIds = $userIds ? [$userIds] : [];
|
||||
}
|
||||
|
||||
@@ -40,4 +40,4 @@ class BadgePrintStatusRequest extends FormRequest
|
||||
{
|
||||
return $this->input('user_ids', []);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class GenerateBadgePdfRequest extends FormRequest
|
||||
|
||||
if (is_string($userIds)) {
|
||||
$userIds = array_filter(array_map('trim', explode(',', $userIds)), 'strlen');
|
||||
} elseif (!is_array($userIds)) {
|
||||
} elseif (! is_array($userIds)) {
|
||||
$userIds = $userIds ? [$userIds] : [];
|
||||
}
|
||||
|
||||
@@ -38,4 +38,4 @@ class GenerateBadgePdfRequest extends FormRequest
|
||||
'classes' => ['nullable', 'array'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class LogBadgePrintRequest extends FormRequest
|
||||
|
||||
if (is_string($userIds)) {
|
||||
$userIds = array_filter(array_map('trim', explode(',', $userIds)), 'strlen');
|
||||
} elseif (!is_array($userIds)) {
|
||||
} elseif (! is_array($userIds)) {
|
||||
$userIds = $userIds ? [$userIds] : [];
|
||||
}
|
||||
|
||||
@@ -38,4 +38,4 @@ class LogBadgePrintRequest extends FormRequest
|
||||
'classes' => ['nullable', 'array'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\ClassProgress;
|
||||
|
||||
use App\Http\Requests\ClassProgress\ClassProgressFormRequest;
|
||||
|
||||
class ClassProgressIndexRequest extends ClassProgressFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
@@ -23,7 +21,7 @@ class ClassProgressIndexRequest extends ClassProgressFormRequest
|
||||
'week_start' => ['nullable', 'date_format:Y-m-d'],
|
||||
'week_end' => ['nullable', 'date_format:Y-m-d'],
|
||||
'subject' => ['nullable', 'string', 'max:120'],
|
||||
'status' => $statuses ? ['nullable', 'in:' . implode(',', $statuses)] : ['nullable', 'string'],
|
||||
'status' => $statuses ? ['nullable', 'in:'.implode(',', $statuses)] : ['nullable', 'string'],
|
||||
'group_by_week' => ['nullable', 'boolean'],
|
||||
'page' => ['nullable', 'integer', 'min:1'],
|
||||
'per_page' => ['nullable', 'integer', 'min:1', 'max:200'],
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\ClassProgress;
|
||||
|
||||
use App\Http\Requests\ClassProgress\ClassProgressFormRequest;
|
||||
|
||||
class ClassProgressMetaRequest extends ClassProgressFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\ClassProgress;
|
||||
|
||||
use App\Http\Requests\ClassProgress\ClassProgressFormRequest;
|
||||
|
||||
class ClassProgressStoreRequest extends ClassProgressFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
@@ -27,7 +25,7 @@ class ClassProgressStoreRequest extends ClassProgressFormRequest
|
||||
$sections = (array) config('progress.subject_sections', []);
|
||||
$maxFileKb = (int) config('progress.attachments.max_kb', 5120);
|
||||
$mimes = (array) config('progress.attachments.mimes', ['pdf', 'jpg', 'jpeg', 'png']);
|
||||
$mimeRule = 'mimes:' . implode(',', $mimes);
|
||||
$mimeRule = 'mimes:'.implode(',', $mimes);
|
||||
|
||||
foreach ($sections as $slug => $section) {
|
||||
$rules["covered_{$slug}"] = ['nullable', 'string'];
|
||||
@@ -37,7 +35,7 @@ class ClassProgressStoreRequest extends ClassProgressFormRequest
|
||||
$rules["chapter_{$slug}"] = ['nullable', 'array'];
|
||||
$rules["chapter_{$slug}.*"] = ['nullable', 'string', 'max:120'];
|
||||
$rules["attachment_{$slug}"] = ['nullable', 'array'];
|
||||
$rules["attachment_{$slug}.*"] = ['nullable', 'file', $mimeRule, 'max:' . $maxFileKb];
|
||||
$rules["attachment_{$slug}.*"] = ['nullable', 'file', $mimeRule, 'max:'.$maxFileKb];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Requests\ClassProgress;
|
||||
|
||||
use App\Http\Requests\ClassProgress\ClassProgressFormRequest;
|
||||
|
||||
class ClassProgressUpdateRequest extends ClassProgressFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
@@ -16,7 +14,7 @@ class ClassProgressUpdateRequest extends ClassProgressFormRequest
|
||||
$statuses = array_keys((array) config('progress.status_options', []));
|
||||
$maxFileKb = (int) config('progress.attachments.max_kb', 5120);
|
||||
$mimes = (array) config('progress.attachments.mimes', ['pdf', 'jpg', 'jpeg', 'png']);
|
||||
$mimeRule = 'mimes:' . implode(',', $mimes);
|
||||
$mimeRule = 'mimes:'.implode(',', $mimes);
|
||||
|
||||
return [
|
||||
'week_start' => ['nullable', 'date_format:Y-m-d'],
|
||||
@@ -24,11 +22,11 @@ class ClassProgressUpdateRequest extends ClassProgressFormRequest
|
||||
'covered' => ['nullable', 'string'],
|
||||
'homework' => ['nullable', 'string'],
|
||||
'unit_title' => ['nullable', 'string', 'max:120'],
|
||||
'status' => $statuses ? ['nullable', 'in:' . implode(',', $statuses)] : ['nullable', 'string'],
|
||||
'status' => $statuses ? ['nullable', 'in:'.implode(',', $statuses)] : ['nullable', 'string'],
|
||||
'support_needed' => ['nullable', 'string'],
|
||||
'flags' => ['nullable', 'array'],
|
||||
'attachments' => ['nullable', 'array'],
|
||||
'attachments.*' => ['nullable', 'file', $mimeRule, 'max:' . $maxFileKb],
|
||||
'attachments.*' => ['nullable', 'file', $mimeRule, 'max:'.$maxFileKb],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class FamilyComposeEmailRequest extends ApiFormRequest
|
||||
{
|
||||
parent::prepareForValidation();
|
||||
|
||||
if (!$this->has('html_message') && $this->has('html')) {
|
||||
if (! $this->has('html_message') && $this->has('html')) {
|
||||
$this->merge(['html_message' => $this->input('html')]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,16 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CarryforwardAdjustmentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'amount' => ['required','numeric','min:0'],
|
||||
'reason' => ['nullable','string','max:255'],
|
||||
'amount' => ['required', 'numeric', 'min:0'],
|
||||
'reason' => ['nullable', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,18 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CarryforwardFinalizeRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'from_school_year' => ['required_without:id','string','max:20'],
|
||||
'to_school_year' => ['required_without:id','string','max:20'],
|
||||
'parent_id' => ['nullable','integer'],
|
||||
'reason' => ['nullable','string','max:255'],
|
||||
'from_school_year' => ['required_without:id', 'string', 'max:20'],
|
||||
'to_school_year' => ['required_without:id', 'string', 'max:20'],
|
||||
'parent_id' => ['nullable', 'integer'],
|
||||
'reason' => ['nullable', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,18 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CarryforwardPreviewRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'from_school_year' => ['required','string','max:20'],
|
||||
'to_school_year' => ['required','string','max:20'],
|
||||
'parent_id' => ['nullable','integer'],
|
||||
'minimum_balance' => ['nullable','numeric','min:0'],
|
||||
'from_school_year' => ['required', 'string', 'max:20'],
|
||||
'to_school_year' => ['required', 'string', 'max:20'],
|
||||
'parent_id' => ['nullable', 'integer'],
|
||||
'minimum_balance' => ['nullable', 'numeric', 'min:0'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,20 +6,24 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class EventChargeLifecycleRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'event_id' => ['nullable','integer'],
|
||||
'parent_id' => ['nullable','integer'],
|
||||
'student_id' => ['nullable','integer'],
|
||||
'school_year' => ['nullable','string','max:20'],
|
||||
'semester' => ['nullable','string','max:40'],
|
||||
'event_name' => ['nullable','string','max:255'],
|
||||
'title' => ['nullable','string','max:255'],
|
||||
'description' => ['nullable','string'],
|
||||
'amount' => ['nullable','numeric','min:0'],
|
||||
'invoice_id' => ['nullable','integer'],
|
||||
'event_id' => ['nullable', 'integer'],
|
||||
'parent_id' => ['nullable', 'integer'],
|
||||
'student_id' => ['nullable', 'integer'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'semester' => ['nullable', 'string', 'max:40'],
|
||||
'event_name' => ['nullable', 'string', 'max:255'],
|
||||
'title' => ['nullable', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'invoice_id' => ['nullable', 'integer'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,19 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FinanceNotificationLogRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => ['nullable','string','max:40'],
|
||||
'notification_type' => ['nullable','string','max:80'],
|
||||
'parent_id' => ['nullable','integer'],
|
||||
'date_from' => ['nullable','date'],
|
||||
'date_to' => ['nullable','date'],
|
||||
'status' => ['nullable', 'string', 'max:40'],
|
||||
'notification_type' => ['nullable', 'string', 'max:80'],
|
||||
'parent_id' => ['nullable', 'integer'],
|
||||
'date_from' => ['nullable', 'date'],
|
||||
'date_to' => ['nullable', 'date'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
namespace App\Http\Requests\Finance;
|
||||
|
||||
class FinancialSummaryRequest extends FinancialReportRequest
|
||||
{
|
||||
}
|
||||
class FinancialSummaryRequest extends FinancialReportRequest {}
|
||||
|
||||
@@ -6,19 +6,23 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FollowUpNoteRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'invoice_id' => ['nullable','integer'],
|
||||
'school_year' => ['nullable','string','max:20'],
|
||||
'status' => ['nullable','string','max:60'],
|
||||
'contact_method' => ['nullable','string','max:60'],
|
||||
'promise_to_pay_date' => ['nullable','date'],
|
||||
'promise_to_pay_amount' => ['nullable','numeric','min:0'],
|
||||
'next_follow_up_date' => ['nullable','date'],
|
||||
'escalation_level' => ['nullable','integer','min:0','max:10'],
|
||||
'note' => ['nullable','string','max:10000'],
|
||||
'invoice_id' => ['nullable', 'integer'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'status' => ['nullable', 'string', 'max:60'],
|
||||
'contact_method' => ['nullable', 'string', 'max:60'],
|
||||
'promise_to_pay_date' => ['nullable', 'date'],
|
||||
'promise_to_pay_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'next_follow_up_date' => ['nullable', 'date'],
|
||||
'escalation_level' => ['nullable', 'integer', 'min:0', 'max:10'],
|
||||
'note' => ['nullable', 'string', 'max:10000'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,19 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class InstallmentPlanRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'plan_name' => ['nullable','string','max:120'],
|
||||
'total_amount' => ['nullable','numeric','min:0'],
|
||||
'number_of_installments' => ['required','integer','min:1','max:24'],
|
||||
'first_due_date' => ['required','date'],
|
||||
'interval_months' => ['nullable','integer','min:1','max:12'],
|
||||
'plan_name' => ['nullable', 'string', 'max:120'],
|
||||
'total_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'number_of_installments' => ['required', 'integer', 'min:1', 'max:24'],
|
||||
'first_due_date' => ['required', 'date'],
|
||||
'interval_months' => ['nullable', 'integer', 'min:1', 'max:12'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,23 +6,27 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ParentPaymentFollowUpRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'school_year' => ['nullable','string','max:20'],
|
||||
'date_from' => ['nullable','date'],
|
||||
'date_to' => ['nullable','date'],
|
||||
'minimum_balance' => ['nullable','numeric','min:0'],
|
||||
'aging_bucket' => ['nullable','string','max:40'],
|
||||
'parent_id' => ['nullable','integer'],
|
||||
'student_id' => ['nullable','integer'],
|
||||
'follow_up_status' => ['nullable','string','max:60'],
|
||||
'last_contacted_before' => ['nullable','date'],
|
||||
'next_follow_up_due_before' => ['nullable','date'],
|
||||
'promise_to_pay_due_before' => ['nullable','date'],
|
||||
'include_paid_invoices' => ['nullable','boolean'],
|
||||
'include_inactive_students' => ['nullable','boolean'],
|
||||
'school_year' => ['nullable', 'string', 'max:20'],
|
||||
'date_from' => ['nullable', 'date'],
|
||||
'date_to' => ['nullable', 'date'],
|
||||
'minimum_balance' => ['nullable', 'numeric', 'min:0'],
|
||||
'aging_bucket' => ['nullable', 'string', 'max:40'],
|
||||
'parent_id' => ['nullable', 'integer'],
|
||||
'student_id' => ['nullable', 'integer'],
|
||||
'follow_up_status' => ['nullable', 'string', 'max:60'],
|
||||
'last_contacted_before' => ['nullable', 'date'],
|
||||
'next_follow_up_due_before' => ['nullable', 'date'],
|
||||
'promise_to_pay_due_before' => ['nullable', 'date'],
|
||||
'include_paid_invoices' => ['nullable', 'boolean'],
|
||||
'include_inactive_students' => ['nullable', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,17 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PaymentAllocationRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'installments' => ['nullable','array'],
|
||||
'installments.*.installment_id' => ['required_with:installments','integer'],
|
||||
'installments.*.amount' => ['required_with:installments','numeric','min:0.01'],
|
||||
'installments' => ['nullable', 'array'],
|
||||
'installments.*.installment_id' => ['required_with:installments', 'integer'],
|
||||
'installments.*.amount' => ['required_with:installments', 'numeric', 'min:0.01'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class IncidentStoreRequest extends ApiFormRequest
|
||||
return [
|
||||
'student_id' => ['required', 'integer', 'min:1', 'exists:students,id'],
|
||||
'grade' => ['required', 'string', 'max:50'],
|
||||
'incident' => ['required', 'string', 'in:' . implode(',', $incidentTypes)],
|
||||
'incident' => ['required', 'string', 'in:'.implode(',', $incidentTypes)],
|
||||
'description' => ['required', 'string', 'max:2000'],
|
||||
'incident_state' => ['nullable', 'string', 'in:Open,Closed,Canceled'],
|
||||
'state_description' => ['nullable', 'string', 'max:2000'],
|
||||
|
||||
@@ -30,7 +30,7 @@ class AdminListPromotionsRequest extends ApiFormRequest
|
||||
$status = $data['status'] ?? null;
|
||||
if (is_string($status) && $status !== '') {
|
||||
$status = [$status];
|
||||
} elseif (!is_array($status)) {
|
||||
} elseif (! is_array($status)) {
|
||||
$status = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ class ParentEnrollmentStepRequest extends ApiFormRequest
|
||||
$steps[$field] = (bool) $data[$field];
|
||||
}
|
||||
}
|
||||
|
||||
return $steps;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class PurchaseOrderStoreRequest extends ApiFormRequest
|
||||
return [
|
||||
'po_number' => ['required', 'string', 'max:60'],
|
||||
'supplier_id' => ['required', 'integer', 'min:1', 'exists:suppliers,id'],
|
||||
'status' => ['nullable', 'string', 'in:' . implode(',', PurchaseOrder::allowedStatuses())],
|
||||
'status' => ['nullable', 'string', 'in:'.implode(',', PurchaseOrder::allowedStatuses())],
|
||||
'order_date' => ['nullable', 'date'],
|
||||
'expected_date' => ['nullable', 'date', 'after_or_equal:order_date'],
|
||||
'notes' => ['nullable', 'string', 'max:5000'],
|
||||
|
||||
@@ -15,7 +15,7 @@ class RefundDecisionRequest extends ApiFormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => ['required', 'string', 'in:' . implode(',', [
|
||||
'status' => ['required', 'string', 'in:'.implode(',', [
|
||||
Refund::STATUS_APPROVED,
|
||||
Refund::STATUS_REJECTED,
|
||||
])],
|
||||
|
||||
@@ -15,7 +15,7 @@ class RefundIndexRequest extends ApiFormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => ['nullable', 'string', 'in:' . implode(',', [
|
||||
'status' => ['nullable', 'string', 'in:'.implode(',', [
|
||||
Refund::STATUS_PENDING,
|
||||
Refund::STATUS_APPROVED,
|
||||
Refund::STATUS_PARTIAL,
|
||||
|
||||
@@ -10,7 +10,7 @@ class StickerFormDataRequest extends ApiFormRequest
|
||||
{
|
||||
parent::prepareForValidation();
|
||||
|
||||
if (!$this->has('class_section_id') && $this->has('class_id')) {
|
||||
if (! $this->has('class_section_id') && $this->has('class_id')) {
|
||||
$this->merge(['class_section_id' => $this->input('class_id')]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class StickerPrintRequest extends ApiFormRequest
|
||||
{
|
||||
parent::prepareForValidation();
|
||||
|
||||
if (!$this->has('class_section_id') && $this->has('class_id')) {
|
||||
if (! $this->has('class_section_id') && $this->has('class_id')) {
|
||||
$this->merge(['class_section_id' => $this->input('class_id')]);
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class StickerPrintRequest extends ApiFormRequest
|
||||
$hasClass = $this->filled('class_section_id');
|
||||
$printAll = (bool) $this->input('print_all', false);
|
||||
|
||||
if (!$hasStudent && !$hasClass && !$printAll) {
|
||||
if (! $hasStudent && ! $hasClass && ! $printAll) {
|
||||
$validator->errors()->add('selection', 'Please select a student or class, or set print_all.');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ class StickerStudentsByClassRequest extends ApiFormRequest
|
||||
{
|
||||
parent::prepareForValidation();
|
||||
|
||||
if (!$this->has('class_section_id') && $this->has('class_id')) {
|
||||
if (! $this->has('class_section_id') && $this->has('class_id')) {
|
||||
$this->merge(['class_section_id' => $this->input('class_id')]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Requests\Roles;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class PermissionStoreRequest extends ApiFormRequest
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ class IpBanRequest extends ApiFormRequest
|
||||
$validator->after(function (Validator $validator) {
|
||||
$id = $this->input('id');
|
||||
$ip = $this->input('ip');
|
||||
if (!$id && !$ip) {
|
||||
if (! $id && ! $ip) {
|
||||
$validator->errors()->add('id', 'Either id or ip is required.');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class IpUnbanRequest extends ApiFormRequest
|
||||
$ip = $this->input('ip');
|
||||
$all = filter_var($this->input('all'), FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if (!$all && !$id && !$ip) {
|
||||
if (! $all && ! $id && ! $ip) {
|
||||
$validator->errors()->add('id', 'Either id, ip, or all=true is required.');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user