using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using WCS.Model.ApiModel.StoreInfo;

namespace WCS.Model.ApiModel.AGV
{
    public class AGVTaskModel : INotifyPropertyChanged
    {

        /// <summary>
        /// 主键 自增Id
        /// </summary>
        public int Id { get; set; }

        #region 任务属性
        /// <summary>
        /// 请求码
        /// </summary>
        public string RequestCode { get; set; }

        /// <summary>
        /// 任务码
        /// </summary>
        public string TaskCode { get; set; }

        /// <summary>
        /// 任务类型
        /// </summary>       
        public string TaskType { get; set; } = string.Empty;

        /// <summary>
        /// 起点位置ID
        /// </summary>
        public int StratLocationId { get; set; } = 0;

        /// <summary>
        /// 起点位置编码
        /// </summary>       
        public string StartLocationCode { get; set; } = string.Empty;

        /// <summary>
        /// 终点位置ID
        /// </summary>
        public int EndLocationId { get; set; } = 0;

        /// <summary>
        /// 终点位置编码
        /// </summary>
        public string EndLocationCode { get; set; } = string.Empty;


        /// <summary>
        /// 货架码
        /// </summary>
        public string ShelfCode { get; set; } = string.Empty;

        /// <summary>
        /// AGV编号
        /// </summary>
        public string AgvCode { get; set; } = string.Empty;

        public string AgvStatus { get; set; } = string.Empty;

        /// <summary>
        /// 任务发起人
        /// </summary>           
        public string? CreateUser { get; set; }

        /// <summary>
        /// 任务创建时间
        /// </summary>           
        public DateTime? CreateTime { get; set; } = DateTime.Now;


        /// <summary>
        /// 最后更新时间
        /// </summary>           
        public DateTime? ModifyTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 任务状态
        /// </summary>           
        public TaskStatusEnum TaskStatus { get; set; } = TaskStatusEnum.已创建;

        public string TaskStatusStr { get; set; }
        #endregion

        /// <summary>
        /// 序号
        /// </summary>
        public int RowNumber { get; set; }

        /// <summary>
        /// 是否选择
        /// </summary>
        public bool IsSelected
        {
            get { return isSelected; }
            set
            {
                isSelected = value;
                OnPropertyChanged(nameof(IsSelected));
            }
        }
        public bool isSelected;

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
