Skip to content

Commit

Permalink
fix (tax-integrations): expose external account id on anrok customer (#…
Browse files Browse the repository at this point in the history
…2494)

## Context

Anrok integration is currently being implemented

## Description

This PR adds additional field on anrok customer GQL object so that UI
can easier present links
  • Loading branch information
lovrocolic authored Aug 28, 2024
1 parent 9039de2 commit 027aec9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
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

0 comments on commit 027aec9

Please sign in to comment.