refactor: make exporting consistent

This commit is contained in:
Gary Sharp
2025-02-06 19:14:36 +11:00
parent f946f3250c
commit 67f1c2a5d1
69 changed files with 908 additions and 921 deletions
@@ -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")]
@@ -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,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>();