feat: add Source, DisplayId, ReadyForReturn to DashboardViewModel

This commit is contained in:
2026-05-06 14:40:00 +10:00
parent 078d1160d7
commit ce83e356c1
+10 -11
View File
@@ -3,29 +3,29 @@ using System.Collections.Generic;
namespace Disco.Plugins.ServiceTracker.Models
{
/// <summary>
/// View model for the dashboard tile display, combining Disco Job data
/// with ServiceTracker metadata.
/// </summary>
public class DashboardViewModel
{
public List<DashboardTile> Tiles { get; set; }
public List<DashboardTile> ReadyForReturn { get; set; }
public DashboardStats Stats { get; set; }
public ServiceTrackerConfig Config { get; set; }
public string CurrentFilter { get; set; }
public string SortBy { get; set; }
public string GoogleSheetError { get; set; }
public DashboardViewModel()
{
Tiles = new List<DashboardTile>();
ReadyForReturn = new List<DashboardTile>();
Stats = new DashboardStats();
}
}
public class DashboardTile
{
// From Disco Job
public int JobId { get; set; }
public string Source { get; set; }
public string DisplayId { get; set; }
public string JobTypeDescription { get; set; }
public string DeviceSerialNumber { get; set; }
public string DeviceModelDescription { get; set; }
@@ -37,8 +37,6 @@ namespace Disco.Plugins.ServiceTracker.Models
public DateTime OpenedDate { get; set; }
public DateTime? ExpectedClosedDate { get; set; }
public string DiscoStatus { get; set; }
// From ServiceTracker
public string PriorityId { get; set; }
public string PriorityName { get; set; }
public string PriorityColor { get; set; }
@@ -56,14 +54,14 @@ namespace Disco.Plugins.ServiceTracker.Models
public int NoteCount { get; set; }
public string LatestNote { get; set; }
public DateTime LastModifiedDate { get; set; }
// Computed
public bool IsSlaBreached { get; set; }
public bool IsSlaWarning { get; set; } // within 25% of SLA
public bool IsSlaWarning { get; set; }
public string AgeBadge { get; set; }
public int AgeDays { get; set; }
public string EtaDisplay { get; set; }
public DateTime SortDate { get; set; } // The date used for ordering
public DateTime SortDate { get; set; }
public DashboardTile() { Source = "disco"; }
}
public class DashboardStats
@@ -80,6 +78,7 @@ namespace Disco.Plugins.ServiceTracker.Models
public int InItOffice { get; set; }
public int WithUser { get; set; }
public int AwaitingParts { get; set; }
public int FromGoogleSheet { get; set; }
public double AvgAgeDays { get; set; }
public int OldestJobDays { get; set; }
public Dictionary<string, int> ByPriority { get; set; }