using MiGu.DB.Abstractions.Entities; namespace MiGu.DB.Kernel.Entities; public abstract class Entity : IEntity { public TKey Id { get; set; } = default!; } public abstract class AuditedEntity : Entity, IAuditable { public DateTimeOffset CreatedAt { get; set; } public DateTimeOffset UpdatedAt { get; set; } public string CreatedBy { get; set; } = ""; public string UpdatedBy { get; set; } = ""; } public abstract class SoftDeletableEntity : AuditedEntity, ISoftDeletable, IVersioned, ILockable { public bool IsDeleted { get; set; } public DateTimeOffset? DeletedAt { get; set; } public string DeletedBy { get; set; } = ""; public long Version { get; set; } public bool IsLock { get; set; } } public abstract class AggregateRoot : SoftDeletableEntity, IRemarkable, IExtendable { public string Remark { get; set; } = ""; public string Extend { get; set; } = "{}"; } public abstract class HistoryEntity : Entity, IHistoryEntry { public Guid? RelationId { get; set; } public string EventType { get; set; } = ""; public string BeforeJson { get; set; } = "{}"; public string AfterJson { get; set; } = "{}"; public Guid? ContainerId { get; set; } public string Operator { get; set; } = ""; public DateTimeOffset OperatedAt { get; set; } public string Source { get; set; } = "Manual"; public string Reason { get; set; } = ""; public string Remark { get; set; } = ""; public string Extend { get; set; } = "{}"; }