Skip to content

Commit

Permalink
feat(billable_metric): Expose rounding attributes (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet authored Nov 14, 2024
1 parent 013662c commit ab4d237
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/schemas/BillableMetricBaseInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ properties:
Accepted function are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations.
Round is accepting an optional second parameter to specify the number of decimal.
nullable: true
rounding_function:
type: string
enum:
- ceil
- floor
- round
nullable: true
example: "round"
description: "Refers to the numeric value or mathematical expression that will be rounded based on the calculated number of billing units. Possible values are `round`, `ceil` and `floor`."
rounding_precision:
type: integer
example: 2
nullable: true
description: "Specifies the number of decimal places to which the `rounding_function` will be rounded. It can be a positive or negative value."
field_name:
type: string
example: "gb"
Expand Down
14 changes: 14 additions & 0 deletions src/schemas/BillableMetricObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ properties:
- If set to `true`: the accumulated number of units calculated from the previous billing period is persisted to the next billing period.
- If set to `false`: the accumulated number of units is reset to 0 at the end of the billing period.
- If not defined in the request, default value is `false`.
rounding_function:
type: string
enum:
- ceil
- floor
- round
nullable: true
example: "round"
description: "Refers to the numeric value or mathematical expression that will be rounded based on the calculated number of billing units. Possible values are `round`, `ceil` and `floor`."
rounding_precision:
type: integer
example: 2
nullable: true
description: "Specifies the number of decimal places to which the `rounding_function` will be rounded. It can be a positive or negative value."
created_at:
type: string
format: "date-time"
Expand Down

0 comments on commit ab4d237

Please sign in to comment.