using e_suite.Database.Core.Extensions;
using e_suite.Database.Core.Models;
using eSuite.Core.Miscellaneous;

namespace e_suite.API.Common;

public class GetMyAssignments : IGeneralId
{
    public GetMyAssignments( Database.Core.Tables.Activity.ActivityAssignment assignment)
    {
        Id = assignment.Id;
        Guid = assignment.Guid;
        User = assignment.User?.ToGeneralIdRef();
        Role = assignment.Role?.ToGeneralIdRef();
        TaskType = assignment.Task.TaskType;
        TaskName = assignment.Task.TaskName;
        ActivityId = assignment.Task.Activity.ToGeneralIdRef();
        ActivityName = assignment.Task.Activity.Name;
        StartDateTime = assignment.StartDateTime;
    }
    
    public long Id { get; set; }
    public Guid Guid { get; set; }

    public string TaskType { get; set; }
    public string TaskName { get; set; }
    public GeneralIdRef ActivityId { get; set; }
    public string ActivityName { get; set; }
    public GeneralIdRef? User { get; set; }

    public GeneralIdRef? Role { get; set; }
    public DateTimeOffset? StartDateTime { get; set; }
}