RobotTaskHistory.cs 2.01 KB
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Rcs.Domain.Entities;

/// <summary>
/// 主任务历史记录
/// </summary>
[Table("robot_task_histories")]
public class RobotTaskHistory : Entity
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.None)]
    [Column("task_id")]
    public Guid TaskId { get; set; }

    [Required]
    [Column("task_code")]
    [MaxLength(50)]
    public string TaskCode { get; set; } = string.Empty;

    [Column("task_name")]
    [MaxLength(100)]
    public string? TaskName { get; set; }

    [Column("robot_code")]
    [MaxLength(50)]
    public string? RobotCode { get; set; }

    [Column("task_template_code")]
    [MaxLength(50)]
    public string? TaskTemplateCode { get; set; }

    [Column("begin_location_code")]
    [MaxLength(50)]
    public string? BeginLocationCode { get; set; }

    [Column("end_location_code")]
    [MaxLength(50)]
    public string? EndLocationCode { get; set; }

    [Column("status")]
    public TaskStatus Status { get; set; }

    [Column("pause")]
    public bool Pause { get; set; }

    [Column("priority")]
    public int Priority { get; set; } = 99;

    [Column("source")]
    [MaxLength(300)]
    public string? Source { get; set; }

    [Column("relation")]
    [MaxLength(300)]
    public string? Relation { get; set; }

    [Column("shelf_code")]
    [MaxLength(50)]
    public string? ShelfCode { get; set; }

    [Column("container_id")]
    [MaxLength(50)]
    public string? ContainerID { get; set; }

    [Column("error_info", TypeName = "text")]
    public string? ErrorInfo { get; set; }

    [Column("created_at", TypeName = "timestamp")]
    public DateTime CreatedAt { get; set; }

    [Column("updated_at", TypeName = "timestamp")]
    public DateTime? UpdatedAt { get; set; }

    [Column("archived_at", TypeName = "timestamp")]
    public DateTime ArchivedAt { get; set; }

    public virtual ICollection<RobotSubTaskHistory> SubTaskHistories { get; set; } = new List<RobotSubTaskHistory>();
}