using DigitalData.Core.Abstractions;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DigitalData.UserManager.Domain.Entities
{
    public class BaseEntity : IUnique<int>
    {
        [Column("GUID")]
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [StringLength(50)]
        [Column("ADDED_WHO")]
        public string? AddedWho { get; set; }

        [StringLength(50)]
        [Column("CHANGED_WHO")]
        public string? ChangedWho { get; set; }

        [Column("ADDED_WHEN", TypeName = "datetime")]
        [DefaultValue("GETDATE()")]
        public DateTime AddedWhen { get; set; } = DateTime.Now;

        [Column("CHANGED_WHEN", TypeName = "datetime")]
        public DateTime? ChangedWhen { get; set; }
    }
}