schneespur/release/schneespur-1.0.2/app/Http/Requests/Driver/StoreManualJobRequest.php
Michael 7288b93500 Release v1.0.2: diagnostic infrastructure core
Add neutral diagnostic framework for future reporting modules:
- DiagnosticReporterInterface, Registry, Manager, PayloadSanitizer
- Laravel exception hook in bootstrap/app.php
- Module permission declarations (requires_permissions in module.json)
- Core diagnostic report points (module boot/install/update failures)
- Module documentation update (moduldoku.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 16:54:11 +00:00

46 lines
1.3 KiB
PHP

<?php
namespace App\Http\Requests\Driver;
use App\Enums\JobType;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreManualJobRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'customer_object_id' => ['required', 'exists:customer_objects,id'],
'type' => ['required', Rule::enum(JobType::class)],
'started_at' => ['required', 'date', 'before_or_equal:now'],
'ended_at' => ['required', 'date', 'after:started_at', 'before_or_equal:now'],
'notes' => ['nullable', 'string', 'max:1000'],
'vehicle_id' => ['nullable', 'exists:vehicles,id'],
];
}
/**
* @return array<string, string>
*/
public function attributes(): array
{
return [
'customer_object_id' => __('job.field_object'),
'type' => __('job.field_type'),
'started_at' => __('job.field_started_at'),
'ended_at' => __('job.field_ended_at'),
'notes' => __('job.field_notes'),
'vehicle_id' => __('job.field_vehicle'),
];
}
}