TenantAtlas/apps/platform/app/Support/Operations/Reconciliation/OperationRunReconciliationRegistry.php
ahmido 548a37c888 feat: implement sync capture backup operation semantics (#433)
Implemented sync capture backup operation semantics as requested.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #433
2026-06-07 01:19:08 +00:00

62 lines
2.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Support\Operations\Reconciliation;
final class OperationRunReconciliationRegistry
{
public function __construct(
private readonly RestoreExecuteReconciliationAdapter $restoreExecuteAdapter,
private readonly EnvironmentReviewComposeReconciliationAdapter $environmentReviewComposeAdapter,
private readonly EvidenceSnapshotReconciliationAdapter $evidenceSnapshotAdapter,
private readonly ReviewPackArtifactReconciliationAdapter $reviewPackAdapter,
private readonly InventorySyncReconciliationAdapter $inventorySyncAdapter,
private readonly BaselineCaptureReconciliationAdapter $baselineCaptureAdapter,
private readonly BackupScheduleExecutionReconciliationAdapter $backupScheduleExecutionAdapter,
) {}
/**
* @return array<int, OperationRunReconciliationAdapter>
*/
public function all(): array
{
return [
$this->restoreExecuteAdapter,
$this->environmentReviewComposeAdapter,
$this->evidenceSnapshotAdapter,
$this->reviewPackAdapter,
$this->inventorySyncAdapter,
$this->baselineCaptureAdapter,
$this->backupScheduleExecutionAdapter,
];
}
/**
* @return array<int, string>
*/
public function supportedTypes(): array
{
return array_values(array_unique(array_merge(
$this->restoreExecuteAdapter->supportedTypes(),
$this->environmentReviewComposeAdapter->supportedTypes(),
$this->evidenceSnapshotAdapter->supportedTypes(),
$this->reviewPackAdapter->supportedTypes(),
$this->inventorySyncAdapter->supportedTypes(),
$this->baselineCaptureAdapter->supportedTypes(),
$this->backupScheduleExecutionAdapter->supportedTypes(),
)));
}
public function forType(string $type): ?OperationRunReconciliationAdapter
{
foreach ($this->all() as $adapter) {
if ($adapter->supportsType($type)) {
return $adapter;
}
}
return null;
}
}