<?php

namespace App\Http\Requests\Topology;

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

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

    public function rules(): array
    {
        return [
            'customer_id' => ['required', 'integer', 'exists:customers,id'],
            'odp_node_id' => ['required', 'integer', 'exists:topology_nodes,id'],
            'odp_port_id' => ['nullable', 'integer', 'exists:topology_ports,id'],
            'drop_cable_link_id' => ['nullable', 'integer', 'exists:topology_links,id'],
            'connected_at' => ['nullable', 'date'],
            'status' => ['nullable', Rule::in(['active', 'inactive'])],
            'metadata' => ['nullable', 'array'],
        ];
    }
}
