@@ -0,0 +1,50 @@
|
||||
using ROLAC.API.Entities.Logging;
|
||||
|
||||
namespace ROLAC.API.DTOs.Logging;
|
||||
|
||||
/// <summary>Row shape for the Audit Logs grid (no heavy Changes JSON).</summary>
|
||||
public class AuditLogListItemDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTimeOffset Timestamp { get; set; }
|
||||
public string Level { get; set; } = null!;
|
||||
public string Action { get; set; } = null!;
|
||||
public string Category { get; set; } = null!;
|
||||
public string? EntityName { get; set; }
|
||||
public string? EntityId { get; set; }
|
||||
public string? Summary { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
public string? UserEmail { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Full detail for the Audit Log dialog, including the before→after JSON.</summary>
|
||||
public class AuditLogDetailDto : AuditLogListItemDto
|
||||
{
|
||||
public string? Changes { get; set; }
|
||||
public string? IpAddress { get; set; }
|
||||
public string? CorrelationId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Filters for the paged Audit Logs query.</summary>
|
||||
public class AuditLogQuery
|
||||
{
|
||||
public int Page { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 20;
|
||||
public DateTimeOffset? From { get; set; }
|
||||
public DateTimeOffset? To { get; set; }
|
||||
public string? Category { get; set; }
|
||||
public string? Action { get; set; }
|
||||
public string? EntityName { get; set; }
|
||||
public string? EntityId { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
public LogLevelEnum? MinLevel { get; set; }
|
||||
public string? Search { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Option lists for the Audit Logs filter UI.</summary>
|
||||
public class AuditCatalogDto
|
||||
{
|
||||
public IReadOnlyList<string> Categories { get; set; } = [];
|
||||
public IReadOnlyList<string> Actions { get; set; } = [];
|
||||
public IReadOnlyList<string> Levels { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using ROLAC.API.Entities.Logging;
|
||||
|
||||
namespace ROLAC.API.DTOs.Logging;
|
||||
|
||||
/// <summary>Row shape for the System Logs grid (no heavy exception text).</summary>
|
||||
public class SystemLogListItemDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTimeOffset Timestamp { get; set; }
|
||||
public string Level { get; set; } = null!;
|
||||
public string Category { get; set; } = null!;
|
||||
public string Message { get; set; } = null!;
|
||||
public bool HasException { get; set; }
|
||||
public int? StatusCode { get; set; }
|
||||
public string? RequestPath { get; set; }
|
||||
public string? HttpMethod { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
public string? CorrelationId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Full detail for the System Log dialog, including the stack trace.</summary>
|
||||
public class SystemLogDetailDto : SystemLogListItemDto
|
||||
{
|
||||
public int? EventId { get; set; }
|
||||
public string? Exception { get; set; }
|
||||
public string? IpAddress { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Filters for the paged System Logs query.</summary>
|
||||
public class SystemLogQuery
|
||||
{
|
||||
public int Page { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 20;
|
||||
public DateTimeOffset? From { get; set; }
|
||||
public DateTimeOffset? To { get; set; }
|
||||
/// <summary>Lower bound on severity (inclusive).</summary>
|
||||
public LogLevelEnum? MinLevel { get; set; }
|
||||
/// <summary>Exact severity match (takes precedence over MinLevel when set).</summary>
|
||||
public LogLevelEnum? Level { get; set; }
|
||||
public string? Search { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
public string? CorrelationId { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user