using Hcs.Broker;
using Hcs.WebApp.BackgroundServices.ResultGetters.Nsi;
using Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon;
using Hcs.WebApp.Data.Hcs;

namespace Hcs.WebApp.BackgroundServices.ResultGetters
{
    public class ResultGetterFactory
    {
        public IResultGetter CreateResultGetter(IServiceScope scope, IClient client, Operation operation)
        {
            return operation.Type switch
            {
                Operation.OperationType.Nsi_ExportNsiItem_15_7_0_1 => new ExportDataProviderNsiItemGetter_15_7_0_1(client, scope, operation),
                Operation.OperationType.NsiCommon_ExportNsiItem_15_7_0_1 => new ExportNsiItemGetter_15_7_0_1(client, scope, operation),

                _ => throw new NotImplementedException($"Не удалось создать получателя результата операции типа {operation.Type}"),
            };
        }
    }

}
