using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

/// <summary>
/// 사용자단 회원 등급 조건 세부 정보
/// </summary>
namespace bitforum.Models.Account
{
    [Table("MemberGrade")]
    [Comment("회원 등급")]
    [Index(nameof(KorName), Name = "IX_MemberGrade_KorName", IsUnique = true)]
    [Index(nameof(EngName), Name = "IX_MemberGrade_EngName", IsUnique = true)]
    [Index(nameof(Order), Name = "IX_MemberGrade_Order")]
    [Index(nameof(IsActive), Name = "IX_MemberGrade_IsActive")]
    public class MemberGrade
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DisplayName("PK")]
        [Comment("PK")]
        public int ID { get; set; }

        [Required]
        [DisplayName("한글 명")]
        [Comment("한글 명")]
        [StringLength(120)]
        public string KorName { get; set; } = null!;

        [Required]
        [DisplayName("영문 명")]
        [Comment("영문 명")]
        [StringLength(120)]
        public string EngName { get; set; } = null!;

        [DisplayName("설명")]
        [Comment("설명")]
        [StringLength(1000)]
        public string? Description { get; set; } = null;

        [Required]
        [DisplayName("순서")]
        [Comment("순서")]
        public short Order { get; set; } = 0;

        [DisplayName("이미지")]
        [Comment("이미지")]
        [DataType(DataType.ImageUrl)]
        public string? Image { get; set; } = null;

        [Required]
        [DisplayName("최소 경험치(Exp)")]
        [Comment("최소 경험치(Exp)")]
        public int RequiredExp { get; set; } = 0;

        [Required]
        [DisplayName("최소 코인(Coin)")]
        [Comment("최소 코인(Coin)")]
        public int RequiredCoin { get; set; } = 0;

        [DisplayName("사용 여부")]
        [Comment("사용 여부")]
        public bool IsActive { get; set; } = false;

        [DisplayName("수정 일시")]
        [Comment("수정 일시")]
        public DateTime? UpdatedAt { get; set; } = null;

        [DisplayName("등록 일시")]
        [Comment("등록 일시")]
        public DateTime CreatedAt { get; set; }
    }
}
