using System;

namespace JiShe.CollectBus.IotSystems.CommunicationLogs
{
    public class PacketLog : ICassandraEntity<Guid>
    {
        /// <summary>
        /// 下行报文
        /// </summary>
        public string IssuedMessage { get; set; } = string.Empty;

        /// <summary>
        /// 上行报文
        /// </summary>
        public string ReportMessage { get; set; } = string.Empty;

        public DateTime? IssuedTime { get; set; }
        public DateTime? ReportTime { get; set; }

        /// <summary>
        /// 报文类型（是否需要回复）
        /// </summary>
        public PacketType PacketType { get; set; }

        public Guid Id { get; set; }
    }

    public enum PacketType
    {
        /// <summary>
        /// 只有下发，不需要回复
        /// </summary>
        OnlyIssued,
        /// <summary>
        /// 只有上报，不需要下发
        /// </summary>
        OnlyReport,
        /// <summary>
        /// 下发并且需要回复
        /// </summary>
        IssuedAndReport
    }
}
