From 380772503c86d4a6b11b7f4a425729641256896b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 Aug 2025 04:39:01 +0000 Subject: [PATCH] Remove redundant ShiftService and use IConfigurationService directly Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> --- Server/Controllers/ShiftController.cs | 7 ++----- Server/Program.cs | 1 - Services/ShiftService.cs | 17 ----------------- 3 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 Services/ShiftService.cs diff --git a/Server/Controllers/ShiftController.cs b/Server/Controllers/ShiftController.cs index 2f146b4..9de6a11 100644 --- a/Server/Controllers/ShiftController.cs +++ b/Server/Controllers/ShiftController.cs @@ -8,20 +8,17 @@ namespace ShiftScheduler.Server.Controllers [Route("api/[controller]")] public class ShiftController : ControllerBase { - private readonly ShiftService _shiftService; private readonly IcsExportService _icsService; private readonly PdfExportService _pdfExportService; private readonly ITransportService _transportService; private readonly IConfigurationService _configurationService; public ShiftController( - ShiftService shiftService, IcsExportService icsService, PdfExportService pdfExportService, ITransportService transportService, IConfigurationService configurationService) { - _shiftService = shiftService; _icsService = icsService; _pdfExportService = pdfExportService; _transportService = transportService; @@ -31,13 +28,13 @@ namespace ShiftScheduler.Server.Controllers [HttpGet("shifts")] public IActionResult GetShifts() { - return Ok(_shiftService.GetShifts()); + return Ok(_configurationService.GetShifts()); } [HttpPost("shift_transport")] public async Task GetShiftTransport([FromBody] ShiftTransportRequest request) { - var shift = _shiftService.GetShifts().FirstOrDefault(s => s.Name == request.ShiftName); + var shift = _configurationService.GetShifts().FirstOrDefault(s => s.Name == request.ShiftName); if (shift == null) { return NotFound($"Shift '{request.ShiftName}' not found"); diff --git a/Server/Program.cs b/Server/Program.cs index 75632d7..821312d 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -18,7 +18,6 @@ var appConfiguration = new ApplicationConfiguration builder.Services.AddSingleton(new ConfigurationService(appConfiguration)); builder.Services.AddMemoryCache(); builder.Services.AddHttpClient(); -builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); diff --git a/Services/ShiftService.cs b/Services/ShiftService.cs deleted file mode 100644 index 62cead8..0000000 --- a/Services/ShiftService.cs +++ /dev/null @@ -1,17 +0,0 @@ - -using ShiftScheduler.Shared; - -namespace ShiftScheduler.Services -{ - public class ShiftService - { - private readonly IConfigurationService _configurationService; - - public ShiftService(IConfigurationService configurationService) - { - _configurationService = configurationService; - } - - public List GetShifts() => _configurationService.GetShifts(); - } -}