<?php

namespace Database\Seeders\Modules;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Config;

use Database\Seeders\Traits\Upsertable;

use App\Models\Modules\OtaConnections\OTAConnection;

class OTAConnectionSeeder extends Seeder
{
    use Upsertable;

    /**
     * Run the database seeds.
     */
    public function run(): void
    {
      //* Control Data
        $file_name = "OTAConnectionSeeder";
        $baseUrl = rtrim(Config::get('app.url'), '/');

      //* Data to Seed per Entities
        $otas = [
            [
                'url_image'   => "{$baseUrl}/logos/booking_logo.png",
                'name'        => 'Booking.com',
                'sample_name' => 'booking',
            ],
            // [
            //     'url_image'   => "{$baseUrl}/logos/expedia_logo.png",
            //     'name'        => 'Expedia',
            //     'sample_name' => 'expedia',
            // ],
            // [
            //     'url_image'   => "{$baseUrl}/logos/despegar_logo.png",
            //     'name'        => 'Despegar',
            //     'sample_name' => 'despegar',
            // ],
        ];

      //* Seed Data
        $this->upsertData($file_name, OTAConnection::class, 'sample_name', $otas);
    }
}
