diff --git a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs index b0ad869..6bb1b25 100644 --- a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs +++ b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs @@ -25,6 +25,7 @@ public sealed class RhSolutionsAddIn : IExcelAddIn .AddSingleton() .AddSingleton() .AddSingleton() + .AddSingleton() .AddTransient(); Services.AddSingleton(); diff --git a/RhSolutions.AddIn/Services/ISleevesCaluculator.cs b/RhSolutions.AddIn/Services/ISleevesCaluculator.cs new file mode 100644 index 0000000..371427f --- /dev/null +++ b/RhSolutions.AddIn/Services/ISleevesCaluculator.cs @@ -0,0 +1,6 @@ +namespace RhSolutions.Services; + +public interface ISleevesCaluculator +{ + public Dictionary CalculateSleeves(Dictionary products); +} diff --git a/RhSolutions.AddIn/Services/SleevesCalculator.cs b/RhSolutions.AddIn/Services/SleevesCalculator.cs new file mode 100644 index 0000000..0c58f35 --- /dev/null +++ b/RhSolutions.AddIn/Services/SleevesCalculator.cs @@ -0,0 +1,13 @@ +namespace RhSolutions.Services; + +public class SleevesCalculator : ISleevesCaluculator +{ + public Dictionary CalculateSleeves(Dictionary products) + { + int counter = products.Where(kvp => kvp.Key.ProductLines.Contains("RAUTITAN")).Count(); + return new Dictionary() + { + [new Product("11600011001")] = counter + }; + } +}