- Add resume file upload to schedule drawer with instant preview and validation - Create resume lightbox modal viewer with background scroll lock and CV SVG icon - Integrate CV tab into inspector panel with enlarge action and state - Attach candidate resume to panelist notification emails when - Fix Outlook RFC 5546 iTIP element mismatch and add table credentials copy button
63 lines
2.4 KiB
PHP
63 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Interview;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreInterviewRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'candidate_name' => ['required', 'string', 'max:255'],
|
|
'candidate_email' => ['required', 'email', 'max:255'],
|
|
'candidate_phone' => ['required', 'string', 'max:50'],
|
|
'job_title' => ['required', 'string', 'max:255'],
|
|
'round' => ['nullable', 'string', 'max:100'],
|
|
'description' => ['nullable', 'string', 'max:2000'],
|
|
'scheduled_at' => ['nullable', 'date'],
|
|
'valid_hours' => ['required', 'integer', 'min:1', 'max:72'],
|
|
'language' => ['required', 'string', 'in:python,cpp,c,java,php,javascript'],
|
|
'resume' => ['nullable', 'file', 'mimes:pdf,doc,docx', 'max:10240'],
|
|
'assigned_interviewers' => ['nullable', 'array'],
|
|
'assigned_interviewers.*' => ['integer', 'exists:users,id'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom messages for validator errors.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'candidate_name.required' => 'The candidate name is required.',
|
|
'candidate_email.required' => 'The candidate email address is required.',
|
|
'candidate_email.email' => 'Please provide a valid candidate email address.',
|
|
'candidate_phone.required' => 'The candidate phone number is required.',
|
|
'job_title.required' => 'The job title / position is required.',
|
|
'valid_hours.required' => 'Access duration is required.',
|
|
'language.required' => 'Coding language selection is required.',
|
|
'language.in' => 'Selected coding language is not supported.',
|
|
'resume.mimes' => 'The candidate resume must be a PDF or Word document (.pdf, .doc, .docx).',
|
|
'resume.max' => 'The candidate resume size must not exceed 10MB.',
|
|
'assigned_interviewers.*.exists' => 'One or more selected interviewers are invalid.',
|
|
];
|
|
}
|
|
}
|