<?php

namespace Database\Seeders;

use App\Domains\Integration\Models\Integration;
use Illuminate\Database\Seeder;

class EmailIntegrationSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        Integration::updateOrCreate(
            ['integration_code' => 'email'],
            [
                'name' => 'Email',
                'url' => null,
                'requires_client_configuration' => false,
                'integration_data_schema' => [
                    'MAIL_MAILER' => 'required|string|in:smtp',
                    'MAIL_SCHEME' => 'required|string|in:smtp',
                    'MAIL_HOST' => 'required|string',
                    'MAIL_PORT' => 'required|integer|in:587',
                    'MAIL_USERNAME' => 'required|email',
                    'MAIL_PASSWORD' => 'required|string',
                    'MAIL_FROM_ADDRESS' => 'required|email',
                    'MAIL_FROM_NAME' => 'nullable|string|max:255',
                ],
            ]
        );
    }
}
