feat: Implement Fast Request feature with file upload and request management

This commit is contained in:
2026-08-26 17:40:45 +03:30
parent ba734679cf
commit 2d96978c38
33 changed files with 1294 additions and 852 deletions
@@ -0,0 +1,41 @@
<?php
namespace App\Http\Requests\Client;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use App\Enums\DocumentModalityEnum;
use App\Enums\DocumentPriorityEnum;
use App\Enums\PetGenderEnum;
use App\Enums\PetTypeEnum;
class FastRequestRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'modality' => ['required', 'string', Rule::in(DocumentModalityEnum::values())],
'priority' => ['required', 'string', Rule::in(DocumentPriorityEnum::keys())],
'note' => ['nullable', 'string', 'max:1000'],
'pet_id' => ['nullable', 'exists:pets,id'],
'pet' => ['required_without:pet_id', 'array'],
'pet.name' => ['required_without:pet_id', 'nullable', 'string', 'max:255'],
'pet.type' => ['required_without:pet_id', 'nullable', 'string', Rule::in(PetTypeEnum::keys())],
'pet.gender' => ['nullable', 'string', Rule::in(PetGenderEnum::keys())],
'pet.breed' => ['nullable', 'string', 'max:255'],
'pet.age' => ['nullable', 'numeric', 'min:0', 'max:100'],
'pet.weight' => ['nullable', 'numeric', 'min:0', 'max:1000'],
'pet.sterilized' => ['nullable', 'boolean'],
'doctor_id' => ['nullable', 'exists:users,id'],
'history_files' => ['nullable', 'array'],
'history_files.*' => ['file', 'image', 'max:10240'],
'scan_files' => ['nullable', 'array'],
'scan_files.*' => ['file', 'image', 'max:10240'],
];
}
}