Update daily cost data to return groupedCosts

This commit is contained in:
Brenda Sukh
2020-11-23 18:45:02 -05:00
parent f209188c0f
commit 8072bc85c3
2 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -35,7 +35,7 @@ import {
UnlabeledDataflowAlert,
} from '../src/utils/alerts';
import { inclusiveStartDateOf } from '../src/utils/duration';
import { trendlineOf, changeOf } from './utils/mockData';
import { trendlineOf, changeOf, getGroupedProducts } from './utils/mockData';
type IntervalFields = {
duration: Duration;
@@ -56,7 +56,7 @@ function parseIntervals(intervals: string): IntervalFields {
};
}
function aggregationFor(
export function aggregationFor(
intervals: string,
baseline: number,
): DateAggregation[] {
@@ -140,6 +140,7 @@ export class ExampleCostInsightsClient implements CostInsightsApi {
aggregation: aggregation,
change: changeOf(aggregation),
trendline: trendlineOf(aggregation),
groupedCosts: getGroupedProducts(intervals),
},
);
@@ -155,6 +156,7 @@ export class ExampleCostInsightsClient implements CostInsightsApi {
aggregation: aggregation,
change: changeOf(aggregation),
trendline: trendlineOf(aggregation),
groupedCosts: getGroupedProducts(intervals),
},
);
+3 -2
View File
@@ -21,6 +21,7 @@ import { Trendline } from './Trendline';
export interface Cost {
id: string;
aggregation: DateAggregation[];
change: ChangeStatistic;
trendline: Trendline;
change?: ChangeStatistic;
trendline?: Trendline;
groupedCosts?: Cost[];
}