Browse Source

Got Logikal BOM Import Working

Frank van den Bos 1 week ago
parent
commit
4c4a6c511d

+ 8 - 0
InABox.Logikal/Classes/ILogikalFinish.cs

@@ -0,0 +1,8 @@
+namespace InABox.Logikal
+{
+    public interface ILogikalFinish
+    {
+        string Code { get; set; }
+        string Description { get; set; }
+    }
+}

+ 1 - 0
InABox.Logikal/Classes/ILogikalProfile.cs

@@ -1,5 +1,6 @@
 namespace InABox.Logikal
 {
+
     public interface ILogikalProfile : ILogikalBOMItem
     {
 

+ 4 - 1
InABox.Logikal/Requests/AbstractLogikalPartsRequest.cs

@@ -6,6 +6,8 @@ namespace InABox.Logikal
     {
        
         public Guid ProjectID { get; private set; }
+
+        public string FinishQuery { get; private set; }
                
         public string ProfileQuery { get; private set; }
 
@@ -17,9 +19,10 @@ namespace InABox.Logikal
 
         public bool IncludeExcelData { get; private set; }
 
-        protected AbstractLogikalPartsRequest(Guid projectid, string profileQuery, string componentQuery, string glassQuery, string labourQuery, bool includeExcelData)
+        protected AbstractLogikalPartsRequest(Guid projectid, string finishQuery, string profileQuery, string componentQuery, string glassQuery, string labourQuery, bool includeExcelData)
         {
             ProjectID = projectid;
+            FinishQuery = finishQuery;
             ProfileQuery = profileQuery;
             ComponentQuery = componentQuery;
             GlassQuery = glassQuery;

+ 21 - 3
InABox.Logikal/Requests/AbstractLogikalPartsResponse.cs

@@ -1,12 +1,30 @@
 namespace InABox.Logikal
 {
-    public abstract class AbstractLogikalPartsResponse<TProfile, TComponent, TGlass, TLabour> : LogikalResponse
+    public interface ILogikalPartsResponse<TFinish, TProfile, TComponent, TGlass, TLabour>
+        where TFinish : ILogikalFinish
         where TProfile : ILogikalProfile
         where TComponent : ILogikalComponent
         where TGlass : ILogikalGlass
         where TLabour : ILogikalLabour
     {
-       
+        TFinish[] Finishes { get; set; }
+        TProfile[] Profiles { get; set; }
+        TComponent[] Components { get; set; }
+        TGlass[] Glass { get; set; }
+        TLabour[] Labour { get; set; }
+        byte[] ExcelData { get; set; }
+    }
+
+    public abstract class AbstractLogikalPartsResponse<TFinish, TProfile, TComponent, TGlass, TLabour> : LogikalResponse, ILogikalPartsResponse<TFinish, TProfile, TComponent, TGlass, TLabour>
+        where TFinish : ILogikalFinish
+        where TProfile : ILogikalProfile
+        where TComponent : ILogikalComponent
+        where TGlass : ILogikalGlass
+        where TLabour : ILogikalLabour
+    {
+
+        public TFinish[] Finishes { get; set; }
+        
         public TProfile[] Profiles { get; set; }
 
         public TComponent[] Components { get; set; }
@@ -17,7 +35,7 @@
 
         public byte[] ExcelData { get; set; }
 
-        public override string ToString() => $"{Profiles?.Length ?? 0} Profiles / {Components?.Length ?? 0} Components found";
+        public override string ToString() => $"{Finishes?.Length ?? 0} Finishes / {Profiles?.Length ?? 0} Profiles / {Components?.Length ?? 0} Components / {Glass?.Length ?? 0} Glass/ {Labour?.Length ?? 0} Activities  found";
     }
 
 

+ 2 - 2
InABox.Logikal/Requests/LogikalBOMRequest.cs

@@ -10,8 +10,8 @@ namespace InABox.Logikal
 
         public Guid[] ElevationIDs { get; private set; }
 
-        public LogikalBOMRequest(Guid projectid, Guid[] elevationids, string profileQuery, string componentQuery, string glassQuery, string labourQuery, bool includeExcelData)
-        : base(projectid, profileQuery, componentQuery, glassQuery, labourQuery, includeExcelData)
+        public LogikalBOMRequest(Guid projectid, Guid[] elevationids, string finishQuery, string profileQuery, string componentQuery, string glassQuery, string labourQuery, bool includeExcelData)
+        : base(projectid, finishQuery, profileQuery, componentQuery, glassQuery, labourQuery, includeExcelData)
         { 
             ElevationIDs = elevationids;
         }

+ 2 - 1
InABox.Logikal/Requests/LogikalBOMResponse.cs

@@ -1,7 +1,8 @@
 namespace InABox.Logikal
 {
 
-    public class LogikalBOMResponse<TProfile, TComponent, TGlass, TLabour> : AbstractLogikalPartsResponse<TProfile, TComponent, TGlass, TLabour>
+    public class LogikalBOMResponse<TFinish, TProfile, TComponent, TGlass, TLabour> : AbstractLogikalPartsResponse<TFinish, TProfile, TComponent, TGlass, TLabour>
+        where TFinish : ILogikalFinish
         where TProfile : ILogikalProfile
         where TComponent : ILogikalComponent
         where TGlass : ILogikalGlass

+ 2 - 2
InABox.Logikal/Requests/LogikalElevationRequest.cs

@@ -9,8 +9,8 @@ namespace InABox.Logikal
 
         public Guid ElevationID { get; private set; }
 
-        public LogikalElevationRequest(Guid projectid, Guid elevationid, string profileQuery, string componentQuery, string glassQuery, string labourQuery, bool includeExcelData)
-        : base(projectid, profileQuery, componentQuery, glassQuery, labourQuery, includeExcelData)
+        public LogikalElevationRequest(Guid projectid, Guid elevationid, string finishQuery, string profileQuery, string componentQuery, string glassQuery, string labourQuery, bool includeExcelData)
+        : base(projectid, finishQuery, profileQuery, componentQuery, glassQuery, labourQuery, includeExcelData)
         {
             ElevationID = elevationid;
         }

+ 3 - 2
InABox.Logikal/Requests/LogikalElevationResponse.cs

@@ -2,8 +2,9 @@
 
 namespace InABox.Logikal
 {
-    public class LogikalElevationResponse<TProfile, TComponent, TGlass, TLabour> 
-        : AbstractLogikalPartsResponse<TProfile, TComponent, TGlass, TLabour>, ILogikalElevation
+    public class LogikalElevationResponse<TFinish, TProfile, TComponent, TGlass, TLabour> 
+        : AbstractLogikalPartsResponse<TFinish, TProfile, TComponent, TGlass, TLabour>, ILogikalElevation
+        where TFinish : ILogikalFinish
         where TProfile : ILogikalProfile
         where TComponent : ILogikalComponent
         where TGlass : ILogikalGlass