using Domain.Entities.Forum.Posts;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Domain.Entities.Forum.Boards
{
    public class Board
    {
        [ForeignKey(nameof(BoardGroupID))]
        public virtual BoardGroup BoardGroup { get; set; } = null!;

        public virtual BoardMeta BoardMeta { get; set; } = null!;

        public virtual List<BoardManager> BoardManager { get; set; } = [];

        public virtual List<BoardPrefix> BoardPrefix { get; set; } = [];

        public virtual List<Post> Post { get; set; } = [];

        [Key]
        public int ID { get; set; }

        [ForeignKey(nameof(BoardGroup))]
        public int BoardGroupID { get; set; }

        public string Code { get; set; } = default!;

        public string Name { get; set; } = default!;

        public short Order { get; set; } = 0;

        public bool IsSearch { get; set; } = false;

        public bool IsActive { get; set; } = false;

        public int Posts { get; set; } = 0;

        public int Comments { get; set; } = 0;

        public DateTime? UpdatedAt { get; set; }

        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    }
}