This commit is contained in:
2025-11-09 02:08:31 +07:00
parent 1ed58d1a98
commit 7dba29c66f
57 changed files with 8362 additions and 359 deletions

View File

@@ -0,0 +1,37 @@
using Managing.Domain.Backtests;
namespace Managing.Api.Models.Responses;
/// <summary>
/// Response model for backtest job status
/// </summary>
public class BacktestJobStatusResponse
{
public Guid JobId { get; set; }
public string Status { get; set; } = string.Empty;
public int ProgressPercentage { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? StartedAt { get; set; }
public DateTime? CompletedAt { get; set; }
public string? ErrorMessage { get; set; }
public LightBacktest? Result { get; set; }
}
/// <summary>
/// Response model for bundle backtest status
/// </summary>
public class BundleBacktestStatusResponse
{
public Guid BundleRequestId { get; set; }
public string Status { get; set; } = string.Empty;
public int TotalJobs { get; set; }
public int CompletedJobs { get; set; }
public int FailedJobs { get; set; }
public int RunningJobs { get; set; }
public int PendingJobs { get; set; }
public double ProgressPercentage { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? CompletedAt { get; set; }
public string? ErrorMessage { get; set; }
}

View File

@@ -0,0 +1,79 @@
#nullable enable
namespace Managing.Api.Models.Responses;
/// <summary>
/// Response model for paginated jobs list
/// </summary>
public class PaginatedJobsResponse
{
public List<JobListItemResponse> Jobs { get; set; } = new();
public int TotalCount { get; set; }
public int CurrentPage { get; set; }
public int PageSize { get; set; }
public int TotalPages { get; set; }
public bool HasNextPage { get; set; }
public bool HasPreviousPage { get; set; }
}
/// <summary>
/// Response model for a job list item (summary view)
/// </summary>
public class JobListItemResponse
{
public Guid JobId { get; set; }
public string Status { get; set; } = string.Empty;
public string JobType { get; set; } = string.Empty;
public int ProgressPercentage { get; set; }
public int Priority { get; set; }
public int UserId { get; set; }
public Guid? BundleRequestId { get; set; }
public string? GeneticRequestId { get; set; }
public string? AssignedWorkerId { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? StartedAt { get; set; }
public DateTime? CompletedAt { get; set; }
public DateTime? LastHeartbeat { get; set; }
public string? ErrorMessage { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
/// <summary>
/// Response model for job summary statistics
/// </summary>
public class JobSummaryResponse
{
public List<JobStatusSummary> StatusSummary { get; set; } = new();
public List<JobTypeSummary> JobTypeSummary { get; set; } = new();
public List<JobStatusTypeSummary> StatusTypeSummary { get; set; } = new();
public int TotalJobs { get; set; }
}
/// <summary>
/// Summary of jobs by status
/// </summary>
public class JobStatusSummary
{
public string Status { get; set; } = string.Empty;
public int Count { get; set; }
}
/// <summary>
/// Summary of jobs by job type
/// </summary>
public class JobTypeSummary
{
public string JobType { get; set; } = string.Empty;
public int Count { get; set; }
}
/// <summary>
/// Summary of jobs by status and job type combination
/// </summary>
public class JobStatusTypeSummary
{
public string Status { get; set; } = string.Empty;
public string JobType { get; set; } = string.Empty;
public int Count { get; set; }
}