<?php

namespace App\Http\Requests\Refunds;

use App\Http\Requests\ApiFormRequest;
use App\Models\Refund;

class RefundDecisionRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return $this->user() !== null;
    }

    public function rules(): array
    {
        return [
            'status' => ['required', 'string', 'in:' . implode(',', [
                Refund::STATUS_APPROVED,
                Refund::STATUS_REJECTED,
            ])],
            'reason' => ['required', 'string', 'max:2000'],
        ];
    }
}
