<?php

namespace App\Http\Resources;

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

class OutletResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'uuid' => $this->uuid,
            'name' => $this->name,
            'email' => $this->email,
            'phone_number' => $this->phone_number,
            'full_address' => $this->full_address,
            'latitude' => (float) $this->latitude,
            'longitude' => (float) $this->longitude,
            'server_photo_url' => $this->server_photo_url,
            'server_banner_url' => $this->server_banner_url,
            'is_main_outlet' => (bool) $this->is_main_outlet,
            'is_active' => (bool) $this->is_active,
            'created_at' => $this->created_at?->toIso8601String(),
            'updated_at' => $this->updated_at?->toIso8601String(),
        ];
    }
}
