<?php

namespace App\Http\Requests\Admin\TopUp;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'merchant_code' => 'required|string|max:100',
            'api_key' => 'required|string|max:255',
            'payment_method' => 'required|string|max:50',
            'production_mode' => 'required|boolean',
            'gold_rate' => 'required|integer|min:1|max:1000000',
            'min_amount' => 'required|integer|min:1000|max:1000000',
            'max_amount' => 'required|integer|min:10000|max:100000000',
            'is_active' => 'required|boolean',
        ];
    }

    public function messages(): array
    {
        return [
            'merchant_code.required' => 'Merchant Code harus diisi.',
            'api_key.required' => 'API Key harus diisi.',
            'payment_method.required' => 'Metode pembayaran harus dipilih.',
            'gold_rate.min' => 'Gold rate minimal 1.',
            'min_amount.min' => 'Minimal amount harus minimal Rp 1.000.',
            'max_amount.min' => 'Maksimal amount harus minimal Rp 10.000.',
        ];
    }
}
