diff --git a/lib/lago/api/resources/billable_metric.rb b/lib/lago/api/resources/billable_metric.rb index 2885d6d..509a143 100644 --- a/lib/lago/api/resources/billable_metric.rb +++ b/lib/lago/api/resources/billable_metric.rb @@ -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 diff --git a/spec/fixtures/api/billable_metric.json b/spec/fixtures/api/billable_metric.json index a7ab7c4..c37af8f 100644 --- a/spec/fixtures/api/billable_metric.json +++ b/spec/fixtures/api/billable_metric.json @@ -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", diff --git a/spec/fixtures/api/billable_metric_index.json b/spec/fixtures/api/billable_metric_index.json index d17df3b..b9eb15f 100644 --- a/spec/fixtures/api/billable_metric_index.json +++ b/spec/fixtures/api/billable_metric_index.json @@ -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", @@ -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",