-
Notifications
You must be signed in to change notification settings - Fork 572
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
CreditNoteService should implemented INestedListable? #2022
Comments
And one can make the exact same argument for |
Yes, invoice line items and credit note line items are technically resources nested under invoices and credit notes respectively, so if we wanted to be fully consistent with other nested resources are handled, we should introduce new If we did that, the two new services could implement We could change it, but I'm not sure it's worth the hassle. Also, having We're in the process of making changes to how line items as a whole are handled in the API, so we'll probably wait until those changes land in the backend then make a decision regarding the .NET API. |
Ok, thank you for your comments. |
Note that the |
@clement911, can you share an example of how you are using the INestedListable interface? We were debating the usefulness of them internally and seeing an actual use-case will help. |
Yes we have a big dependency on these interfaces and related types, especially We leverage these common interfaces to create reusable code that can work with any of the Stripe services to load various objects. In particular, we have several bases classes to handle the different data fetching patterns exposed by the Stripe API. Here are a few snippets of code from the bases classes, each of them have up to ten concrete implementations that inherit from them. Hopefully this gives you an idea of how much we use these common types and how they are really simplifying our code and making it reusable. We did find a few instances where the .NET API doesn't follow these interface conventions, and in those instances we've had to write custom adapter classes to make them conform. Obviously, we'd prefer it if the interfaces were implemented already by the Stripe.NET library.
|
CreditNoteService
can list its nested lines in a separate endpoint, currently implemented withListLineItems()
.To be consistent with the other nested services, shouldn't it implement
INestedListable
?It would allow for generic code to handle nested pages consistently.
I guess
CreditNoteService
is unique in the sense that it is used to list both credit notes and credit note lines. That seems to be just a consequence of how the docs are structured. I guess a separateCreditNoteLineService
could make sense also?The text was updated successfully, but these errors were encountered: