<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class LocationResource extends JsonResource
{
    /**
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'nome' => $this->nome,
            'endereco' => $this->endereco,
            'cidade' => $this->cidade,
            'latitude' => (float) $this->latitude,
            'longitude' => (float) $this->longitude,
            'ativo' => (bool) $this->ativo,
        ];
    }
}
