Skip to content

Commit

Permalink
feat(dunning): Add payment_status to graphql payment request
Browse files Browse the repository at this point in the history
  • Loading branch information
rsempe committed Aug 28, 2024
1 parent 743051c commit 7141f81
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/graphql/types/payment_requests/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Object < Types::BaseObject
field :amount_currency, Types::CurrencyEnum, null: false
field :created_at, GraphQL::Types::ISO8601DateTime, null: false
field :email, String, null: false
field :payment_status, Types::Invoices::PaymentStatusTypeEnum, null: false
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false

field :customer, Types::Customers::Object, null: false
Expand Down
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.

18 changes: 18 additions & 0 deletions schema.json

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

19 changes: 19 additions & 0 deletions spec/graphql/types/payment_requests/object_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe Types::PaymentRequests::Object do
subject { described_class }

it { is_expected.to have_field(:customer).of_type("Customer!") }
it { is_expected.to have_field(:invoices).of_type("[Invoice!]!") }

it { is_expected.to have_field(:id).of_type("ID!") }
it { is_expected.to have_field(:amount_cents).of_type("BigInt!") }
it { is_expected.to have_field(:amount_currency).of_type("CurrencyEnum!") }
it { is_expected.to have_field(:email).of_type("String!") }
it { is_expected.to have_field(:payment_status).of_type("InvoicePaymentStatusTypeEnum!") }

it { is_expected.to have_field(:created_at).of_type("ISO8601DateTime!") }
it { is_expected.to have_field(:updated_at).of_type("ISO8601DateTime!") }
end

0 comments on commit 7141f81

Please sign in to comment.