Add Sleeves Calculator service
This commit is contained in:
parent
a9d7ac710e
commit
2c44c5d2df
@ -25,6 +25,7 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
|
||||
.AddSingleton<IAddInConfiguration, AddInConfiguration>()
|
||||
.AddSingleton<IDatabaseClient, DatabaseClient>()
|
||||
.AddSingleton<ICurrencyClient, CurrencyClient>()
|
||||
.AddSingleton<ISleevesCaluculator, SleevesCalculator>()
|
||||
.AddTransient<IFileDialog, FileDialog>();
|
||||
|
||||
Services.AddSingleton<WriterFactory>();
|
||||
|
6
RhSolutions.AddIn/Services/ISleevesCaluculator.cs
Normal file
6
RhSolutions.AddIn/Services/ISleevesCaluculator.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace RhSolutions.Services;
|
||||
|
||||
public interface ISleevesCaluculator
|
||||
{
|
||||
public Dictionary<Product, double> CalculateSleeves(Dictionary<Product, double> products);
|
||||
}
|
13
RhSolutions.AddIn/Services/SleevesCalculator.cs
Normal file
13
RhSolutions.AddIn/Services/SleevesCalculator.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace RhSolutions.Services;
|
||||
|
||||
public class SleevesCalculator : ISleevesCaluculator
|
||||
{
|
||||
public Dictionary<Product, double> CalculateSleeves(Dictionary<Product, double> products)
|
||||
{
|
||||
int counter = products.Where(kvp => kvp.Key.ProductLines.Contains("RAUTITAN")).Count();
|
||||
return new Dictionary<Product, double>()
|
||||
{
|
||||
[new Product("11600011001")] = counter
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user