using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace AMESCoreStudio.WebApi.Models.BAS
{
    /// <summary>
    /// 流程站別資料
    /// </summary>
    [Table("RULE_STATION", Schema = "JHAMES")]
    public class RuleStation
    {
        /// <summary>
        /// 流程站別編號
        /// </summary>
        [Key]
        [Column("RULE_STATION_ID")]
        [DataMember]
        public int RuleStationID { get; set; }

        /// <summary>
        /// 流程編號
        /// </summary>
        [Column("FLOW_RULE_ID")]
        [Display(Name = "流程編號")]
        [DataMember]
        public int FlowRuleID { get; set; }

        /// <summary>
        /// 站別編號
        /// </summary>
        [Column("STATION_ID")]
        [Display(Name = "站別編號")]
        [DataMember]
        public int StationID { get; set; }

        /// <summary>
        /// 站別描述
        /// </summary>
        [Column("STATION_DESC")]
        [DataMember]
        [Display(Name = "站別描述")]
        [Required(ErrorMessage = "{0},不能空白")]
        [StringLength(200, ErrorMessage = "{0},不能大于{1}")]
        public string StationDesc { get; set; }

        /// <summary>
        /// 站別順序
        /// </summary>
        [Column("SEQUENCE")]
        [DataMember]
        [Display(Name = "站別順序")]
        [Required(ErrorMessage = "{0},不能空白")]
        public int Sequence { get; set; }

        /// <summary>
        /// 站別類型
        /// </summary>
        [Column("STATION_TYPE")]
        [Display(Name = "站別類型")]
        [DataMember]
        public string StationType { get; set; }

        /// <summary>
        /// 建立人員
        /// </summary>
        [Column("CREATE_USERID")]
        [DataMember]
        public int CreateUserId { get; set; }

        /// <summary>
        /// 建立時間
        /// </summary>
        [Column("CREATE_DATE")]
        [DataMember]
        public DateTime CreateDate { get; set; }

        /// <summary>
        /// 修改時間
        /// </summary>
        [Column("UPDATE_DATE")]
        public DateTime UpdateDate { get; set; }

        /// <summary>
        /// 站別资料
        /// </summary>
        [ForeignKey("StationID")]
        public virtual Stations Station { get; set; }
    }
}