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

namespace FMSAdmin.Entities {
    public partial class FmsEquipmentHistory {
        [Display(Name = "고유번호"), Key]
        public int SiteId { get; set; }
        public int EquipmentHistoryId { get; set; }
        public int EquipmentId { get; set; }
        [Display(Name = "전체수량")]
        public int? TotalStockCount { get; set; }
        [Display(Name = "현재보유수량")]
        public int? CurrentStockCount { get; set; }
        [Display(Name = "대여수량")]
        public int? RentCount { get; set; }
        [Display(Name = "현재대여수량")]
        public int? CurrentRentCount { get; set; }
        [Display(Name = "반납수량")]
        public int? ReturnCount { get; set; }
        [Display(Name = "손망실수량")]
        public int? LossCount { get; set; }
        [Display(Name = "입고수량")]
        public int? StoredCount { get; set; }
        [Display(Name = "공기구대여")]
        public int? EquipmentRentId { get; set; }
        [Display(Name = "공기구대여상태")]
        public short? EquipmentStateTypeId { get; set; }
        [Display(Name = "등록일")]
        [Column(TypeName = "datetime")]
        public DateTime? AddDate { get; set; }
        [Display(Name = "수정일")]
        [Column(TypeName = "datetime")]
        public DateTime? UpdateDate { get; set; }
        [Display(Name = "출고인경우 반납(+망실) 완료 여부")]
        public bool? IsReturned { get; set; }
        [Display(Name = "반납/손실 사유")]
        public string ReturnReason { get; set; }
        [Display(Name = "승인일")]
        [Column(TypeName = "datetime")]
        public DateTime? ReturnApprovalDate { get; set; }
        [Display(Name = "승인자 ID ")]
        [StringLength(24)]
        public string ReturnApprovalUserId { get; set; }
        [Display(Name = "승인 여부")]
        public bool IsReturnApproval { get; set; }
        [Display(Name = "파일")]
        public int? FileId { get; set; }

        [ForeignKey("SiteId")]
        public virtual CmSite CmSite { get; set; }
        [ForeignKey(nameof(EquipmentStateTypeId))]
        public virtual FmsEquipmentCodeStateType EquipmentStateType { get; set; }
        [ForeignKey("SiteId,EquipmentId")]
        public virtual FmsEquipment FmsEquipment { get; set; }
        [ForeignKey("SiteId,EquipmentRentId")]
        public virtual FmsEquipmentRentInfo FmsEquipmentRentInfo { get; set; }

        [ForeignKey("ReturnApprovalUserId")]
        public virtual CmUser CmUser { get; set; }

        [ForeignKey("SiteId,FileId")]
        public virtual CmFile CmFile { get; set; }
    }
}
