@@ -81,6 +81,8 @@ public class FeedSourceSummary {
8181
8282 public GtfsPlusValidation latestGtfsPlusValidation ;
8383
84+ public String latestPublishedVersionId ;
85+
8486 public FeedSourceSummary () {
8587 }
8688
@@ -124,6 +126,7 @@ public void setFeedVersion(FeedVersionSummary feedVersionSummary, boolean isDepl
124126 this .latestProcessedByExternalPublisher = feedVersionSummary .processedByExternalPublisher ;
125127 this .latestSentToExternalPublisher = feedVersionSummary .sentToExternalPublisher ;
126128 this .latestGtfsPlusValidation = feedVersionSummary .gtfsPlusValidation ;
129+ this .latestPublishedVersionId = feedVersionSummary .publishedVersionId ;
127130 }
128131 }
129132 }
@@ -215,6 +218,7 @@ public static Map<String, FeedVersionSummary> getLatestFeedVersionForFeedSources
215218 {
216219 $group: {
217220 _id: "$_id",
221+ publishedVersionId: { $first: "$publishedVersionId" },
218222 doc: {
219223 $max: {
220224 version: "$feedVersions.version",
@@ -239,6 +243,7 @@ public static Map<String, FeedVersionSummary> getLatestFeedVersionForFeedSources
239243 unwind ("$feedVersions" ),
240244 group (
241245 "$_id" ,
246+ Accumulators .first ("publishedVersionId" , "$publishedVersionId" ),
242247 Accumulators .last ("feedVersionId" , "$feedVersions._id" ),
243248 Accumulators .last ("firstCalendarDate" , "$feedVersions.validationResult.firstCalendarDate" ),
244249 Accumulators .last ("lastCalendarDate" , "$feedVersions.validationResult.lastCalendarDate" ),
@@ -486,6 +491,7 @@ private static Map<String, FeedVersionSummary> extractFeedVersionSummaries(
486491 feedVersionSummary .processedByExternalPublisher = feedVersionDocument .getDate ("processedByExternalPublisher" );
487492 feedVersionSummary .sentToExternalPublisher = feedVersionDocument .getDate ("sentToExternalPublisher" );
488493 feedVersionSummary .gtfsPlusValidation = getGtfsPlusValidation (feedVersionDocument );
494+ feedVersionSummary .publishedVersionId = feedVersionDocument .getString ("publishedVersionId" );
489495 feedVersionSummary .validationResult = getValidationResult (hasChildValidationResultDocument , feedVersionDocument );
490496 feedVersionSummaries .put (feedVersionDocument .getString (feedSourceKey ), feedVersionSummary );
491497 }
0 commit comments