Regelsteuerung grafisch und per C# Templates

This commit is contained in:
2026-04-16 08:47:13 +02:00
parent d02f4abb57
commit a25e5900c7
11 changed files with 205 additions and 14 deletions
@@ -0,0 +1,33 @@
namespace TrafagSalesExporter.Services;
public class TransformationCatalog : ITransformationCatalog
{
private readonly IReadOnlyList<TransformationCatalogItem> _items;
public TransformationCatalog(IEnumerable<ITransformationStrategy> valueStrategies, IEnumerable<IRecordTransformationStrategy> recordStrategies)
{
_items = valueStrategies
.Select(x => new TransformationCatalogItem
{
Key = x.TransformationType,
RuleScope = "Value",
Description = x.Description
})
.Concat(recordStrategies.Select(x => new TransformationCatalogItem
{
Key = x.TransformationType,
RuleScope = "Record",
Description = x.Description
}))
.OrderBy(x => x.RuleScope, StringComparer.OrdinalIgnoreCase)
.ThenBy(x => x.Key, StringComparer.OrdinalIgnoreCase)
.ToList();
}
public IReadOnlyList<TransformationCatalogItem> GetAll() => _items;
public IReadOnlyList<TransformationCatalogItem> GetByScope(string ruleScope)
=> _items
.Where(x => string.Equals(x.RuleScope, ruleScope, StringComparison.OrdinalIgnoreCase))
.ToList();
}