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

namespace FMSAdmin.Entities
{
    public partial class FmsConstruction
    {
        [Key]
        public int SiteId { get; set; }
        [Key]
        public int ConstructionId { get; set; }
        [Required]
        [StringLength(256)]
        public string Name { get; set; }
        public int ConstructionTypeId { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime StartDate { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime EndDate { get; set; }
        public int PartnerId { get; set; }
        [Required]
        [StringLength(256)]
        public string ConstructLocation { get; set; }
        [Required]
        [StringLength(24)]
        public string OwnerShipName { get; set; }
        public short? CommitmentMan { get; set; }
        [Required]
        [StringLength(20)]
        public string OwnerShipPhoneNo { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? WeldWorkStartTime { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? WeldWorkEndTime { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? GasWorkStartTime { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? GasWorkEndTime { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? PaintWorkStartTime { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? PaintWorkEndTime { get; set; }
        [StringLength(1024)]
        public string Comment { get; set; }
        public short ProgressId { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime AddDate { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime UpdateDate { get; set; }
        [StringLength(1024)]
        public string ConstructionDetail { get; set; }
        [StringLength(1024)]
        public string InOutStockName { get; set; }
        public int? FileId1 { get; set; }
        public int? FileId2 { get; set; }
        public int? FileId3 { get; set; }

        [ForeignKey("SiteId,FileId1")]
        [InverseProperty("FmsConstructionCmFile")]
        public virtual CmFile CmFile { get; set; }
        [ForeignKey("SiteId,FileId3")]
        [InverseProperty("FmsConstructionCmFile1")]
        public virtual CmFile CmFile1 { get; set; }
        [ForeignKey("SiteId,FileId2")]
        [InverseProperty("FmsConstructionCmFileNavigation")]
        public virtual CmFile CmFileNavigation { get; set; }
        [ForeignKey("SiteId,PartnerId")]
        [InverseProperty("FmsConstruction")]
        public virtual CmPartner CmPartner { get; set; }
        [ForeignKey("SiteId,ConstructionTypeId")]
        [InverseProperty("FmsConstruction")]
        public virtual FmsConstructionCodeType FmsConstructionCodeType { get; set; }
        [ForeignKey(nameof(ProgressId))]
        [InverseProperty(nameof(FmsConstructionCodeProgress.FmsConstruction))]
        public virtual FmsConstructionCodeProgress Progress { get; set; }
        [InverseProperty("FmsConstruction")]
        public virtual FmsConstructionEstimation FmsConstructionEstimation { get; set; }
    }
}
