From ce83e356c1fa65f4948c8a72f14409577025cc0b Mon Sep 17 00:00:00 2001 From: jessikitty Date: Wed, 6 May 2026 14:40:00 +1000 Subject: [PATCH] feat: add Source, DisplayId, ReadyForReturn to DashboardViewModel --- Models/DashboardViewModel.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Models/DashboardViewModel.cs b/Models/DashboardViewModel.cs index 020c7e3..f0bb8e6 100644 --- a/Models/DashboardViewModel.cs +++ b/Models/DashboardViewModel.cs @@ -3,29 +3,29 @@ using System.Collections.Generic; namespace Disco.Plugins.ServiceTracker.Models { - /// - /// View model for the dashboard tile display, combining Disco Job data - /// with ServiceTracker metadata. - /// public class DashboardViewModel { public List Tiles { get; set; } + public List 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(); + ReadyForReturn = new List(); 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 ByPriority { get; set; }