feat: add Technicians, GoogleSheetConfig, DiscoBaseUrl to config
This commit is contained in:
@@ -1,29 +1,31 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Disco.Plugins.ServiceTracker.Models
|
namespace Disco.Plugins.ServiceTracker.Models
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Plugin configuration for custom priorities, locations, and SLA timeframes.
|
|
||||||
/// Stored as JSON in the plugin data directory.
|
|
||||||
/// </summary>
|
|
||||||
public class ServiceTrackerConfig
|
public class ServiceTrackerConfig
|
||||||
{
|
{
|
||||||
public List<PriorityLevel> Priorities { get; set; }
|
public List<PriorityLevel> Priorities { get; set; }
|
||||||
public List<DeviceLocation> Locations { get; set; }
|
public List<DeviceLocation> Locations { get; set; }
|
||||||
public List<string> StatusOptions { get; set; }
|
public List<string> StatusOptions { get; set; }
|
||||||
|
public List<TechEntry> Technicians { get; set; }
|
||||||
public bool AutoCreateTicketsForNewJobs { get; set; }
|
public bool AutoCreateTicketsForNewJobs { get; set; }
|
||||||
public string DefaultPriorityId { get; set; }
|
public string DefaultPriorityId { get; set; }
|
||||||
public string DefaultLocationId { get; set; }
|
public string DefaultLocationId { get; set; }
|
||||||
public int DashboardRefreshSeconds { get; set; }
|
public int DashboardRefreshSeconds { get; set; }
|
||||||
|
public string DiscoBaseUrl { get; set; }
|
||||||
|
public int DetailInactivitySeconds { get; set; }
|
||||||
|
public GoogleSheetConfig GoogleSheet { get; set; }
|
||||||
|
|
||||||
public ServiceTrackerConfig()
|
public ServiceTrackerConfig()
|
||||||
{
|
{
|
||||||
Priorities = new List<PriorityLevel>();
|
Priorities = new List<PriorityLevel>();
|
||||||
Locations = new List<DeviceLocation>();
|
Locations = new List<DeviceLocation>();
|
||||||
StatusOptions = new List<string>();
|
StatusOptions = new List<string>();
|
||||||
|
Technicians = new List<TechEntry>();
|
||||||
AutoCreateTicketsForNewJobs = true;
|
AutoCreateTicketsForNewJobs = true;
|
||||||
DashboardRefreshSeconds = 60;
|
DashboardRefreshSeconds = 60;
|
||||||
|
DetailInactivitySeconds = 300;
|
||||||
|
DiscoBaseUrl = "http://disco:9292";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ServiceTrackerConfig CreateDefault()
|
public static ServiceTrackerConfig CreateDefault()
|
||||||
@@ -41,28 +43,41 @@ namespace Disco.Plugins.ServiceTracker.Models
|
|||||||
Locations = new List<DeviceLocation>
|
Locations = new List<DeviceLocation>
|
||||||
{
|
{
|
||||||
new DeviceLocation { Id = "it-office", Name = "IT Office", Icon = "💻", Color = "#337AB7", IsDefault = true },
|
new DeviceLocation { Id = "it-office", Name = "IT Office", Icon = "💻", Color = "#337AB7", IsDefault = true },
|
||||||
new DeviceLocation { Id = "with-user", Name = "With User", Icon = "👤", Color = "#5CB85C", IsDefault = false },
|
new DeviceLocation { Id = "with-user", Name = "With User", Icon = "👤", Color = "#5CB85C" },
|
||||||
new DeviceLocation { Id = "at-repairer", Name = "At Repairer", Icon = "🔧", Color = "#F0AD4E", IsDefault = false },
|
new DeviceLocation { Id = "at-repairer", Name = "At Repairer", Icon = "🔧", Color = "#F0AD4E" },
|
||||||
new DeviceLocation { Id = "in-transit", Name = "In Transit", Icon = "🚚", Color = "#5BC0DE", IsDefault = false },
|
new DeviceLocation { Id = "in-transit", Name = "In Transit", Icon = "🚚", Color = "#5BC0DE" },
|
||||||
new DeviceLocation { Id = "storage", Name = "Storage/Spare Pool", Icon = "📦", Color = "#777777", IsDefault = false },
|
new DeviceLocation { Id = "storage", Name = "Storage/Spare Pool", Icon = "📦", Color = "#777777" },
|
||||||
new DeviceLocation { Id = "disposed", Name = "Disposed/Written Off", Icon = "❌", Color = "#999999", IsDefault = false }
|
new DeviceLocation { Id = "disposed", Name = "Disposed/Written Off", Icon = "❌", Color = "#999999" }
|
||||||
},
|
},
|
||||||
StatusOptions = new List<string>
|
StatusOptions = new List<string>
|
||||||
{
|
{
|
||||||
"Triaging",
|
"Triaging", "In Progress", "Awaiting Parts", "Awaiting User",
|
||||||
"In Progress",
|
"Awaiting Vendor", "On Hold", "Ready for Return", "Escalated", "Resolved"
|
||||||
"Awaiting Parts",
|
},
|
||||||
"Awaiting User",
|
Technicians = new List<TechEntry>
|
||||||
"Awaiting Vendor",
|
{
|
||||||
"On Hold",
|
new TechEntry { Id = "jess", DisplayName = "Jess Rogerson", DiscoUserIds = new List<string> { "Curric\\st00913", "Curric\\09488098" }, Email = "Jessica.Rogerson@education.vic.gov.au" },
|
||||||
"Ready for Return",
|
new TechEntry { Id = "ruby", DisplayName = "Ruby Stolica", DiscoUserIds = new List<string> { "curric\\st02201" }, Email = "Ruby.Stolica@education.vic.gov.au" },
|
||||||
"Escalated",
|
new TechEntry { Id = "gaby", DisplayName = "Gaby Aughton", DiscoUserIds = new List<string> { "Curric\\09279223" }, Email = "Gabrielle.Aughton@education.vic.gov.au" },
|
||||||
"Resolved"
|
new TechEntry { Id = "other", DisplayName = "Other", DiscoUserIds = new List<string>(), Email = "" }
|
||||||
},
|
},
|
||||||
AutoCreateTicketsForNewJobs = true,
|
AutoCreateTicketsForNewJobs = true,
|
||||||
DefaultPriorityId = "medium",
|
DefaultPriorityId = "medium",
|
||||||
DefaultLocationId = "it-office",
|
DefaultLocationId = "it-office",
|
||||||
DashboardRefreshSeconds = 60
|
DashboardRefreshSeconds = 60,
|
||||||
|
DetailInactivitySeconds = 300,
|
||||||
|
DiscoBaseUrl = "http://disco:9292",
|
||||||
|
GoogleSheet = new GoogleSheetConfig
|
||||||
|
{
|
||||||
|
Enabled = false,
|
||||||
|
SpreadsheetId = "1w9rVblDVyDMVedjx9tjuLoNv1w6_pfo8GC6R9uu8lXc",
|
||||||
|
GId = "170394795",
|
||||||
|
RefreshMinutes = 15,
|
||||||
|
ColTimestamp = 0, ColEmail = 1, ColDeviceName = 2,
|
||||||
|
ColLocation = 3, ColIssue = 4, ColPriority = 5,
|
||||||
|
ColStatus = 6, ColAssignedTo = 7,
|
||||||
|
HeaderRows = 1
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,4 +100,27 @@ namespace Disco.Plugins.ServiceTracker.Models
|
|||||||
public string Color { get; set; }
|
public string Color { get; set; }
|
||||||
public bool IsDefault { get; set; }
|
public bool IsDefault { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GoogleSheetConfig
|
||||||
|
{
|
||||||
|
public bool Enabled { get; set; }
|
||||||
|
public string SpreadsheetId { get; set; }
|
||||||
|
public string GId { get; set; }
|
||||||
|
public int RefreshMinutes { get; set; }
|
||||||
|
public int ColTimestamp { get; set; }
|
||||||
|
public int ColEmail { get; set; }
|
||||||
|
public int ColDeviceName { get; set; }
|
||||||
|
public int ColLocation { get; set; }
|
||||||
|
public int ColIssue { get; set; }
|
||||||
|
public int ColPriority { get; set; }
|
||||||
|
public int ColStatus { get; set; }
|
||||||
|
public int ColAssignedTo { get; set; }
|
||||||
|
public int HeaderRows { get; set; }
|
||||||
|
|
||||||
|
public GoogleSheetConfig()
|
||||||
|
{
|
||||||
|
RefreshMinutes = 15;
|
||||||
|
HeaderRows = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user