<?php

namespace Database\Seeders;

use App\Enums\UserTypeEnum;
use App\Models\User;
use Illuminate\Database\Seeder;

class UserSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        $users = [
            [
                'name'     => 'Suporte',
                'email'    => 'suporte@softpar.inf.br',
                'password' => 'S@ft2080.',
                'type'     => UserTypeEnum::ADMIN,
            ],
            [
                'name'     => 'Usuário Teste',
                'email'    => 'usuario.teste@softpar.inf.br',
                'password' => 'S@ft2080.',
                'type'     => UserTypeEnum::USER,
            ],
            [
                'name'     => 'Prestador Teste',
                'email'    => 'prestador.teste@softpar.inf.br',
                'password' => 'S@ft2080.',
                'type'     => UserTypeEnum::PROVIDER,
            ],
            [
                'name'     => 'Cliente Teste',
                'email'    => 'cliente.teste@softpar.inf.br',
                'password' => 'S@ft2080.',
                'type'     => UserTypeEnum::CLIENT,
            ],
            [
                'name'     => 'Diaria',
                'email'    => 'diaria@diaria.inf.br',
                'password' => 'Diaria2026',
                'type'     => UserTypeEnum::ADMIN,
            ],
        ];

        foreach ($users as $userData) {
            User::updateOrCreate(
                ['email' => $userData['email']],
                $userData
            );
        }
    }
}
