Skip to content

Commit

Permalink
add project isLatest flag in ConciseProject
Browse files Browse the repository at this point in the history
  • Loading branch information
sahibamittal committed Oct 4, 2024
1 parent 3605233 commit 1a95998
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public interface ProjectDao {
, "VERSION" AS "version"
, "PROJECT"."CLASSIFIER" AS "classifier"
, "PROJECT"."ACTIVE" AS "active"
, "PROJECT"."IS_LATEST" AS "isLatest"
, (SELECT ARRAY_AGG("TAG"."NAME")
FROM "TAG"
INNER JOIN "PROJECTS_TAGS"
Expand Down Expand Up @@ -163,6 +164,7 @@ OR EXISTS (SELECT 1 FROM "TAG" WHERE "TAG"."NAME" = ${apiFilterParameter}))
@AllowApiOrdering.Column(name = "version"),
@AllowApiOrdering.Column(name = "classifier"),
@AllowApiOrdering.Column(name = "active"),
@AllowApiOrdering.Column(name = "isLatest"),
@AllowApiOrdering.Column(name = "lastBomImport"),
@AllowApiOrdering.Column(name = "lastBomImportFormat"),
@AllowApiOrdering.Column(name = "metrics.components", queryName = "\"metrics\".\"COMPONENTS\""),
Expand All @@ -188,6 +190,7 @@ record ConciseProjectListRow(
String version,
String classifier,
boolean active,
boolean isLatest,
List<String> tags,
List<String> teams,
@Nullable Instant lastBomImport,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public record ConciseProject(
@Schema(description = "Version of the project") String version,
@Schema(description = "Classifier of the project") Classifier classifier,
@Schema(description = "Whether the project is active", requiredMode = Schema.RequiredMode.REQUIRED) boolean active,
@Schema(description = "Whether the project version is latest") boolean isLatest,
@Schema(description = "Tags associated with the project") List<Tag> tags,
@Schema(description = "Teams associated with the project") List<Team> teams,
@Schema(description = "Timestamp of the last BOM import", type = "number", example = "1719499619599") Date lastBomImport,
Expand All @@ -55,6 +56,7 @@ public ConciseProject(final ConciseProjectListRow row) {
this(row.uuid(), row.group(), row.name(), row.version(),
row.classifier() != null ? Classifier.valueOf(row.classifier()) : null,
row.active(),
row.isLatest(),
convertTags(row.tags()),
convertTeams(row.teams()),
row.lastBomImport() != null ? Date.from(row.lastBomImport()) : null,
Expand Down

0 comments on commit 1a95998

Please sign in to comment.