Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(filter): Remove *_filters#lago_id in API #1758

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/serializers/v1/billable_metric_filter_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module V1
class BillableMetricFilterSerializer < ModelSerializer
def serialize
{
lago_id: model.id,
key: model.key,
values: model.values.sort,
}
Expand Down
1 change: 0 additions & 1 deletion app/serializers/v1/charge_filter_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module V1
class ChargeFilterSerializer < ModelSerializer
def serialize
{
lago_id: model.id,
invoice_display_name: model.invoice_display_name,
properties: model.properties,
values:,
Expand Down
1 change: 0 additions & 1 deletion app/serializers/v1/customers/charge_usage_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def filters(fees)
next unless f.charge_filter

{
lago_id: f.charge_filter.id,
units: f.units,
amount_cents: f.amount_cents,
events_count: f.events_count,
Expand Down
1 change: 1 addition & 0 deletions app/services/payment_providers/stripe_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def handle_event(organization:, event_json:)
raise if event.livemode

Rails.logger.warn("Stripe resource not found: #{e.message}. JSON: #{event_json}")
result
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
it 'serializes the object' do
aggregate_failures do
expect(result['billable_metric_filter']).to include(
'lago_id' => billable_metric_filter.id,
'key' => billable_metric_filter.key,
'values' => billable_metric_filter.values.sort,
)
Expand Down
1 change: 0 additions & 1 deletion spec/serializers/v1/charge_filter_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
result = JSON.parse(serializer.to_json)

aggregate_failures do
expect(result['filter']['lago_id']).to eq(charge_filter.id)
expect(result['filter']['invoice_display_name']).to eq(charge_filter.invoice_display_name)
expect(result['filter']['properties']).to eq(charge_filter.properties)
expect(result['filter']['values']).to eq(
Expand Down
2 changes: 0 additions & 2 deletions spec/serializers/v1/customers/charge_usage_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@

it 'returns filters array' do
expect(result['charges'].first['filters'].first).to include(
'lago_id' => charge_filter.id,
'units' => '10.0',
'amount_cents' => 100,
'events_count' => 12,
Expand All @@ -158,7 +157,6 @@
)

expect(result['charges'].first['grouped_usage'].first['filters'].first).to include(
'lago_id' => charge_filter.id,
'units' => '10.0',
'amount_cents' => 100,
'events_count' => 12,
Expand Down
Loading