<?php

namespace Database\Seeders;

use App\Contracts\InstalledModuleRepositoryContract;
use App\Enums\ModuleStatus;
use Illuminate\Database\Seeder;

class ModuleRegistrationSeeder extends Seeder
{
    public function run(): void
    {
        $repository = app(InstalledModuleRepositoryContract::class);

        if ($repository->findByModuleUuid('a1b2c3d4-e5f6-7890-abcd-ef1234567890')) {
            return;
        }

        $repository->create([
            'module_uuid' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
            'name' => 'Finance',
            'version' => '1.0.0',
            'status' => ModuleStatus::Installed,
            'installed_at' => now(),
        ]);
    }
}
