<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class TeleRecordStoreRequest extends FormRequest
{
    public function authorize(): bool { return auth()->check(); }

    public function rules(): array
    {
        return [
            'name'       => ['required','string','min:2','max:150'],
            'outlet_id'  => ['required','exists:outlets,id'],
            'record_no'  => ['nullable','string','max:50'],
            'phone'      => ['nullable','string','max:20'],
            'called_at'  => ['nullable','date'],
            'audio'      => ['nullable','file','mimetypes:audio/mpeg,audio/mp3,audio/x-m4a,audio/mp4,audio/wav,audio/x-wav,audio/ogg','max:20480'], // <=20MB
            'notes'      => ['nullable','string','max:500'],
        ];
    }
}
