using e_suite.Database.Core.Extensions;
using e_suite.Database.Core.Models;
using e_suite.Database.Core.Tables.Activity;
using eSuite.Core.Miscellaneous;
using eSuite.Core.Workflow;

namespace e_suite.API.Common;

public class GetAssignment : IGeneralId
{
    public GetAssignment()
    {

    }

    public GetAssignment(ActivityAssignment assignment)
    {
        Id = assignment.Id;
        Guid = assignment.Guid;
        StartDateTime = assignment.StartDateTime;
        Raci = assignment.Raci;
        AllowNoVerdict = assignment.AllowNoVerdict;
        Outcomes = assignment.Outcomes;
        RoleId = assignment.Role.ToGeneralIdRef();
        UserId = assignment.User.ToGeneralIdRef();
        Comments = assignment.Comments;
    }
    public long Id { get; set; }
    public Guid Guid { get; set; }
    public DateTimeOffset? StartDateTime { get; set; }
    public Raci Raci { get; set; }
    public bool AllowNoVerdict { get; set; }
    public List<string> Outcomes { get; set; }
    public GeneralIdRef? RoleId { get; set; }
    public GeneralIdRef? UserId { get; set; }
    public string Comments { get; set; }
}

public class GetTask : IGeneralId
{
    public GetTask()
    {

    }

    public GetTask(ActivityTask task)
    {
        Id = task.Id;
        Guid = task.Guid;
        TaskName = task.TaskName;
        TaskType = task.TaskType;
        TaskGuid = task.TaskGuid;
    }

    public long Id { get; set; }
    public Guid Guid { get; set; }
    public string TaskName { get; set; }
    public string TaskType { get; set; }
    public Guid TaskGuid { get; set; }
}

public class GetActivity : IGeneralId
{
    public GetActivity()
    {

    }

    public GetActivity(Activity activity)
    {
        Id = activity.Id;
        Guid = activity.Guid;
        Name = activity.Name;
        WorkflowVersionId = activity.WorkflowVersionId;
    }

    public long Id { get; set; }
    public Guid Guid { get; set; }
    public string Name { get; set; }
    public long WorkflowVersionId { get; set; }
}

public class AssignmentDetails
{
    public GetAssignment Assignment { get; set; }
    public GetTask Task { get; set; }
    public object Activity { get; set; }
    public GetWorkflowTemplateVersion WorkflowTemplateVersion { get; set; }
}