Skip to content

Commit

Permalink
feat(billable_metric): Expose rounding attributes (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet authored Nov 5, 2024
1 parent 5c5a9a9 commit 095e9a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/lago/api/resources/billable_metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def whitelist_params(params)
field_name: params[:field_name],
expression: params[:expression],
filters: params[:filters],
rounding_function: params[:rounding_function],
rounding_precision: params[:rounding_precision],
}.compact,
}
end
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/api/billable_metric.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"aggregation_type": "sum_agg",
"weighted_interval": null,
"recurring": false,
"rounding_function": "round",
"rounding_precision": 2,
"expression": "1 + 2",
"field_name": "amount_sum",
"created_at": "2022-04-29T08:59:51Z",
Expand Down
4 changes: 4 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,8 @@
"aggregation_type": "sum_agg",
"weighted_interval": null,
"recurring": false,
"rounding_function": "round",
"rounding_precision": 2,
"expression": "1 + 2",
"field_name": "amount_sum",
"created_at": "2022-04-29T08:59:51Z",
Expand All @@ -24,6 +26,8 @@
"aggregation_type": "sum_agg",
"weighted_interval": null,
"recurring": false,
"rounding_function": "round",
"rounding_precision": 2,
"expression": "1 + 2",
"field_name": "amount_sum",
"created_at": "2022-04-30T08:59:51Z",
Expand Down

0 comments on commit 095e9a7

Please sign in to comment.