-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(weighted-sum): Add weighted sum fields to billable metric (#137)
- Loading branch information
1 parent
703d1d7
commit 5751c91
Showing
6 changed files
with
108 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
FactoryBot.define do | ||
factory :billable_metric, class: OpenStruct do | ||
factory :create_billable_metric, class: OpenStruct do | ||
name { 'BM1' } | ||
code { 'BM_code' } | ||
description { 'description' } | ||
recurring { false } | ||
aggregation_type { 'sum_agg' } | ||
field_name { 'amount_sum' } | ||
end | ||
|
||
factory :update_billable_metric, parent: :create_billable_metric do | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"billable_metric": { | ||
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b", | ||
"name": "bm_name", | ||
"code": "bm_code", | ||
"description": "description", | ||
"aggregation_type": "sum_agg", | ||
"weighted_interval": null, | ||
"recurring": false, | ||
"field_name": "amount_sum", | ||
"created_at": "2022-04-29T08:59:51Z", | ||
"group": { | ||
"key": "country", | ||
"values": ["france", "italy", "spain"] | ||
}, | ||
"active_subscriptions_count": 0, | ||
"draft_invoices_count": 0, | ||
"plans_count": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"billable_metrics": [ | ||
{ | ||
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac1000", | ||
"name": "bm_name", | ||
"code": "bm_code", | ||
"description": "description", | ||
"aggregation_type": "sum_agg", | ||
"weighted_interval": null, | ||
"recurring": false, | ||
"field_name": "amount_sum", | ||
"created_at": "2022-04-29T08:59:51Z", | ||
"group": {}, | ||
"active_subscriptions_count": 0, | ||
"draft_invoices_count": 0, | ||
"plans_count": 0 | ||
}, | ||
{ | ||
"lago_id": "b7ab2926-1de8-4428-9bcd-779314a11111", | ||
"name": "bm2_name", | ||
"code": "bm2_code", | ||
"description": "description2", | ||
"aggregation_type": "sum_agg", | ||
"weighted_interval": null, | ||
"recurring": false, | ||
"field_name": "amount_sum", | ||
"created_at": "2022-04-30T08:59:51Z", | ||
"group": {}, | ||
"active_subscriptions_count": 0, | ||
"draft_invoices_count": 0, | ||
"plans_count": 0 | ||
} | ||
], | ||
"meta": { | ||
"current_page": 1, | ||
"next_page": 2, | ||
"prev_page": null, | ||
"total_pages": 8, | ||
"total_count": 73 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters