<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'gateway' => 'required|string|in:stripe,paypal,square',
            'amount' => 'required|numeric|min:0.5|max:999999.99',
            'currency' => 'nullable|string|in:USD,EUR,GBP,CAD,AUD',
            'source_id' => 'required_if:gateway,square|string|nullable',
            'location_id' => 'nullable|string|max:64',
        ];
    }
}
