feat: Implement Fast Request feature with file upload and request management
This commit is contained in:
@@ -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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user