aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs1
-rw-r--r--RhSolutions.AddIn/Services/ISleevesCaluculator.cs6
-rw-r--r--RhSolutions.AddIn/Services/SleevesCalculator.cs13
3 files changed, 20 insertions, 0 deletions
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<IAddInConfiguration, AddInConfiguration>()
.AddSingleton<IDatabaseClient, DatabaseClient>()
.AddSingleton<ICurrencyClient, CurrencyClient>()
+ .AddSingleton<ISleevesCaluculator, SleevesCalculator>()
.AddTransient<IFileDialog, FileDialog>();
Services.AddSingleton<WriterFactory>();
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<Product, double> CalculateSleeves(Dictionary<Product, double> 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<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
+ };
+ }
+}