| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using OzonOrdersWeb.Areas.Studio2.ViewModels.HangfireQueue; |
| | | 3 | | |
| | | 4 | | namespace OzonOrdersWeb.ViewModels.JobViewModels |
| | | 5 | | { |
| | | 6 | | public class JobResultViewModel |
| | | 7 | | { |
| | | 8 | | public List<string> Results { get; set; } = new(); |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Состояние настроенных Hangfire RecurringJobs (поставлено/не поставлено, последний/следующий запуск). |
| | | 12 | | /// </summary> |
| | | 13 | | public List<JobScheduleViewModel> Schedules { get; set; } = new(); |
| | | 14 | | |
| | | 15 | | /// <summary>Активная вкладка на странице Job: schedules / queue / results.</summary> |
| | | 16 | | public string ActivePageTab { get; set; } = "schedules"; |
| | | 17 | | |
| | | 18 | | /// <summary>Состояние вкладки очереди Hangfire (как на /HangfireQueue).</summary> |
| | | 19 | | public HangfireJobsViewModel HangfireQueue { get; set; } = new(); |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Состояние разового обновления статусов по периоду (UpdateStatusesByProcessingDateBackground). |
| | | 23 | | /// processing/enqueued/null. |
| | | 24 | | /// </summary> |
| | | 25 | | public string PeriodStatusUpdateState { get; set; } = string.Empty; |
| | | 26 | | public string PeriodStatusUpdateJobId { get; set; } = string.Empty; |
| | | 27 | | public DateTime? PeriodStatusUpdateStartedAtUtc { get; set; } |
| | | 28 | | } |
| | | 29 | | |
| | | 30 | | public class JobScheduleViewModel |
| | | 31 | | { |
| | | 32 | | /// <summary>Ключ для UI (логическое имя задачи).</summary> |
| | 0 | 33 | | public string Key { get; set; } = string.Empty; |
| | 0 | 34 | | public string Title { get; set; } = string.Empty; |
| | | 35 | | |
| | 0 | 36 | | public bool IsConfigured { get; set; } |
| | 0 | 37 | | public string RecurringJobId { get; set; } = string.Empty; |
| | 0 | 38 | | public string Cron { get; set; } = string.Empty; |
| | | 39 | | |
| | 0 | 40 | | public DateTime? LastExecutionUtc { get; set; } |
| | 0 | 41 | | public DateTime? NextExecutionUtc { get; set; } |
| | | 42 | | |
| | 0 | 43 | | public string LastJobId { get; set; } = string.Empty; |
| | 0 | 44 | | public string LastJobState { get; set; } = string.Empty; |
| | 0 | 45 | | public object[] Args { get; set; } = Array.Empty<object>(); |
| | | 46 | | } |
| | | 47 | | } |