using Newtonsoft.Json;

namespace e_suite.Database.Audit.AuditEngine;

public class AuditDrillUp
{
    public string EntityName { get; set; } = null!;
    public Dictionary<string, object?> PrimaryKey { get; } = new();
    public string? EntryName { get; set; }

    public List<AuditDrillUp> Parents { get; set; } = new();

    public string ToPrimaryKeyJson()
    {
        return JsonConvert.SerializeObject(PrimaryKey, new JsonSerializerSettings
        {
            NullValueHandling = NullValueHandling.Ignore
        });
    }
}