Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Db contrib/7196 additional attributes to lf extracts #7197

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading