From 8a6ccba0af2793350f21645bc5cd5ba8a9859159 Mon Sep 17 00:00:00 2001 From: Nikola Cirkovic Date: Mon, 23 May 2022 01:32:31 +0200 Subject: [PATCH] INA-5 | Update Schedule |Create Scheduler | Update Scheduled Job requests --- .../CreateScheduledTaskRequest.php | 1 - .../TaskScheduler/UpdateScheduleRequest.php | 41 +++++++++++++++++++ .../UpdateScheduledJobRequest.php | 28 +++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 app/Http/Requests/TaskScheduler/UpdateScheduleRequest.php create mode 100644 app/Http/Requests/TaskScheduler/UpdateScheduledJobRequest.php diff --git a/app/Http/Requests/TaskScheduler/CreateScheduledTaskRequest.php b/app/Http/Requests/TaskScheduler/CreateScheduledTaskRequest.php index 1f3ef03682..1e86810eb5 100644 --- a/app/Http/Requests/TaskScheduler/CreateScheduledTaskRequest.php +++ b/app/Http/Requests/TaskScheduler/CreateScheduledTaskRequest.php @@ -26,7 +26,6 @@ class CreateScheduledTaskRequest extends Request 'repeat_every' => 'required|string|in:DAY,WEEK,MONTH,3MONTHS,YEAR', 'start_from' => 'sometimes|string', 'job' => 'required', - ]; } } diff --git a/app/Http/Requests/TaskScheduler/UpdateScheduleRequest.php b/app/Http/Requests/TaskScheduler/UpdateScheduleRequest.php new file mode 100644 index 0000000000..28e9cf4731 --- /dev/null +++ b/app/Http/Requests/TaskScheduler/UpdateScheduleRequest.php @@ -0,0 +1,41 @@ +user()->isAdmin(); + } + + public function rules(): array + { + return [ + 'paused' => 'sometimes|bool', + 'archived' => 'sometimes|bool', + 'repeat_every' => 'sometimes|string|in:DAY,WEEK,MONTH,3MONTHS,YEAR', + 'start_from' => 'sometimes|string', + 'job' => 'sometimes|string', + ]; + } +} diff --git a/app/Http/Requests/TaskScheduler/UpdateScheduledJobRequest.php b/app/Http/Requests/TaskScheduler/UpdateScheduledJobRequest.php new file mode 100644 index 0000000000..96e3ec47bb --- /dev/null +++ b/app/Http/Requests/TaskScheduler/UpdateScheduledJobRequest.php @@ -0,0 +1,28 @@ +user()->isAdmin(); + } + + public function rules(): array + { + return [ + 'action_name' => 'sometimes|string', + ]; + } +}