-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from ARKlab/feature/18962-AddUpdateDerivedCurv…
…eCfg feat(updatederivedcfg): Added UpdateDerivedCfg
- Loading branch information
Showing
15 changed files
with
308 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Artesian/Artesian.SDK/Dto/MarketData/MarketDataEntityInputExt.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Artesian.SDK.Dto.DerivedCfg; | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Artesian.SDK.Dto.MarketData | ||
{ | ||
internal static class MarketDataEntityInputExt | ||
{ | ||
public static void ValidateRegister(this MarketDataEntity.Input marketDataEntityInput) | ||
{ | ||
if (marketDataEntityInput.MarketDataId != 0) | ||
throw new ArgumentException("MarketDataId must be 0", nameof(marketDataEntityInput)); | ||
|
||
if (marketDataEntityInput.Type == MarketDataType.MarketAssessment && marketDataEntityInput.TransformID != null) | ||
throw new ArgumentException("No transform possible when Type is MarketAssessment", nameof(marketDataEntityInput)); | ||
} | ||
|
||
public static void ValidateUpdate(this MarketDataEntity.Input marketDataEntityInput) | ||
{ | ||
if (marketDataEntityInput.Type == MarketDataType.MarketAssessment && marketDataEntityInput.TransformID != null) | ||
throw new ArgumentException("No transform possible when Type is MarketAssessment", nameof(marketDataEntityInput)); | ||
|
||
if (marketDataEntityInput.Type == MarketDataType.MarketAssessment && marketDataEntityInput.AggregationRule != AggregationRule.Undefined) | ||
throw new ArgumentException("Aggregation Rule must be Undefined if Type is MarketAssessment", nameof(marketDataEntityInput)); | ||
} | ||
|
||
public static void ValidateDerivedCfg(this MarketDataEntity.Output marketDataEntityOutput, DerivedCfgBase derivedCfg) | ||
{ | ||
if (marketDataEntityOutput.DerivedCfg == null) | ||
throw new ArgumentException("Derived Configuration is null for the MarketData selected", nameof(marketDataEntityOutput)); | ||
|
||
if (marketDataEntityOutput.DerivedCfg.DerivedAlgorithm != derivedCfg.DerivedAlgorithm) | ||
throw new ArgumentException("Derived Algorithm is different from the one in the update", nameof(marketDataEntityOutput)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.