<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class TvShowRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            'title' => 'required|string|max:191',
            'slug' => 'required|string|max:191',
            'seo_title' => 'nullable|string|max:191',
            'rating' => 'nullable|integer|max:10',
            'release_date' => 'required|date',
            'country' => 'required|array',
            'country.*' => 'required',
            'genre' => 'required|array',
            'genre.*' => 'required',
            'actor' => 'required|array',
            'actor.*' => 'required',
            'director' => 'required|array',
            'director.*' => 'required',
            'writer' => 'required|array',
            'writer.*' => 'required',
            'video_type' => 'required|string|max:50',
            'video_quality' => 'required|string|max:50',
            'runtime' => 'required|integer|min:1|max:9999',
            'language' => 'required|array',
            'language.*' => 'integer|max:20',
            'imdb_rating' => 'nullable|numeric|between:0,10',
            'thumbnail' => 'nullable|mimes:jpg,JPG,JPEG,jpeg,png,PNG,webp,WEBP|max:20480',
            'poster' => 'nullable|mimes:jpg,JPG,JPEG,jpeg,png,PNG,webp,WEBP|max:20480',
        ];
    }
}
