| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | using ArturRios.Heimdall.Shared.Security; |
| | | 3 | | using ArturRios.Mediator.Query; |
| | | 4 | | |
| | | 5 | | namespace ArturRios.Heimdall.Query.Input; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Request to list the administrators who may own a scope — every <c>ScopeAdmin</c>, and for a |
| | | 9 | | /// System Admin caller every <c>SystemAdmin</c> too — with pagination and optional filtering |
| | | 10 | | /// (UC-07 read d, FR-PE-12). This is what backs an owner picker: UI-11 selects a scope's first |
| | | 11 | | /// owners before the scope exists, and UI-14 adds an existing Scope Admin as a co-owner. |
| | | 12 | | /// <see cref="ActingPersonId" />/<see cref="ActingRole" /> are set by the controller from the |
| | | 13 | | /// authenticated caller and are never taken from the request; both are <c>[JsonIgnore]</c>, |
| | | 14 | | /// which <c>ServerPopulatedBindingMetadataProvider</c> turns into "not bindable", so they never |
| | | 15 | | /// reach the public contract. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <remarks> |
| | | 18 | | /// There is deliberately no <c>IncludeDeleted</c>. A logically deleted administrator is never a |
| | | 19 | | /// valid owner — <c>PersonNotValidScopeAdmin</c> refuses one — so listing them could only offer |
| | | 20 | | /// a picker entry whose submission is guaranteed to fail. |
| | | 21 | | /// </remarks> |
| | | 22 | | public class ListScopeAdminsQuery : BaseQuery, IActorScoped |
| | | 23 | | { |
| | | 24 | | /// <summary>Optional case-insensitive substring filter on the administrator's name.</summary> |
| | 50 | 25 | | public string? Name { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary>Optional case-insensitive substring filter on the administrator's email.</summary> |
| | 42 | 28 | | public string? Email { get; set; } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// When set, the current owners of this scope are removed from the results (UI-14 AF-14c). |
| | | 32 | | /// The exclusion runs before pagination, so a page is not silently short. The caller must be |
| | | 33 | | /// entitled to manage the named scope: without that check, running the query with and |
| | | 34 | | /// without this parameter and diffing the two results would enumerate the owners of any |
| | | 35 | | /// scope, which is exactly what this endpoint's minimal projection exists to prevent. |
| | | 36 | | /// </summary> |
| | 45 | 37 | | public Guid? ExcludeOwnersOfScopeId { get; set; } |
| | | 38 | | |
| | | 39 | | [JsonIgnore] |
| | 27 | 40 | | public Guid ActingPersonId { get; set; } |
| | | 41 | | |
| | | 42 | | [JsonIgnore] |
| | 44 | 43 | | public int ActingRole { get; set; } |
| | | 44 | | } |