using Inspectron.Epson.PrintServer.PrintServices;

namespace Inspectron.Epson.PrintServer.ConfigurationSources;

public class EpsonPrintServiceConfiguration: IPrinterConfigurationSource, IAssignedPrinterRepository
{
    public string GroupId { get; set; }
    public string RestaurantId { get; set; }
    public string ApiKey { get; set; }
    public string? ApiUrl { get; set; }
    

    public Dictionary<string, PrinterConfiguration> PrinterConfigurations { get; set; }
    public PrinterConfiguration GetConfiguration(string printerAddress)
    {
     return PrinterConfigurations[printerAddress];
    }

    public string? GetAssignedPrinter(string workAreaId)
    {
        return PrinterConfigurations.Values.Where(x => x.AreaId == workAreaId).Select(x=>x.Address).FirstOrDefault();
    }
}