TenantAtlas/app/Support/Providers/ProviderNextStepsRegistry.php
2026-03-22 21:18:37 +01:00

25 lines
665 B
PHP

<?php
namespace App\Support\Providers;
use App\Models\ProviderConnection;
use App\Models\Tenant;
use App\Support\ReasonTranslation\ReasonPresenter;
final class ProviderNextStepsRegistry
{
public function __construct(
private readonly ReasonPresenter $reasonPresenter,
) {}
/**
* @return array<int, array{label: string, url: string}>
*/
public function forReason(Tenant $tenant, string $reasonCode, ?ProviderConnection $connection = null): array
{
$envelope = $this->reasonPresenter->forProviderReason($tenant, $reasonCode, $connection, 'helper_copy');
return $envelope?->toLegacyNextSteps() ?? [];
}
}