25 lines
665 B
PHP
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() ?? [];
|
|
}
|
|
}
|