namespace ZB.MOM.WW.OtOpcUa.Configuration.Entities;
///
/// Append-only audit row written by AdminOperationsActor on every mutating live-edit
/// operation. The ExecutionId optionally correlates a sequence of edits that ran inside one
/// admin transaction (e.g. an import batch that updates many Equipment rows).
///
public sealed class ConfigEdit
{
/// Gets the unique identifier for this edit.
public Guid EditId { get; init; } = Guid.NewGuid();
/// Gets the type of entity that was edited.
public required string EntityType { get; init; }
/// Gets the identifier of the entity that was edited.
public Guid EntityId { get; init; }
/// Gets the JSON payload of the column-name → new-value pairs touched by this edit.
public required string FieldsJson { get; init; }
/// Gets the optional correlation identifier across edits inside a single admin operation.
public Guid? ExecutionId { get; init; }
/// Gets the username of the user who performed the edit.
public required string EditedBy { get; init; }
/// Gets the UTC timestamp when the edit was performed.
public DateTime EditedAtUtc { get; init; } = DateTime.UtcNow;
/// Gets the node identifier of the admin instance that performed the edit.
public required string SourceNode { get; init; }
}