using ROLAC.API.Entities.Logging;
namespace ROLAC.API.DTOs.Logging;
/// Row shape for the Audit Logs grid (no heavy Changes JSON).
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; }
}
/// Full detail for the Audit Log dialog, including the before→after JSON.
public class AuditLogDetailDto : AuditLogListItemDto
{
public string? Changes { get; set; }
public string? IpAddress { get; set; }
public string? CorrelationId { get; set; }
}
/// Filters for the paged Audit Logs query.
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; }
}
/// Option lists for the Audit Logs filter UI.
public class AuditCatalogDto
{
public IReadOnlyList Categories { get; set; } = [];
public IReadOnlyList Actions { get; set; } = [];
public IReadOnlyList Levels { get; set; } = [];
}