Skip to content

Conversation

ivannovosad
Copy link
Contributor

Description

Add is_customer_tin_empty argument to GraphQL resolvers so that is can be passed to Data API.

@ivannovosad ivannovosad force-pushed the feat-usages-tin-filter branch from 0ea15c9 to f4c2de3 Compare July 4, 2025 13:14
@ivannovosad ivannovosad requested a review from Copilot July 7, 2025 10:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Add a new is_customer_tin_empty argument across GraphQL schema definitions and resolver implementations so it can be passed through to the backend Data API.

  • Introduced isCustomerTinEmpty in schema.json and schema.graphql for multiple Query fields.
  • Added argument :is_customer_tin_empty in Ruby resolver classes under app/graphql/resolvers.
  • Renamed graphql_name in AggregatedAmountsResolver to reflect aggregated usage amounts.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
schema.json Added isCustomerTinEmpty argument entries to GraphQL introspection schema
schema.graphql Updated Query definitions to include isCustomerTinEmpty argument
app/graphql/resolvers/data_api/usages_resolver.rb Added is_customer_tin_empty argument
app/graphql/resolvers/data_api/usages/invoiced_resolver.rb Added is_customer_tin_empty argument
app/graphql/resolvers/data_api/usages/aggregated_amounts_resolver.rb Added argument, renamed graphql_name, left description unchanged
app/graphql/resolvers/data_api/revenue_streams_resolver.rb Added is_customer_tin_empty argument
app/graphql/resolvers/data_api/prepaid_credits_resolver.rb Added is_customer_tin_empty argument
app/graphql/resolvers/data_api/mrrs_resolver.rb Added is_customer_tin_empty argument
app/graphql/resolvers/analytics/overdue_balances_resolver.rb Added is_customer_tin_empty argument
app/graphql/resolvers/analytics/invoice_collections_resolver.rb Added is_customer_tin_empty argument
Comments suppressed due to low confidence (6)

app/graphql/resolvers/data_api/usages/aggregated_amounts_resolver.rb:13

  • [nitpick] The description still refers to general usages; consider updating it to something like 'Query aggregated usage amounts of an organization' to match the renamed graphql_name.
        description "Query usages of an organization"

schema.graphql:8019

  • [nitpick] Add a descriptive comment above isCustomerTinEmpty in the SDL so API consumers understand what this flag controls.
  dataApiMrrs(billingEntityCode: String, currency: CurrencyEnum, customerCountry: CountryCode, customerType: CustomerTypeEnum, externalCustomerId: String, externalSubscriptionId: String, fromDate: ISO8601Date, isCustomerTinEmpty: Boolean, planCode: String, timeGranularity: TimeGranularityEnum, toDate: ISO8601Date): DataApiMrrCollection!

app/graphql/resolvers/data_api/usages_resolver.rb:32

  • [nitpick] Consider adding or updating tests to verify that is_customer_tin_empty is properly accepted and passed through by this resolver.
      argument :is_customer_tin_empty, Boolean, required: false

app/graphql/resolvers/data_api/usages_resolver.rb:36

  • The new is_customer_tin_empty argument is added but not forwarded to the Data API call. Ensure you include args[:is_customer_tin_empty] when invoking the backend client.
      def resolve(**args)

app/graphql/resolvers/data_api/usages/invoiced_resolver.rb:39

  • Make sure to pass args[:is_customer_tin_empty] into the data API request inside this resolver, otherwise the flag will be ignored.
        def resolve(**args)

app/graphql/resolvers/data_api/usages/aggregated_amounts_resolver.rb:36

  • You’ve added the is_customer_tin_empty argument but haven’t forwarded it to the backend service. Update the resolve method to include this flag.
        def resolve(**args)

Copy link
Contributor

@ancorcruz ancorcruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ivannovosad ivannovosad merged commit 24eedad into main Jul 7, 2025
14 checks passed
@ivannovosad ivannovosad deleted the feat-usages-tin-filter branch July 7, 2025 11:40
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Description

Add `is_customer_tin_empty` argument to GraphQL resolvers so that is can
be passed to Data API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants