- upload recording of call in chunks - recordings are merged on server side in jobs - improve UI of the recording tab
47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Interview;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UploadRecordingChunkRequest 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, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'session_id' => ['required', 'string', 'max:255'],
|
|
'chunk_index' => ['required', 'integer', 'min:0'],
|
|
'is_final' => ['nullable', 'boolean'],
|
|
'total_chunks' => ['nullable', 'integer', 'min:0'],
|
|
'duration' => ['nullable', 'integer', 'min:0'],
|
|
'chunk' => ['nullable', 'file', 'max:25600'], // 25MB max per chunk
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom messages for validator errors.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'session_id.required' => 'A valid recording session identifier is required.',
|
|
'chunk_index.required' => 'Chunk index must be provided.',
|
|
];
|
|
}
|
|
}
|