<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'payment_method'           => ['required', 'in:credit_card,pix'],
            'client_payment_method_id' => ['nullable', 'integer', 'exists:client_payment_methods,id'],
            'card_id'                  => ['nullable', 'string', 'max:255'],
            'phone'                    => ['nullable', 'string', 'max:20'],
        ];
    }
}
