From 5e56a96cd0889a5a2a82219aaf77e68e29f5500c Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 8 Apr 2026 12:29:19 +0200 Subject: [PATCH] feat(10-02): add GraphDirectoryUser model and IGraphUserDirectoryService interface - GraphDirectoryUser positional record with DisplayName, UPN, Mail, Department, JobTitle - IGraphUserDirectoryService.GetUsersAsync with clientId, IProgress?, CancellationToken - Follows existing GraphUserSearchService namespace pattern --- .../Core/Models/GraphDirectoryUser.cs | 12 +++++++++ .../Services/IGraphUserDirectoryService.cs | 26 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 SharepointToolbox/Core/Models/GraphDirectoryUser.cs create mode 100644 SharepointToolbox/Services/IGraphUserDirectoryService.cs diff --git a/SharepointToolbox/Core/Models/GraphDirectoryUser.cs b/SharepointToolbox/Core/Models/GraphDirectoryUser.cs new file mode 100644 index 0000000..839840a --- /dev/null +++ b/SharepointToolbox/Core/Models/GraphDirectoryUser.cs @@ -0,0 +1,12 @@ +namespace SharepointToolbox.Core.Models; + +/// +/// Represents a directory user returned by . +/// Used by Phase 13's User Directory ViewModel to display and filter tenant members. +/// +public record GraphDirectoryUser( + string DisplayName, + string UserPrincipalName, + string? Mail, + string? Department, + string? JobTitle); diff --git a/SharepointToolbox/Services/IGraphUserDirectoryService.cs b/SharepointToolbox/Services/IGraphUserDirectoryService.cs new file mode 100644 index 0000000..a3ba665 --- /dev/null +++ b/SharepointToolbox/Services/IGraphUserDirectoryService.cs @@ -0,0 +1,26 @@ +using SharepointToolbox.Core.Models; + +namespace SharepointToolbox.Services; + +/// +/// Enumerates all enabled member users from a tenant via Microsoft Graph. +/// Used by Phase 13's User Directory ViewModel to populate the browse grid. +/// +public interface IGraphUserDirectoryService +{ + /// + /// Returns all enabled member users in the tenant associated with . + /// Iterates through all pages using the Graph SDK PageIterator until exhausted or cancelled. + /// + /// The client/tenant identifier used to obtain a Graph token. + /// + /// 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 null for no progress reporting. + /// + /// Cancellation token. Iteration stops when cancelled. + Task> GetUsersAsync( + string clientId, + IProgress? progress = null, + CancellationToken ct = default); +}