-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Globalization; | ||
using System.Text.Json; | ||
using Api.Controllers.Models; | ||
using Api.Database.Models; | ||
using Api.Utilities; | ||
using Microsoft.Identity.Abstractions; | ||
namespace Api.Services.MissionLoaders | ||
{ | ||
public class EchoAndCustomMissionLoader( | ||
IEchoService echoService, | ||
ISourceService sourceService, | ||
ILogger<EchoAndCustomMissionLoader> logger) : IMissionLoader | ||
Check warning on line 12 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / build_backend
Check warning on line 12 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / build_backend
Check failure on line 12 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / test_backend
|
||
{ | ||
public async Task<IQueryable<MissionDefinition>> GetAvailableMissions(string? installationCode) | ||
{ | ||
return await echoService.GetAvailableMissions(installationCode); | ||
} | ||
|
||
public async Task<MissionDefinition?> GetMissionById(string sourceMissionId) | ||
{ | ||
//TODO: | ||
// If source = custom | ||
// getCustomMission | ||
// Else: | ||
return await echoService.GetMissionById(sourceMissionId); | ||
} | ||
|
||
|
||
public async Task<List<MissionTask>> GetTasksForMission(string missionSourceId) | ||
{ | ||
//TODO: | ||
// If source = custom | ||
// getTasksForCustomMission | ||
// Else: | ||
return await sourceService.GetMissionTasksFromSourceId(missionSourceId); | ||
Check warning on line 35 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / build_backend
Check warning on line 35 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / build_backend
Check failure on line 35 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / test_backend
|
||
return await echoService.GetTasksForMission(missionSourceId); | ||
Check warning on line 36 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / build_backend
Check warning on line 36 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / build_backend
Check failure on line 36 in backend/api/Services/MissionLoaders/EchoAndCustomMissionLoader.cs GitHub Actions / test_backend
|
||
} | ||
|
||
public async Task<List<PlantInfo>> GetPlantInfos() | ||
{ | ||
return await echoService.GetPlantInfos(); | ||
} | ||
} | ||
} |