using System.ComponentModel.DataAnnotations;
namespace DorkNet.Server.Data.Entities;
///
/// Append-only audit row written every time an admin performs a
/// privileged action (ban, unban, promote, demote, room delete,
/// MOTD change, etc.). The admin watch UI's "audit" tab reads
/// from this in reverse-chronological order.
///
/// Rows are never deleted from the application — privileged actions
/// stay on the record. Storage cost is negligible at single-server
/// scale.
///
public class AdminActionEntity
{
public long Id { get; set; }
/// The admin who performed the action.
public long AdminPlayerId { get; set; }
/// Free-form action name. Convention: lower-snake-case verb,
/// e.g. ban_player, unban_player, promote_admin,
/// delete_room, set_motd.
[MaxLength(64)]
public string Action { get; set; } = string.Empty;
/// Targeted entity type — player, room,
/// system. Free-form so future actions can introduce new
/// kinds without a migration.
[MaxLength(32)]
public string TargetType { get; set; } = string.Empty;
/// Numeric id of the target. 0 for system-wide
/// actions like setting the MOTD.
public long TargetId { get; set; }
/// Optional human reason the admin supplied at action
/// time. Surfaced to the audit log UI verbatim.
[MaxLength(512)]
public string Reason { get; set; } = string.Empty;
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}