Skip to content

Commit

Permalink
Merge pull request #7197 from deutschebank/db-contrib/7196-additional…
Browse files Browse the repository at this point in the history
…-attributes-to-lf-extracts

Db contrib/7196 additional attributes to lf extracts
  • Loading branch information
davidwatkins73 authored Jan 17, 2025
2 parents 5d42c94 + db83d2b commit ab05dd9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public static java.sql.Date toSqlDate(LocalDate localDate) {
return java.sql.Date.valueOf(localDate);
}

public static java.sql.Timestamp toSqlTimestamp(LocalDateTime localDateTime) {
if(localDateTime == null) {
return null;
}

return Timestamp.valueOf(localDateTime);
}


public static LocalDate toLocalDate(Date date) {
if (date == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ function controller($element,
"Target",
"Target code",
"Data Types",
"Tags"
"Tags",
"Created At",
"Created By",
"Last Updated At",
"Last Updated By"
];

const dataTypesByFlowId = _
Expand Down Expand Up @@ -457,7 +461,11 @@ function controller($element,
f.target.name,
resolveCode(f.target),
calcDataTypes(f.id),
calcTags(f.id)
calcTags(f.id),
f.created.at,
f.created.by,
f.lastUpdatedAt,
f.lastUpdatedBy
]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ public class LogicalFlowExtractor extends CustomDataExtractor {
"Flow External Id",
"Data Type",
"Source Outbound Rating",
"Target Inbound Rating");
"Target Inbound Rating",
"Created At",
"Created By",
"Last Updated At",
"Last Updated By");

private final ApplicationIdSelectorFactory applicationIdSelectorFactory = new ApplicationIdSelectorFactory();
private final DataTypeIdSelectorFactory dataTypeIdSelectorFactory = new DataTypeIdSelectorFactory();
Expand Down Expand Up @@ -163,6 +167,10 @@ private SelectConditionStep<Record> prepareQuery(DSLContext dsl, IdSelectionOpti
.select(DATA_TYPE.NAME.as("Data Type"))
.select(sourceClassification.NAME.as("Source Outbound Rating"))
.select(targetClassification.NAME.as("Target Inbound Rating"))
.select(LOGICAL_FLOW.CREATED_AT.as("Created At"))
.select(LOGICAL_FLOW.CREATED_BY.as("Created By"))
.select(LOGICAL_FLOW.LAST_UPDATED_AT.as("Last Updated At"))
.select(LOGICAL_FLOW.LAST_UPDATED_BY.as("Last Updated By"))
.from(LOGICAL_FLOW)
.innerJoin(LOGICAL_FLOW_DECORATOR)
.on(LOGICAL_FLOW_DECORATOR.LOGICAL_FLOW_ID.eq(LOGICAL_FLOW.ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.finos.waltz.common.MapUtilities;
import org.finos.waltz.model.IdSelectionOptions;
import org.finos.waltz.model.NameProvider;
import org.finos.waltz.model.UserTimestamp;
import org.finos.waltz.model.assessment_rating.AssessmentRating;
import org.finos.waltz.model.datatype.DataTypeDecorator;
import org.finos.waltz.model.logical_flow.LogicalFlow;
Expand All @@ -47,6 +48,7 @@
import java.util.stream.Collectors;

import static java.util.stream.Collectors.toList;
import static org.finos.waltz.common.DateTimeUtilities.toSqlTimestamp;
import static org.finos.waltz.common.ListUtilities.concat;
import static org.finos.waltz.common.StringUtilities.joinUsing;
import static org.finos.waltz.model.utils.IdUtilities.indexById;
Expand Down Expand Up @@ -107,7 +109,11 @@ private Tuple3<ExtractFormat, String, byte[]> prepareLogicalFlows(IdSelectionOpt
"Target Entity External Id",
"Flow External Id",
"Data Types",
"Physical Flow Count");
"Physical Flow Count",
"Created At",
"Created By",
"Last Updated At",
"Last Updated By");

List<String> assessmentHeaders = flowView.logicalFlowAssessmentDefinitions()
.stream()
Expand Down Expand Up @@ -152,6 +158,10 @@ private List<List<Object>> prepareLogicalFlowReportRows(LogicalFlowView viewData
reportRow.add(row.externalId().orElse(""));
reportRow.add(dataTypeString);
reportRow.add(physicals.size());
reportRow.add(row.created().map(UserTimestamp::atTimestamp).get());
reportRow.add(row.created().map(UserTimestamp::by));
reportRow.add(toSqlTimestamp(row.lastUpdatedAt()));
reportRow.add(row.lastUpdatedBy());

viewData.logicalFlowAssessmentDefinitions()
.stream()
Expand Down

0 comments on commit ab05dd9

Please sign in to comment.