feat(10-02): add GraphDirectoryUser model and IGraphUserDirectoryService interface
- GraphDirectoryUser positional record with DisplayName, UPN, Mail, Department, JobTitle - IGraphUserDirectoryService.GetUsersAsync with clientId, IProgress<int>?, CancellationToken - Follows existing GraphUserSearchService namespace pattern
This commit is contained in:
12
SharepointToolbox/Core/Models/GraphDirectoryUser.cs
Normal file
12
SharepointToolbox/Core/Models/GraphDirectoryUser.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SharepointToolbox.Core.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a directory user returned by <see cref="SharepointToolbox.Services.IGraphUserDirectoryService"/>.
|
||||
/// Used by Phase 13's User Directory ViewModel to display and filter tenant members.
|
||||
/// </summary>
|
||||
public record GraphDirectoryUser(
|
||||
string DisplayName,
|
||||
string UserPrincipalName,
|
||||
string? Mail,
|
||||
string? Department,
|
||||
string? JobTitle);
|
||||
26
SharepointToolbox/Services/IGraphUserDirectoryService.cs
Normal file
26
SharepointToolbox/Services/IGraphUserDirectoryService.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using SharepointToolbox.Core.Models;
|
||||
|
||||
namespace SharepointToolbox.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Enumerates all enabled member users from a tenant via Microsoft Graph.
|
||||
/// Used by Phase 13's User Directory ViewModel to populate the browse grid.
|
||||
/// </summary>
|
||||
public interface IGraphUserDirectoryService
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns all enabled member users in the tenant associated with <paramref name="clientId"/>.
|
||||
/// Iterates through all pages using the Graph SDK PageIterator until exhausted or cancelled.
|
||||
/// </summary>
|
||||
/// <param name="clientId">The client/tenant identifier used to obtain a Graph token.</param>
|
||||
/// <param name="progress">
|
||||
/// Optional progress reporter — receives the running count of users fetched so far.
|
||||
/// Phase 13's ViewModel uses this to show "Loading... X users" feedback.
|
||||
/// Pass <c>null</c> for no progress reporting.
|
||||
/// </param>
|
||||
/// <param name="ct">Cancellation token. Iteration stops when cancelled.</param>
|
||||
Task<IReadOnlyList<GraphDirectoryUser>> GetUsersAsync(
|
||||
string clientId,
|
||||
IProgress<int>? progress = null,
|
||||
CancellationToken ct = default);
|
||||
}
|
||||
Reference in New Issue
Block a user