29 lines
952 B
PHP
29 lines
952 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\TenantConfiguration\ResourceTypeRegistry;
|
|
use App\Services\TenantConfiguration\SupportedScopeResolver;
|
|
use Illuminate\Console\Command;
|
|
|
|
final class TenantConfigurationSyncDefaults extends Command
|
|
{
|
|
protected $signature = 'tenant-configuration:sync-defaults';
|
|
|
|
protected $description = 'Synchronize Coverage v2 resource type and supported scope defaults.';
|
|
|
|
public function handle(ResourceTypeRegistry $resourceTypes, SupportedScopeResolver $supportedScopes): int
|
|
{
|
|
$resourceTypes->syncDefaults();
|
|
$supportedScopes->syncDefaults();
|
|
|
|
$this->info('Tenant configuration defaults synchronized.');
|
|
$this->line(sprintf('Active resource types: %d', $resourceTypes->active()->count()));
|
|
$this->line(sprintf('Active supported scopes: %d', $supportedScopes->activeScopes()->count()));
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|