using System;
using System.Collections.Generic;
using Datory.Annotations;
using GxPress.Common.Tools;

namespace GxPress.Entity.WorkMeeting
{
    /// <summary>
    /// 会议
    /// </summary>
    [DataTable("tede_meeting")]
    public class Meeting : Datory.Entity
    {
        /// <summary>
        /// 会议主题
        /// </summary>
        [DataColumn]
        public string Name { get; set; }

        /// <summary>
        /// 会议地址Id
        /// </summary>
        [DataColumn]
        public int LocationId { get; set; }

        /// <summary>
        /// 会议室Id
        /// </summary>
        [DataColumn]
        public int RoomId { get; set; }

        [DataColumn]
        public string OrderIdCollection { get; set; }

        /// <summary>
        /// 会议地址Id
        /// </summary>
        public IEnumerable<int> OrderIds
        {
            get => StringUtils.StringCollectionToIntList(OrderIdCollection);
            set => OrderIdCollection = string.Join(',', value);
        }

        /// <summary>
        /// 会议开始时间
        /// </summary>
        [DataColumn]
        public DateTime? StartDateTime { get; set; }

        /// <summary>
        /// 会议结束时间
        /// </summary>
        [DataColumn]
        public DateTime? EndDateTime { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [DataColumn]
        public string Description { get; set; }

        /// <summary>
        /// 发起人
        /// </summary>
        [DataColumn]
        public int UserId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        /// <value></value>
        [DataColumn]
        public string FileIdCollection { get; set; }

        /// <summary>
        /// 附件Id列表
        /// </summary>
        public IEnumerable<int> FileIds { get; set; }
        /// <summary>
        /// 
        /// </summary>
        /// <value></value>
        [DataColumn]
        public string UserIdCollection { get; set; }

        /// <summary>
        /// 参会人Id列表
        /// </summary>
        public IEnumerable<int> UserIds
        {
            get => StringUtils.StringCollectionToIntList(UserIdCollection);
            set => UserIdCollection = string.Join(',', value);
        }
    }
}