using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GreenTree.Nachtragsmanagement.Core.Domain.Logging
{
    public class Log : BaseEntity
    {
        /// <summary>
        /// The log level identifier
        /// </summary>
        public int LogLevelId { get; set; }

        /// <summary>
        /// The short message
        /// </summary>
        public string ShortMessage { get; set; }

        /// <summary>
        /// The full exception
        /// </summary>
        public string FullMessage { get; set; }

        /// <summary>
        /// The IP address
        /// </summary>
        public string IpAddress { get; set; }

        /// <summary>
        /// The user identifier
        /// </summary>
        public int? UserId { get; set; }

        /// <summary>
        /// The user
        /// </summary>
        public virtual User.User User { get; set; }

        /// <summary>
        /// The entity identifier
        /// </summary>
        public int? EntityId { get; set; }

        /// <summary>
        /// The entity type
        /// </summary>
        public string EntityType { get; set; }

        /// <summary>
        /// The page URL
        /// </summary>
        public string PageUrl { get; set; }

        /// <summary>
        /// Referrer URL
        /// </summary>
        public string ReferrerUrl { get; set; }

        /// <summary>
        /// The date and time of instance creation
        /// </summary>
        public DateTime CreatedOnUtc { get; set; }

        /// <summary>
        /// The log level
        /// </summary>
        public LogLevel LogLevel
        {
            get
            {
                return (LogLevel)this.LogLevelId;
            }
            set
            {
                this.LogLevelId = (int)value;
            }
        }
    }
}
