<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'user_id' => ['required', 'integer', 'exists:users,id'],
            'server_resource_id' => ['required', 'integer', 'exists:server_resources,id'],
            'bastion_account_id' => ['nullable', 'integer', 'exists:bastion_accounts,id'],
            'protocol' => ['required', 'string', 'in:SSH,SFTP,RDP'],
            'action' => ['required', 'string', 'max:64'],
            'requested_at' => ['required', 'date'],
            'metadata' => ['nullable', 'array'],
        ];
    }
}
