namespace NetAdmin.Domain.DbMaps.Dependency;

/// <inheritdoc />
public abstract record LiteMutableEntity : LiteMutableEntity<long>
{
    /// <summary>
    ///     唯一编码
    /// </summary>
    [Column(IsIdentity = false, IsPrimary = true, Position = 1)]
    [CsvIgnore]
    [Snowflake]
    public override long Id { get; init; }
}

/// <summary>
///     轻型可变实体
/// </summary>
public abstract record LiteMutableEntity<T> : LiteImmutableEntity<T>, IFieldModifiedTime
    where T : IEquatable<T>
{
    /// <summary>
    ///     唯一编码
    /// </summary>
    [Column(IsIdentity = false, IsPrimary = true, Position = 1)]
    [CsvIgnore]
    public override T Id { get; init; }

    /// <summary>
    ///     修改时间
    /// </summary>
    [Column(ServerTime = DateTimeKind.Local, CanInsert = false, Position = -1)]
    [CsvIgnore]
    [JsonIgnore]
    public virtual DateTime? ModifiedTime { get; init; }
}