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

namespace FMSAdmin.Entities {
    public partial class CmPartner {
        public CmPartner() {
            FmsConstruction = new HashSet<FmsConstruction>();
            FmsContract = new HashSet<FmsContract>();
            FmsWorkRequest = new HashSet<FmsWorkRequest>();
            FmsWorkSchedule = new HashSet<FmsWorkSchedule>();
        }

        //협력업체 정보
        [Display(Name = "현장 고유번호"), Key]
        public int SiteId { get; set; }
        [Display(Name = "협력업체 고유번호"), Key]
        public int PartnerId { get; set; }
        [Display(Name = "협력업체 유형"), Required]
        public int PartnerTypeId { get; set; }
        [Display(Name = "업무분야")]
        public int? BusinessFieldId { get; set; }

        [Display(Name = "협력업체 명"), Required]
        [StringLength(50)]
        public string Name { get; set; }
        [Display(Name = "등록번호")]
        [StringLength(24)]
        public string RegistrationNo { get; set; }
        [Display(Name = "대표자 명")]
        [StringLength(20)]
        public string RepresentativeName { get; set; }
        [Display(Name = "전화번호")]
        [StringLength(20)]
        public string PhoneNo { get; set; }
        [Display(Name = "팩스번호")]
        [StringLength(20)]
        public string FaxNo { get; set; }
        [Display(Name = "담당자 명")]
        [StringLength(20)]
        public string SalesName { get; set; }
        [Display(Name = "담당자 전화번호")]
        [StringLength(20)]
        public string SalesPhoneNo { get; set; }
        [Display(Name = "우편번호1")]
        public string AddressZip1 { get; set; }
        [Display(Name = "우편번호2")]
        public string AddressZip2 { get; set; }
        [Display(Name = "주소1")]
        [StringLength(50)]
        public string Address1 { get; set; }
        [Display(Name = "상세 주소")]
        [StringLength(100)]
        public string Adderss2 { get; set; }
        [Display(Name = "홈페이지 주소")]
        [StringLength(100)]
        public string HomepageUri { get; set; }
        [Display(Name = "비고")]
        [StringLength(1024)]
        public string Note { get; set; }
        [Display(Name = "사용유무")]
        public bool? IsUse { get; set; }

        [ForeignKey("SiteId")]
        public virtual CmSite CmSite { get; set; }
        [ForeignKey(nameof(PartnerTypeId))]
        [InverseProperty(nameof(CmPartnerType.CmPartner))]
        public virtual CmPartnerType PartnerType { get; set; }

        [ForeignKey("BusinessFieldId")]
        public virtual CmBusinessField BusinessField { get; set; }

        [InverseProperty("CmPartner")]
        public virtual ICollection<FmsConstruction> FmsConstruction { get; set; }
        [InverseProperty("CmPartner")]
        public virtual ICollection<FmsContract> FmsContract { get; set; }
        [InverseProperty("CmPartner")]
        public virtual ICollection<FmsWorkRequest> FmsWorkRequest { get; set; }
        [InverseProperty("CmPartner")]
        public virtual ICollection<FmsWorkSchedule> FmsWorkSchedule { get; set; }
    }
}
