<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('service_points', function (Blueprint $table) {
            $table->id();
            $table->string('name', 100);
            $table->string('name_ar', 100);
            $table->enum('type', ['taxi', 'restaurant', 'gas']);
            $table->decimal('lat', 10, 8);
            $table->decimal('lng', 11, 8);
            $table->json('service_area')->nullable();
            $table->integer('service_radius');
            $table->text('address')->nullable();
            $table->text('description')->nullable();
            $table->json('contact_info')->nullable();
            $table->json('working_hours')->nullable();
            $table->boolean('is_active')->default(true);
            $table->foreignId('working_area_id')->constrained('working_areas')->onDelete('cascade');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('service_points');
    }
};
