using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FMSAdmin.Entities {
    public partial class FmsEquipmentRentInfo {
        public FmsEquipmentRentInfo() {
            FmsEquipmentHistory = new HashSet<FmsEquipmentHistory>();
        }

        [Display(Name = "고유번호"), Key]
        public int SiteId { get; set; }
        public int EquipmentRentId { get; set; }
        [Display(Name = "등록자 ID"), Required]
        [StringLength(24)]
        public string RegisterUserId { get; set; }
        [Display(Name = "대여자 ID")]
        [StringLength(24)]
        public string RentUserId { get; set; }
        [Display(Name = "등록일")]
        [StringLength(10)]
        public string RegisterDate { get; set; }
        [Display(Name = "대여일")]
        [Column(TypeName = "datetime")]
        public DateTime? RentDate { get; set; }
        [Display(Name = "반납예정일")]
        [Column(TypeName = "datetime")]
        public DateTime? ReturnDueDate { get; set; }
        [Display(Name = "반납일")]
        [Column(TypeName = "datetime")]
        public DateTime? ReturnFixDate { get; set; }
        [Display(Name = "공기구 상태 코드")]
        public short? EquipmentStateTypeId { get; set; }
        [Display(Name = "비고")]
        [StringLength(1024)]
        public string Comment { get; set; }
        [Display(Name = "대여 제목"), Required]
        [StringLength(128)]
        public string Title { get; set; }
        [Display(Name = "대여자")]
        [StringLength(128)]
        [Column("RentUser")]
        public string RentUserName { get; set; }
        [NotMapped]
        public int? ReturnHistoryId { get; set; }
        [NotMapped]
        public int? ReturnCount { get; set; }
        [NotMapped]
        public int? LossCount { get; set; }
        [NotMapped]
        public string ReturnReason { get; set; }

        [Display(Name = "반납/손실 첨부파일")]
        [NotMapped]
        public CmFile CmFile { get; set; }

        [ForeignKey("SiteId")]
        public virtual CmSite Site { get; set; }
        [ForeignKey("RegisterUserId")]
        public virtual CmUser RegisterUser { get; set; }
        [ForeignKey("RentUserId")]
        public virtual CmUser RentUser { get; set; }
        [ForeignKey(nameof(EquipmentStateTypeId))]
        [InverseProperty(nameof(FmsEquipmentCodeStateType.FmsEquipmentRentInfo))]
        public virtual FmsEquipmentCodeStateType EquipmentStateType { get; set; }
        [InverseProperty("FmsEquipmentRentInfo")]
        public virtual ICollection<FmsEquipmentHistory> FmsEquipmentHistory { get; set; }
    }
}
