in eventconsumer/src/main/scala/com/gu/notifications/events/dynamo/DynamoReportUpdater.scala [18:26]
def updateSetEventsReceivedAfter(eventAggregations: List[NotificationReportEvent], startOfReportingWindow: ZonedDateTime)(implicit executionContext: ExecutionContext, dynamoDbClient: AmazonDynamoDBAsync): List[Future[Unit]] = {
eventAggregations.map(aggregation => {
readSentTime(aggregation.id.toString).flatMap {
case Some(sentTime) if sentTime.isAfter(startOfReportingWindow) => updateSetEvent(aggregation)
case Some(_) => Future.successful(())
case None => Future.successful(())
}
})
}