Skip to content

Commit

Permalink
add class coumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Dec 19, 2024
1 parent 0bb6067 commit 05f1721
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
31 changes: 19 additions & 12 deletions Rdmp.Core/DataQualityEngine/Reports/CatalogueConstraintReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public void UpdateReport(ICatalogue c, int dataLoadID, IDataLoadEventListener li

//new pivoutCategories coming in
var newIncomingPivotCategories = incomingPivotCategories.Where(c => !previousCategories.Contains(c));
List<ColumnState> ColumnStates = [];


var pivotColumnInfo = _catalogue.CatalogueItems.Where(ci => ci.Name == _pivotCategory).FirstOrDefault();
Expand Down Expand Up @@ -279,6 +280,13 @@ public void UpdateReport(ICatalogue c, int dataLoadID, IDataLoadEventListener li
results.TryGetValue(Consequence.Wrong, out int wrong);
results.TryGetValue(Consequence.InvalidatesRow, out int invalidatesRow);
evaluation.AddRowState((int)_dataLoadID, correct, mising, wrong, invalidatesRow, _catalogue.ValidatorXML, newCategory, con.Connection, con.Transaction);

incomingState.AllColumnStates.TryGetValue((int)_dataLoadID, out ColumnState[] columnStates);
foreach (var columnState in columnStates)
{
columnState.Commit(evaluation, newCategory, con.Connection, con.Transaction);
ColumnStates.Add(columnState);
}
}
//Updates
if (existingIncomingPivotCategories.Any())
Expand Down Expand Up @@ -342,7 +350,6 @@ public void UpdateReport(ICatalogue c, int dataLoadID, IDataLoadEventListener li

}
//* Column States *//
List<ColumnState> ColumnStates = [];
//unchanged
foreach (var previousColumnState in previousColumnStates.Where(rs => rs.PivotCategory != "ALL" && !existingIncomingPivotCategories.Contains(rs.PivotCategory) && !replacedPivotCategories.Contains(rs.PivotCategory)))
{
Expand All @@ -358,16 +365,16 @@ public void UpdateReport(ICatalogue c, int dataLoadID, IDataLoadEventListener li
ColumnStates.Add(cm);
}
//new stuff
foreach (var newCategory in newIncomingPivotCategories)
{
newByPivotRowStatesOverDataLoadRunId.TryGetValue(newCategory, out DQEStateOverDataLoadRunId incomingState);
incomingState.AllColumnStates.TryGetValue((int)_dataLoadID, out ColumnState[] columnStates);
foreach (var columnState in columnStates)
{
columnState.Commit(evaluation, newCategory, con.Connection, con.Transaction);
ColumnStates.Add(columnState);
}
}
//foreach (var newCategory in newIncomingPivotCategories)
//{
// newByPivotRowStatesOverDataLoadRunId.TryGetValue(newCategory, out DQEStateOverDataLoadRunId incomingState);
// incomingState.AllColumnStates.TryGetValue((int)_dataLoadID, out ColumnState[] columnStates);
// foreach (var columnState in columnStates)
// {
// columnState.Commit(evaluation, newCategory, con.Connection, con.Transaction);
// ColumnStates.Add(columnState);
// }
//}
//updates
if (existingIncomingPivotCategories.Any())
{
Expand Down Expand Up @@ -492,7 +499,7 @@ public void UpdateReport(ICatalogue c, int dataLoadID, IDataLoadEventListener li
updatedRowsReportBuilder.BuildReportInternals(cancellationToken, forker, dqeRepository);
var cc = updatedRowsReportBuilder.GetByPivotCategoryCubesOverTime();
foreach (var category in cc.Keys)
{
{
var hyperCube = cc[category].GetHyperCube();
foreach (var year in hyperCube.Keys)
{
Expand Down
9 changes: 8 additions & 1 deletion Rdmp.Core/DataQualityEngine/Reports/ReportBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using FAnsi.Discovery;
// Copyright (c) The University of Dundee 2024-2024
// This file is part of the Research Data Management Platform (RDMP).
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
using Rdmp.Core.Curation.Data;
using Rdmp.Core.DataLoad.Triggers;
using Rdmp.Core.DataQualityEngine.Reports.PeriodicityHelpers;
Expand All @@ -20,6 +24,9 @@

namespace Rdmp.Core.DataQualityEngine.Reports;

/// <summary>
/// Class used to build cataloge constraint reports
/// </summary>
public class ReportBuilder
{
private readonly string _dataLoadRunFieldName;
Expand Down

0 comments on commit 05f1721

Please sign in to comment.