using Microsoft.SharePoint.Client;
using SharepointToolbox.Core.Helpers;
using SharepointToolbox.Core.Models;

namespace SharepointToolbox.Services;

/// <summary>
/// Resolves the targeted resource (List, Web, File, Folder) for a SharePoint system
/// group whose name encodes a GUID — Limited Access System Group For Web/List and
/// SharingLinks.{itemId}.{type}.{shareId}. Returns null when the target is missing
/// or unreachable (deleted item, access denied, etc.) — callers fall back to the
/// raw group name.
/// </summary>
public interface ISystemGroupTargetResolver
{
    /// <summary>
    /// Resolves the target for a classified system group. Cached per (ctx site, guid).
    /// </summary>
    Task<SystemGroupTarget?> ResolveAsync(
        ClientContext ctx,
        SystemGroupClassification classification,
        CancellationToken ct);
}
