| | 1 | | using LGDXRobotCloud.Data.Models.DTOs.V1.Responses; |
| | 2 | |
|
| | 3 | | namespace LGDXRobotCloud.Data.Models.Business.Automation; |
| | 4 | |
|
| | 5 | | public record AutoTaskStatisticsBusinessModel |
| | 6 | | { |
| 0 | 7 | | public int WaitingTasks { get; set; } = 0; |
| 0 | 8 | | public int RunningTasks { get; set; } = 0; |
| 0 | 9 | | public int CompletedTasks { get; set; } = 0; |
| 0 | 10 | | public int AbortedTasks { get; set; } = 0; |
| 0 | 11 | | public List<int> WaitingTasksTrend { get; set; } = []; |
| 0 | 12 | | public List<int> RunningTasksTrend { get; set; } = []; |
| 0 | 13 | | public List<int> CompletedTasksTrend { get; set; } = []; |
| 0 | 14 | | public List<int> AbortedTasksTrend { get; set; } = []; |
| 0 | 15 | | public DateTime LastUpdatedAt { get; set; } = DateTime.Now; |
| | 16 | | } |
| | 17 | |
|
| | 18 | | public static class AutoTaskStatisticsBusinessModelExtensions |
| | 19 | | { |
| | 20 | | public static AutoTaskStatisticsDto ToDto(this AutoTaskStatisticsBusinessModel model) |
| | 21 | | { |
| | 22 | | return new AutoTaskStatisticsDto |
| | 23 | | { |
| | 24 | | WaitingTasks = model.WaitingTasks, |
| | 25 | | RunningTasks = model.RunningTasks, |
| | 26 | | CompletedTasks = model.CompletedTasks, |
| | 27 | | AbortedTasks = model.AbortedTasks, |
| | 28 | | WaitingTasksTrend = model.WaitingTasksTrend, |
| | 29 | | RunningTasksTrend = model.RunningTasksTrend, |
| | 30 | | CompletedTasksTrend = model.CompletedTasksTrend, |
| | 31 | | AbortedTasksTrend = model.AbortedTasksTrend, |
| | 32 | | LastUpdatedAt = model.LastUpdatedAt, |
| | 33 | | }; |
| | 34 | | } |
| | 35 | | } |