namespace ItWorx.KnowledgeHub.Application.Infrastructure.UseCases; public sealed class GetInfrastructureOverviewUseCase(IInfrastructureRepository infrastructure) { public Task ExecuteAsync(Guid workspaceId, CancellationToken cancellationToken) => infrastructure.GetOverviewAsync(workspaceId, cancellationToken); } /// Unpaginated full-graph listing — reserved for the curated-import matcher /// (see 's own doc comment). /// Not used by any HTTP endpoint since V2-R2; kept for that one internal caller. /// public sealed class ListInfrastructureServicesUseCase(IInfrastructureRepository infrastructure) { public Task> ExecuteAsync( Guid workspaceId, bool includeHidden, CancellationToken cancellationToken) => infrastructure.ListServicesAsync(workspaceId, includeHidden, cancellationToken); } /// Cursor-paginated, summary-only catalog listing (V2-R2, /// docs/adr/ADR-026-v2-r2-infrastructure-scale-and-sync-durability.md) — what /// `GET /infrastructure/services` actually uses now. public sealed class ListInfrastructureServiceSummariesUseCase(IInfrastructureRepository infrastructure) { public Task ExecuteAsync( Guid workspaceId, bool includeHidden, Guid? projectId, string? search, string? status, string? cursor, int limit, CancellationToken cancellationToken) => infrastructure.ListServiceSummariesAsync( workspaceId, includeHidden, projectId, search, Enum.TryParse(status, true, out var parsedStatus) ? parsedStatus : null, cursor, limit, cancellationToken); } /// Cursor-paginated, lean-projected storage listing (V2-R2 fields, V2-R5 /// pagination) — what `GET /infrastructure/storage` actually uses now. public sealed class ListInfrastructureVolumesUseCase(IInfrastructureRepository infrastructure) { public Task ExecuteAsync( Guid workspaceId, string? search, string? cursor, int limit, CancellationToken cancellationToken) => infrastructure.ListVolumesAsync(workspaceId, search, cursor, limit, cancellationToken); } public sealed class GetInfrastructureServiceUseCase(IInfrastructureRepository infrastructure) { public Task ExecuteAsync( Guid workspaceId, Guid serviceId, CancellationToken cancellationToken) => infrastructure.GetServiceAsync(workspaceId, serviceId, cancellationToken); } public sealed class ListInfrastructureChangesUseCase(IInfrastructureRepository infrastructure) { public Task> ExecuteAsync( Guid workspaceId, int limit, CancellationToken cancellationToken) => infrastructure.ListChangesAsync(workspaceId, Math.Clamp(limit, 1, 500), cancellationToken); }