<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

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

    public function rules(): array
    {
        return [
            'type' => ['required', Rule::in(['prepayment', 'full_payment', 'refund'])],
            'amount' => ['required', 'numeric', 'min:0.01'],
            'channel' => ['nullable', 'string', 'max:30'],
            'note' => ['nullable', 'string', 'max:2000'],
        ];
    }

    public function attributes(): array
    {
        return [
            'type' => 'тип платежа',
            'amount' => 'сумма',
            'channel' => 'канал',
            'note' => 'комментарий',
        ];
    }
}
