Files
Print_server/Inspectron.Epson/PrintServer/WorkAreaSources/JamesWorkAreaSource.cs
2026-01-14 11:47:43 +01:00

28 lines
844 B
C#

using System.Net.Http.Json;
using Inspectron.Epson.PrintServer.ConfigurationSources;
namespace Inspectron.Epson.PrintServer.WorkAreaSources;
public class JamesWorkAreaSource: IWorkAreasSource
{
private readonly EpsonPrintServiceConfiguration _configuration;
public JamesWorkAreaSource(EpsonPrintServiceConfiguration configuration)
{
_configuration = configuration;
}
public async Task<List<WorkArea>> GetWorkAreasAsync()
{
var url = $@"https://api.stage.gastrojames.ch/api/Restaurant/{_configuration.RestaurantId}/work-areas";
HttpClient client = new();
var response = await client.GetFromJsonAsync<List<WorkArea>>(url);
response.Add(new WorkArea()
{
Id = "print-receipt",
Name = "FinalReceipt"
});
return response!;
}
}