Skip to content

Commit

Permalink
feat(manual-payments): Add totalDueAmountCents
Browse files Browse the repository at this point in the history
  • Loading branch information
ivannovosad committed Jan 24, 2025
1 parent f557573 commit df315b8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/graphql/types/invoices/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Object < Types::BaseObject
field :sub_total_including_taxes_amount_cents, GraphQL::Types::BigInt, null: false
field :taxes_amount_cents, GraphQL::Types::BigInt, null: false
field :total_amount_cents, GraphQL::Types::BigInt, null: false
field :total_due_amount_cents, GraphQL::Types::BigInt, null: false

field :issuing_date, GraphQL::Types::ISO8601Date, null: false
field :payment_due_date, GraphQL::Types::ISO8601Date, null: false
Expand Down
3 changes: 0 additions & 3 deletions app/services/payment_requests/payments/stripe_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def update_payment_status(organization_id:, status:, stripe_payment:)
result.payable = payment.payable
return result if payment.payable.payment_succeeded?

payable_payment_status = payment.payment_provider&.determine_payment_status(status)
payment.update!(status:, payable_payment_status:)

processing = status == "processing"
payment.status = status

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.

16 changes: 16 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/invoices/object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
it { is_expected.to have_field(:sub_total_including_taxes_amount_cents).of_type('BigInt!') }
it { is_expected.to have_field(:taxes_amount_cents).of_type('BigInt!') }
it { is_expected.to have_field(:total_amount_cents).of_type('BigInt!') }
it { is_expected.to have_field(:total_due_amount_cents).of_type('BigInt!') }
it { is_expected.to have_field(:issuing_date).of_type('ISO8601Date!') }
it { is_expected.to have_field(:payment_due_date).of_type('ISO8601Date!') }
it { is_expected.to have_field(:payment_overdue).of_type('Boolean!') }
Expand Down

0 comments on commit df315b8

Please sign in to comment.