using Microsoft.SharePoint.Client;
using SharepointToolbox.Core.Models;
namespace SharepointToolbox.Services;
public interface IStorageService
{
///
/// Collects storage metrics for a site, capturing every storage source
/// SharePoint reports (visible + hidden libraries, Preservation Hold,
/// list attachments, recycle bin, and optionally subsites). Each
/// carries a so
/// callers can filter what appears in the report.
///
Task> CollectStorageAsync(
ClientContext ctx,
StorageScanOptions options,
IProgress progress,
CancellationToken ct);
///
/// Enumerates files across all non-hidden document libraries in the site
/// and aggregates storage consumption grouped by file extension.
///
Task> CollectFileTypeMetricsAsync(
ClientContext ctx,
IProgress progress,
CancellationToken ct);
///
/// Backfills StorageNodes that have zero TotalFileCount/TotalSizeBytes
/// by enumerating files per library via CamlQuery. Only re-runs against
/// document-library kinds (Library, HiddenLibrary, PreservationHold).
///
Task BackfillZeroNodesAsync(
ClientContext ctx,
IReadOnlyList nodes,
IProgress progress,
CancellationToken ct);
///
/// Returns the SharePoint-reported total storage usage for the site
/// (Site.Usage.Storage). This includes everything that counts toward
/// the site quota — recycle bin, version history, hidden libraries,
/// list attachments — and serves as the ground-truth reference total.
/// Returns 0 if the call is denied or the property is unavailable.
///
Task GetSiteUsageStorageBytesAsync(
ClientContext ctx,
IProgress progress,
CancellationToken ct);
}