Перевод на DDD
This commit is contained in:
27
app/Infrastructure/Http/Requests/CreateDutyReportRequest.php
Normal file
27
app/Infrastructure/Http/Requests/CreateDutyReportRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Infrastructure\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateDutyReportRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'period_start' => ['required', 'date'],
|
||||
'period_end' => ['required', 'date', 'after_or_equal:period_start'],
|
||||
'period_type' => ['nullable', 'string', 'in:day,week,month'],
|
||||
'status_id' => ['nullable', 'integer', 'in:1,2,3'],
|
||||
'observables' => ['nullable', 'array'],
|
||||
'observables.*.id' => ['required', 'integer'],
|
||||
'unwanted_events' => ['nullable', 'array'],
|
||||
'unwanted_events.*.title' => ['required', 'string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user