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

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

        [Display(Name = "고유번호"), Key]
        public int SiteId { get; set; }
        public int EquipmentId { get; set; }
        [Display(Name = "공기구 명"), Required]
        [StringLength(48, ErrorMessage = "공기구명은 최대 48자까지 입력 가능합니다.")]
        public string Name { get; set; }
        [Display(Name = "공기구 유형")]
        public int EquipmentTypeId { get; set; }
        [Display(Name = "보관 창고")]
        public int? WarehouseId { get; set; }
        [NotMapped]
        [Display(Name = "창고용 업무분야")]
        public int? BusinessFieldId { get; set; }
        [Display(Name = "수량")]
        [StringLength(12, ErrorMessage = "수량은 최대 12자까지 입력 가능합니다.")]
        public string Unit { get; set; }
        [Display(Name = "규격")]
        [StringLength(20, ErrorMessage = "규격은 최대 20자까지 입력 가능합니다.")]
        public string Standard { get; set; }
        [Display(Name = "등록일")]
        [Column(TypeName = "datetime")]
        public DateTime? AddDate { get; set; }
        [Display(Name = "갱신일")]
        [Column(TypeName = "datetime")]
        public DateTime? UpdateDate { get; set; }
        [Display(Name = "등록자 ID"), Required]
        [StringLength(24, ErrorMessage = "등록자는 최대 24자까지 입력 가능합니다.")]
        public string RegisterUserId { get; set; }
        [Display(Name = "공급회사 명")]
        [StringLength(256, ErrorMessage = "공급회사명은 최대 256자까지 입력 가능합니다.")]
        public string SupplierName { get; set; }
        [Display(Name = "공급자 전화번호")]
        [StringLength(20, ErrorMessage = "공급자 전화번호는 최대 20자까지 입력 가능합니다.")]
        public string SupplierPhoneNo { get; set; }
        [Display(Name = "이미지 파일 ID")]
        public int? ImageFileId { get; set; }

        [NotMapped]
        public int? StoredCount { get; set; }
        [NotMapped]
        [Display(Name = "엑셀행번호")]
        public int ExcelRowNum { get; set; }

        [ForeignKey("SiteId")]
        public virtual CmSite Site { get; set; }
        [ForeignKey("RegisterUserId")]
        public virtual CmUser CmUser { get; set; }
        [ForeignKey("SiteId,ImageFileId")]
        public virtual CmFile ImageFile { get; set; }
        [ForeignKey("EquipmentTypeId")]
        [InverseProperty("FmsEquipment")]
        public virtual FmsEquipmentCodeType FmsEquipmentCodeType { get; set; }
        [ForeignKey("SiteId,WarehouseId")]
        [InverseProperty("FmsEquipment")]
        public virtual FmsMaterialWarehouse FmsMaterialWarehouse { get; set; }
        [InverseProperty("FmsEquipment")]
        public virtual ICollection<FmsEquipmentHistory> FmsEquipmentHistory { get; set; }
    }
}
