<?php

namespace App\Http\Requests\V1\Subscription;

use App\Models\Tenants\DataExport;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class ExportStoreRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'export_type' => ['required', 'string', Rule::in(DataExport::TYPES)],
            'options' => ['nullable', 'array'],
            'options.format' => ['nullable', 'string', Rule::in(['xlsx', 'csv', 'json'])],
            'options.include_deleted' => ['nullable', 'boolean'],
        ];
    }

    public function attributes(): array
    {
        return [
            'export_type' => __('field.export_type'),
            'options' => __('field.options'),
        ];
    }
}
