<?php

namespace App\Http\Requests\Dashboard\Partner;

use Illuminate\Foundation\Http\FormRequest;

class Store extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name_uz' => 'required|string',
            'name_ru' => 'required|string',
            'image' => 'required|image',
            'status' => 'required|in:published,new,soon',
            'video_url' => 'nullable|url',
            'description_uz' => 'required|string',
            'description_ru' => 'required|string',
            'position' => 'required|integer',
            'is_price' => 'nullable|boolean',
        ];
    }

    /**
     * @return array
     */
    public function getName(): array
    {
        return [
            'uz' => $this->get('name_uz'),
            'ru' => $this->get('name_ru')
        ];
    }

    public function getDescription(): array|null
    {
        return [
            'uz' => $this->get('description_uz'),
            'ru' => $this->get('description_ru')
        ];
    }
}
