<?php

namespace App\Http\Requests;

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

class SubmitPaymentProofRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('billing.manage');
    }

    public function rules(): array
    {
        return [
            'gateway' => ['required', Rule::in(['zaincash', 'superqi'])],
            'period_months' => ['required', 'integer', 'min:1', 'max:12'],
            'proof' => ['required', 'file', 'mimes:jpg,jpeg,png,pdf', 'max:10240'],
            'proof_reference' => ['required', 'string', 'max:120'],
        ];
    }
}
