StepProperty.cs 2.99 KB
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Rcs.Domain.Enums;

namespace Rcs.Domain.Entities;

/// <summary>
/// 步骤属性实体类(用于存储nodeProperty、preNodeProperty、line1等属性)
/// </summary>
[Table("step_properties")]
public partial class StepProperty
{
    /// <summary>
    /// 系统ID
    /// </summary>
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.None)]
    [Column("property_id")]
    public Guid PropertyId { get; set; }

    /// <summary>
    /// 任务步骤ID(外键)
    /// </summary>
    [Required]
    [Column("step_id")]
    public Guid StepId { get; set; }

    /// <summary>
    /// 属性类型(NODE、PRE_NODE、LINE1、LINE2等)
    /// </summary>
    [Required]
    [Column("property_type")]
    public StepPropertyType PropertyType { get; set; }

    /// <summary>
    /// 节点值(如:TS等节点编码)
    /// </summary>
    [Column("node_value")]
    public NodeValueType? NodeValue { get; set; }

    /// <summary>
    /// 前置动作类型1
    /// </summary>
    [Column("pre_action1_type")]
    public ActionType? PreAction1Type { get; set; }

    /// <summary>
    /// 前置网络动作集合1
    /// </summary>
    [Column("pre_net_actions1", TypeName = "jsonb")]
    public List<Guid>? PreNetActions1 { get; set; }

    /// <summary>
    /// 后置动作类型1
    /// </summary>
    [Column("post_action1_type")]
    public ActionType? PostAction1Type { get; set; }

    /// <summary>
    /// 后置网络动作集合1
    /// </summary>
    [Column("post_net_actions1", TypeName = "jsonb")]
    public List<Guid>? PostNetActions1 { get; set; }

    /// <summary>
    /// 前置动作类型2
    /// </summary>
    [Column("pre_action2_type")]
    public ActionType? PreAction2Type { get; set; }

    /// <summary>
    /// 前置网络动作集合2
    /// </summary>
    [Column("pre_net_actions2", TypeName = "jsonb")]
    public List<Guid>? PreNetActions2 { get; set; }

    /// <summary>
    /// 后置动作类型2
    /// </summary>
    [Column("post_action2_type")]
    public ActionType? PostAction2Type { get; set; }

    /// <summary>
    /// 后置网络动作集合2
    /// </summary>
    [Column("post_net_actions2", TypeName = "jsonb")]
    public List<Guid>? PostNetActions2 { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column("created_at", TypeName = "timestamp")]
    public DateTime? CreatedAt { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [Column("updated_at", TypeName = "timestamp")]
    public DateTime? UpdatedAt { get; set; }

    #region 导航属性

    /// <summary>
    /// 任务步骤导航属性
    /// </summary>
    [ForeignKey(nameof(StepId))]
    public virtual TaskStep? Step { get; set; }

    /// <summary>
    /// 步骤动作列表
    /// </summary>
    public virtual ICollection<StepAction> Actions { get; set; } = new List<StepAction>();


    #endregion
}