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

fix (tax-integrations): expose external account id on anrok customer #2494

Merged
merged 1 commit into from
Aug 28, 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
9 changes: 9 additions & 0 deletions app/graphql/types/integration_customers/anrok.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module IntegrationCustomers
class Anrok < Types::BaseObject
graphql_name 'AnrokCustomer'

field :external_account_id, String, null: true
field :external_customer_id, String, null: true
field :id, ID, null: false
field :integration_code, String, null: true
Expand All @@ -23,6 +24,14 @@ def integration_type
def integration_code
object.integration&.code
end

def external_account_id
api_key = object.integration.api_key

return nil unless api_key.include?('/')

api_key.split('/')[0]
end
end
end
end
1 change: 1 addition & 0 deletions schema.graphql

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

14 changes: 14 additions & 0 deletions schema.json

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

1 change: 1 addition & 0 deletions spec/graphql/types/integration_customers/anrok_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
RSpec.describe Types::IntegrationCustomers::Anrok do
subject { described_class }

it { is_expected.to have_field(:external_account_id).of_type('String') }
it { is_expected.to have_field(:external_customer_id).of_type('String') }
it { is_expected.to have_field(:id).of_type('ID!') }
it { is_expected.to have_field(:integration_type).of_type('IntegrationTypeEnum') }
Expand Down