Skip to content

Commit

Permalink
feat(felixible aggregation): Expose expression in API
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Oct 24, 2024
1 parent 92e3be2 commit 7c795f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/lago/api/resources/billable_metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def whitelist_params(params)
aggregation_type: params[:aggregation_type],
weighted_interval: params[:weighted_interval],
field_name: params[:field_name],
expression: params[:expression],
filters: params[:filters],
}.compact,
}
Expand Down
7 changes: 2 additions & 5 deletions spec/fixtures/api/billable_metric.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
"aggregation_type": "sum_agg",
"weighted_interval": null,
"recurring": false,
"expression": "1 + 2",
"field_name": "amount_sum",
"created_at": "2022-04-29T08:59:51Z",
"filters": [
{
"key": "country",
"values": [
"france",
"italy",
"spain"
]
"values": ["france", "italy", "spain"]
}
],
"active_subscriptions_count": 0,
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/api/billable_metric_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"aggregation_type": "sum_agg",
"weighted_interval": null,
"recurring": false,
"expression": "1 + 2",
"field_name": "amount_sum",
"created_at": "2022-04-29T08:59:51Z",
"filters": [],
Expand All @@ -23,6 +24,7 @@
"aggregation_type": "sum_agg",
"weighted_interval": null,
"recurring": false,
"expression": "1 + 2",
"field_name": "amount_sum",
"created_at": "2022-04-30T08:59:51Z",
"filters": [],
Expand Down

0 comments on commit 7c795f4

Please sign in to comment.