mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
INA-5 | Update Schedule |Create Scheduler | Update Scheduled Job requests
This commit is contained in:
parent
041f85291a
commit
8a6ccba0af
@ -26,7 +26,6 @@ class CreateScheduledTaskRequest extends Request
|
||||
'repeat_every' => 'required|string|in:DAY,WEEK,MONTH,3MONTHS,YEAR',
|
||||
'start_from' => 'sometimes|string',
|
||||
'job' => 'required',
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
41
app/Http/Requests/TaskScheduler/UpdateScheduleRequest.php
Normal file
41
app/Http/Requests/TaskScheduler/UpdateScheduleRequest.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Requests\TaskScheduler;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\ScheduledJob;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateScheduleRequest extends Request
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->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',
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Requests\TaskScheduler;
|
||||
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class UpdateScheduledJobRequest extends Request
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->user()->isAdmin();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'action_name' => 'sometimes|string',
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user