Skip to content

Commit efbb3b0

Browse files
feat(forecast-timestamp): add init and creation to GetForecastAtTimes… (#136)
1 parent bf2b325 commit efbb3b0

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

internal/server/postgres/dataserverimpl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,8 @@ func (s *DataPlatformDataServiceServerImpl) GetForecastAtTimestamp(
10221022
Longitude: value.Longitude,
10231023
},
10241024
Metadata: value.Metadata,
1025+
InitializationTimestampUtc: timestamppb.New(value.InitTimeUtc.Time),
1026+
CreatedTimestampUtc: timestamppb.New(value.CreatedAtUtc.Time),
10251027
}
10261028
}
10271029

internal/server/postgres/dataserverimpl_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ func TestGetForecastAtTimestamp(t *testing.T) {
568568

569569
for i, forecast := range resp.Values {
570570
require.Equal(t, tc.expectedp50s[i], forecast.ValueFraction)
571+
require.NotNil(t, forecast.InitializationTimestampUtc)
572+
require.NotNil(t, forecast.CreatedTimestampUtc)
571573
}
572574
}
573575
})

proto/ocf/dp/dp-data.messages.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ message GetForecastAtTimestampResponse {
154154
uint64 effective_capacity_watts = 4;
155155
LatLng latlng = 5;
156156
google.protobuf.Struct metadata = 6;
157+
google.protobuf.Timestamp initialization_timestamp_utc = 7;
158+
google.protobuf.Timestamp created_timestamp_utc = 8;
157159
}
158160

159161
google.protobuf.Timestamp timestamp_utc = 1;

0 commit comments

Comments
 (0)