Processing fixes
This commit is contained in:
@@ -107,21 +107,21 @@ namespace WebAPI.dataProcessors
|
||||
|
||||
List<Record> allRecords = dataSources
|
||||
.SelectMany(x => x.Records!).ToList();
|
||||
List<Record> allRecordsValidation = dataSources
|
||||
.SelectMany(x => x.Records!).ToList();
|
||||
foreach (Record baseRecord in dataSources.Last()?.Records!)
|
||||
List<string> baseCodess = allRecords.Select(x => x.Code!.Remove(0, 1)).Distinct().ToList();
|
||||
|
||||
foreach (string baseCode in baseCodess)
|
||||
{
|
||||
|
||||
List<Record> codeRecords = allRecords.Where(x =>
|
||||
x.Code!.Substring(1) == baseRecord.Code!.Substring(1))
|
||||
x.Code!.Substring(1) == baseCode)
|
||||
.ToList();
|
||||
List<Record> codeRecordsValidation = allRecords.Where(x =>
|
||||
x.Code!.Substring(1) == baseRecord.Code!.Substring(1))
|
||||
x.Code!.Substring(1) == baseCode)
|
||||
.ToList();
|
||||
Record processedRecord = new Record
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Code = $"9{baseRecord.Code!.Remove(0,1)}",
|
||||
Code = $"9{baseCode}",
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
ModifiedAt = DateTime.UtcNow
|
||||
};
|
||||
@@ -138,7 +138,7 @@ namespace WebAPI.dataProcessors
|
||||
ProcessHelper.getValue(processedRecord,i) !=
|
||||
ProcessHelper.getValue(validationRecord, i))
|
||||
{
|
||||
throw new Exception($"ValidationError: Code {baseRecord.Code!}, " +
|
||||
throw new Exception($"ValidationError: Code {baseCode!}, " +
|
||||
$"Value{i} ({ProcessHelper.getValue(processedRecord, i)} | " +
|
||||
$"{ProcessHelper.getValue(validationRecord, i)})");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user