Update daily cost data to return groupedCosts
This commit is contained in:
@@ -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),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user