using Hotline.FlowEngine.Definitions;
using SqlSugar;
using XF.Domain.Repository;

namespace Hotline.FlowEngine.WorkflowModules;

/// <summary>
/// 工作流业务模块
/// </summary>
public class WorkflowModule : CreationEntity
{
    public WorkflowModule()
    {

    }

    public WorkflowModule(string code, string name, string remark = "")
    {
        this.Code = code;
        this.Name = name;
        this.Remark = remark;
    }

    /// <summary>
    /// WorkflowModuleConsts约定code
    /// </summary>
    public string Code { get; set; }

    public string Name { get; set; }

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

    /// <summary>
    /// 流程模板Id
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public string? DefinitionId { get; set; }

    [Navigate(NavigateType.OneToOne, nameof(DefinitionId))]
    public WorkflowDefinition? Definition { get; set; }

    ///// <summary>
    ///// 模板名称（冗余）
    ///// </summary>
    //[SugarColumn(IsNullable = true)]
    //public string? DefinitionName { get; set; }

    ///// <summary>
    ///// 模板编码（冗余）
    ///// </summary>
    //[SugarColumn(IsNullable = true)]
    //public string? DefinitionCode { get; set; }

    ///// <summary>
    ///// 模板版本号（冗余）
    ///// </summary>
    //public int? DefinitionVersion { get; set; }
}