Skip to content

Commit

Permalink
add a field to invoice graphql object (#2697)
Browse files Browse the repository at this point in the history
## Context

To help FE to show the correct reason of disabling button to create
credit note, we need to show them when a credit invoice is not
associated with an active wallet

## Description

added associated_active_wallet_present field to invoice graphql object
  • Loading branch information
annvelents authored Oct 21, 2024
1 parent 7b1562a commit 3e4392b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/graphql/types/invoices/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Object < Types::BaseObject
field :created_at, GraphQL::Types::ISO8601DateTime, null: false
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false

field :associated_active_wallet_present, Boolean, null: false
field :available_to_credit_amount_cents, GraphQL::Types::BigInt, null: false
field :creditable_amount_cents, GraphQL::Types::BigInt, null: false
field :refundable_amount_cents, GraphQL::Types::BigInt, null: false

Expand Down Expand Up @@ -86,6 +88,10 @@ def external_integration_id
resource_type: :invoice
)&.external_id
end

def associated_active_wallet_present
object.associated_active_wallet.present?
end
end
end
end
2 changes: 2 additions & 0 deletions schema.graphql

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

36 changes: 36 additions & 0 deletions schema.json

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

0 comments on commit 3e4392b

Please sign in to comment.