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

feat: Add GQL Invoice type with related resolvers #586

Merged
merged 10 commits into from
Jun 3, 2024

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented May 29, 2024

Purpose/Motivation

We want to convert REST endpoints -> GQL where it makes sense. This PR aims to tackle the API side of the /invoices endpoint, creating resolvers for the related models

Stripe invoice model can be found here: https://docs.stripe.com/api/invoices

Links to relevant tickets

Relates to codecov/engineering-team#1471

What does this PR do?

Aims to add Invoice Type to the owner model, and invoice resolvers for the new type created.

There are also some comments around some unused fields on the invoice model that we were returning from stripe, but don't seem to be used in Gazebo anywhere. These are definitely worth removing, since there isn't really a point in overfetching data atm.

The resolvers for the invoice model are fairly straightforward, we're just pulling off attributes from the invoice object being returned from the stripe API called in the invoice resolver on the owner model.

Notes to Reviewer

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@ajay-sentry ajay-sentry requested a review from a team as a code owner May 29, 2024 18:54
Copy link

codecov bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 97.53086% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 95.87%. Comparing base (38946b6) to head (9e955de).

✅ All tests successful. No failed tests found.

Files Patch % Lines
graphql_api/types/invoice/invoice.py 97.22% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##               main       #586   +/-   ##
===========================================
  Coverage   95.87000   95.87000           
===========================================
  Files           782        784    +2     
  Lines         17418      17499   +81     
===========================================
+ Hits          16699      16778   +79     
- Misses          719        721    +2     
Flag Coverage Δ
unit 91.45% <97.53%> (+0.03%) ⬆️
unit-latest-uploader 91.45% <97.53%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

codecov-notifications bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 97.53086% with 2 lines in your changes are missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files Patch % Lines
graphql_api/types/invoice/invoice.py 97.22% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 97.53086% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 91.45%. Comparing base (38946b6) to head (9e955de).

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main     #586      +/-   ##
==========================================
+ Coverage   91.42%   91.45%   +0.03%     
==========================================
  Files         604      606       +2     
  Lines       16100    16181      +81     
==========================================
+ Hits        14720    14799      +79     
- Misses       1380     1382       +2     
Flag Coverage Δ
unit 91.45% <97.53%> (+0.03%) ⬆️
unit-latest-uploader 91.45% <97.53%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
graphql_api/types/__init__.py 100.00% <100.00%> (ø)
graphql_api/types/invoice/__init__.py 100.00% <100.00%> (ø)
graphql_api/types/owner/owner.py 100.00% <100.00%> (ø)
services/billing.py 92.33% <ø> (ø)
graphql_api/types/invoice/invoice.py 97.22% <97.22%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

Copy link

codecov-public-qa bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 97.53086% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 91.45%. Comparing base (38946b6) to head (9e955de).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #586      +/-   ##
==========================================
+ Coverage   91.42%   91.45%   +0.03%     
==========================================
  Files         604      606       +2     
  Lines       16100    16181      +81     
==========================================
+ Hits        14720    14799      +79     
- Misses       1380     1382       +2     
Flag Coverage Δ
unit 91.45% <97.53%> (+0.03%) ⬆️
unit-latest-uploader 91.45% <97.53%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
graphql_api/types/__init__.py 100.00% <100.00%> (ø)
graphql_api/types/invoice/__init__.py 100.00% <100.00%> (ø)
graphql_api/types/owner/owner.py 100.00% <100.00%> (ø)
services/billing.py 92.33% <ø> (ø)
graphql_api/types/invoice/invoice.py 97.22% <97.22%> (ø)

Impacted file tree graph

return invoice["customer_name"]


# NOTE: This doesn't currently look to be used in gazebo, maybe can remove?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to remove these unused ones imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna do all the gut removal stuff in a followup PR if that's aight

@ajay-sentry ajay-sentry added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit 77c9904 Jun 3, 2024
21 of 22 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/1465-gql-invoice-type branch June 3, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants