| | | 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 audit trail (UC-48, FR-AT-01), newest first. Every filter is optional, and |
| | | 9 | | /// those given combine with AND. <see cref="ActingPersonId" />/<see cref="ActingRole" /> are set by |
| | | 10 | | /// the controller from the authenticated caller and are never bound from the request. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <remarks> |
| | | 13 | | /// There is no scope filter, and cannot be one: <c>AUDIT_LOG</c> has no scope column, and an old |
| | | 14 | | /// row's target may since have been deleted or anonymised, so it cannot be attributed to a scope |
| | | 15 | | /// reliably. That is why the listing is System Admins' only. |
| | | 16 | | /// </remarks> |
| | | 17 | | public class ListAuditLogQuery : BaseQuery, IActorScoped |
| | | 18 | | { |
| | | 19 | | /// <summary>Earliest recording instant to include (UTC, inclusive).</summary> |
| | 55 | 20 | | public DateTime? From { get; set; } |
| | | 21 | | |
| | | 22 | | /// <summary>Latest recording instant to include (UTC, inclusive). Must not be earlier than <see cref="From" />.</su |
| | 80 | 23 | | public DateTime? To { get; set; } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// The actor's public id. An entry whose actor has been cleared (NFR-21) names nobody, so this |
| | | 27 | | /// filter cannot find it. |
| | | 28 | | /// </summary> |
| | 40 | 29 | | public Guid? ActorId { get; set; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// The exact action, as recorded — the command's type name, e.g. <c>CreateScopeCommand</c>. |
| | | 33 | | /// Matched case-sensitively; empty or whitespace means no filter. |
| | | 34 | | /// </summary> |
| | 96 | 35 | | public string? Action { get; set; } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// The affected entity's public id. An entry whose person target has been cleared (NFR-21) |
| | | 39 | | /// names nobody, so this filter cannot find it. |
| | | 40 | | /// </summary> |
| | 51 | 41 | | public Guid? TargetId { get; set; } |
| | | 42 | | |
| | | 43 | | /// <summary><c>true</c> for completed writes, <c>false</c> for refused ones.</summary> |
| | 40 | 44 | | public bool? Succeeded { get; set; } |
| | | 45 | | |
| | | 46 | | [JsonIgnore] |
| | 41 | 47 | | public Guid ActingPersonId { get; set; } |
| | | 48 | | |
| | | 49 | | [JsonIgnore] |
| | 41 | 50 | | public int ActingRole { get; set; } |
| | | 51 | | } |