﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using Microsoft.Extensions.Logging;

namespace SmartStoreNetCore.Core.Entities
{
    [DataContract]
    public class Log : BaseEntity
    {
        [DataMember]
        [Required]
        [MaxLength(800)]
        public string ShortMessage { get; set; }

        [DataMember]
        [MaxLength(2000)]
        public string FullMessage { get; set; }

        [DataMember]
        [MaxLength(100)]
        public string IpAddress { get; set; }

        [DataMember]
        [Required]
        public string CustomerId { get; set; }

        [DataMember]
        [MaxLength(2000)]
        public string PageUrl { get; set; }

        [DataMember]
        [MaxLength(2000)]
        public string ReferrerUrl { get; set; }

        [DataMember]
        public DateTime CreatedOnUtc { get; set; }

        [DataMember]
        public DateTime? UpdatedOnUtc { get; set; }

        [DataMember]
        public int Frequency { get; set; }

        [DataMember]
        [MaxLength(50)]
        public string ContentHash { get; set; }

        [DataMember]
        public LogLevel LogLevel { get; set; }

        [DataMember]
        [ForeignKey("CustomerId")]
        public virtual Customer Customer { get; set; }
    }
}
