refactor: make exporting consistent
This commit is contained in:
+4
-6
@@ -2,17 +2,15 @@
|
||||
using Disco.Models.Services.Exporting;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Models.Services.Devices.Exporting
|
||||
namespace Disco.Models.Services.Devices
|
||||
{
|
||||
public class DeviceExportOptions : IExportOptions
|
||||
{
|
||||
public int Version { get; set; } = 1;
|
||||
public ExportFormat Format { get; set; }
|
||||
|
||||
public DeviceExportTypes ExportType { get; set; }
|
||||
public int? ExportTypeTargetId { get; set; }
|
||||
|
||||
public ExportFormat Format { get; set; }
|
||||
public string FilenamePrefix { get; } = "DiscoDeviceExport";
|
||||
public string ExcelWorksheetName { get; } = "DeviceExport";
|
||||
public string ExcelTableName { get; } = "Devices";
|
||||
|
||||
// Device
|
||||
[Display(ShortName = "Device", Name = "Serial Number", Description = "The device serial number")]
|
||||
+1
-1
@@ -4,7 +4,7 @@ using Disco.Models.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.Services.Devices.Exporting
|
||||
namespace Disco.Models.Services.Devices
|
||||
{
|
||||
public class DeviceExportRecord : IExportRecord
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Disco.Models.Services.Devices.Exporting
|
||||
namespace Disco.Models.Services.Devices
|
||||
{
|
||||
public enum DeviceExportTypes
|
||||
{
|
||||
@@ -7,10 +7,8 @@ namespace Disco.Models.Services.Devices.DeviceFlag
|
||||
{
|
||||
public class DeviceFlagExportOptions : IExportOptions
|
||||
{
|
||||
public int Version { get; set; } = 1;
|
||||
public ExportFormat Format { get; set; }
|
||||
public string FilenamePrefix { get; } = "DiscoDeviceFlagExport";
|
||||
public string ExcelWorksheetName { get; } = "DeviceFlagExport";
|
||||
public string ExcelTableName { get; } = "DeviceFlags";
|
||||
|
||||
[Required]
|
||||
public List<int> DeviceFlagIds { get; set; } = new List<int>();
|
||||
|
||||
+4
-6
@@ -4,10 +4,13 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Models.Services.Jobs.Exporting
|
||||
namespace Disco.Models.Services.Jobs
|
||||
{
|
||||
public class JobExportOptions : IExportOptions
|
||||
{
|
||||
public int Version { get; set; } = 1;
|
||||
public ExportFormat Format { get; set; }
|
||||
|
||||
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, HtmlEncode = false)]
|
||||
public DateTime FilterStartDate { get; set; }
|
||||
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, HtmlEncode = false)]
|
||||
@@ -17,11 +20,6 @@ namespace Disco.Models.Services.Jobs.Exporting
|
||||
public List<string> FilterJobSubTypeIds { get; set; }
|
||||
public int? FilterJobQueueId { get; set; }
|
||||
|
||||
public ExportFormat Format { get; set; }
|
||||
public string FilenamePrefix { get; } = "DiscoJobExport";
|
||||
public string ExcelWorksheetName { get; } = "JobExport";
|
||||
public string ExcelTableName { get; } = "Jobs";
|
||||
|
||||
// Job
|
||||
[Display(ShortName = "Job", Name = "Identifier", Description = "The identifier of the job")]
|
||||
public bool JobId { get; set; }
|
||||
+1
-1
@@ -3,7 +3,7 @@ using Disco.Models.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.Services.Jobs.Exporting
|
||||
namespace Disco.Models.Services.Jobs
|
||||
{
|
||||
public class JobExportRecord : IExportRecord
|
||||
{
|
||||
@@ -0,0 +1,19 @@
|
||||
using Disco.Models.Exporting;
|
||||
using Disco.Models.Services.Exporting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.Services.Logging
|
||||
{
|
||||
public class LogExportOptions : IExportOptions
|
||||
{
|
||||
public int Version { get; set; } = 1;
|
||||
public ExportFormat Format { get; set; }
|
||||
|
||||
public DateTime? StartDate { get; set; }
|
||||
public DateTime? EndDate { get; set; }
|
||||
public int? ModuleId { get; set; }
|
||||
public List<int> EventTypeIds { get; set; }
|
||||
public int? Take { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,8 @@ namespace Disco.Models.Services.Users.UserFlags
|
||||
{
|
||||
public class UserFlagExportOptions : IExportOptions
|
||||
{
|
||||
public int Version { get; set; } = 1;
|
||||
public ExportFormat Format { get; set; }
|
||||
public string FilenamePrefix { get; } = "DiscoUserFlagExport";
|
||||
public string ExcelWorksheetName { get; } = "UserFlagExport";
|
||||
public string ExcelTableName { get; } = "UserFlags";
|
||||
|
||||
[Required]
|
||||
public List<int> UserFlagIds { get; set; } = new List<int>();
|
||||
|
||||
Reference in New Issue
Block a user