<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

    // Hotel Data
    use App\Models\Hotel\Status;

    use App\Models\Hotel\Regimen;
    use App\Models\Hotel\Room;
    use App\Models\Hotel\RoomGroup;
    use App\Models\Hotel\RoomType;
    use App\Models\Hotel\Season;
    use App\Models\Hotel\Source;

    use App\Models\Environment\Business;
    use App\Models\Environment\PaymentMethod;
    use App\Models\Modules\Shift;

    // Enums
    use App\Enums\Hotel\CycleType;

class FullSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        //* Control Data
            // Status / Estados de Actividad
                Status::create([ //? 1
                    'status_name' => 'Confirmado',
                    'status_type' => 'Creation',
                ]);
                Status::create([ //? 2
                    'status_name' => 'No confirmado',
                    'status_type' => 'Creation',
                ]);
                Status::create([ //? 3
                    'status_name' => 'Ninguno',
                    'status_type' => 'Guest',
                ]);
                Status::create([ //? 4
                    'status_name' => 'Check-in',
                    'status_type' => 'Guest',
                ]);
                Status::create([ //? 5
                    'status_name' => 'No se presenta', // No show
                    'status_type' => 'Guest',
                ]);
                Status::create([ //? 6
                    'status_name' => 'Check-out',
                    'status_type' => 'Guest',
                ]);

        //* Hotel Data
            // Regímenes
                Regimen::create([
                    'regimen_name'=> 'Ninguno',
                    'regimen_code'=> 'NG',
                    'regimen_status'=> 'SI',
                ]);

            // Grupo de Habitaciones
                RoomGroup::create([
                    'name' => 'Unassigned',
                    'color' => '#5c5c5c',
                ]);
                RoomGroup::create([
                    'name' => 'Default',
                    'color' => '#800040',
                ]);

            // Tipos de Habitación
                RoomType::create([ //?4     	-> 1
                    'tr_name' => 'Overbooked',
                ]);
                RoomType::create([ //?5     	-> 2
                    'tr_name' => 'Unassigned',
                ]);
                RoomType::create([
                    'tr_name' => 'Estándar',
                ]);

            // Habitaciones
                Room::create([
                    'room_name' => 'Unassigned',
                    'roomType_id' => '2',
                    'room_status' => 'Disponible',
                    'room_floor' => '0',
                    'room_group_id' => '1',
                ]);

            // Temporadas
                $default_season_data = [
                    'periods' => [[
                        'from' => [ "month" => 1, "day" => 1 ],
                        'to' => [ "month" => 12, "day" => 31 ],
                    ]],
                ];

                Season::create([
                    's_name' => 'Temporada Única',
                    'is_cyclic' => true,
                    'cycle_type'   => CycleType::CUSTOM,
                    's_periods' => $default_season_data,
                ]);

            // Fuentes de Reserva
                Source::create([
                    'source_name' => 'Ninguno',
                ]);
                Source::create([
                    'source_name' => 'Amigos',
                ]);
                Source::create([
                    'source_name' => 'Agencia',
                ]);
                Source::create([
                    'source_name' => 'Familiar',
                ]);
                Source::create([
                    'source_name' => 'Redes sociales',
                ]);

        //* Settings Data
            // Negocios
                Business::create([
                    'business_name' => 'José Ramírez',
                    'business_phone' => '000-000-0000',
                    'business_address' => 'N/A',

                    'facturapi_account_id' => "698a3a02c2a3e706cdf02020", // Solo para hoteles dados de alta frente al SAT
                ]);


            // Métodos de Pago
                PaymentMethod::create([
                    'method_name'=> 'Depósito Bancario',
                ]);
                PaymentMethod::create([
                    'method_name'=> 'Paypal',
                ]);
                PaymentMethod::create([
                    'method_name'=> 'Efectivo',
                ]);
                PaymentMethod::create([
                    'method_name'=> 'Tarjeta de Crédito',
                ]);

        //* Special Modules
            // Turnos de Trabajo
                Shift::create([
                    'name'=> 'Full Time',
                    'work_starts_at'=> '00:01:00',
                    'work_ends_at'=> '23:59:00',
                ]);
    }
}
