using e_suite.Database.Core.Models;

namespace e_suite.API.Common;

public class GetWorkflowTemplate : IGeneralId
{
    public GetWorkflowTemplate( Database.Core.Tables.Workflow.Workflow workflow)
    {
        Id = workflow.Id;
        Guid = workflow.Guid;
        WorkflowName = workflow.Name;
        Version = workflow.Versions.Max(x => x.Version);
        Deleted = workflow.Deleted;
        LastUpdated = workflow.LastUpdated;
    }

    public long Version { get; set; }

    public DateTimeOffset LastUpdated { get; set; }

    public bool Deleted { get; set; }

    public string WorkflowName { get; set; }

    public Guid Guid { get; set; }

    public long Id { get; set; }
}