Skip to content

Conversation

@wscourge
Copy link
Contributor

@wscourge wscourge commented Dec 30, 2025

Testing instructions:

config = Config("API_KEY")
invoice = Invoice.retrieve(
    config,
    uuid="inv_{uuid}",
    validation_type="all",
    include_edit_histories=True,
    with_disabled=True
).get()
invoice.disabled
invoice.disabled_at
invoice.disabled_by
invoice.errors
invoice.edit_history_summary

@wscourge wscourge force-pushed the wiktor/ome-418-add-validation_type-support-to-invoices-line-items-and branch from 45cc3fb to b21f44a Compare December 30, 2025 13:46
@wscourge wscourge requested a review from Copilot December 30, 2025 13:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds test coverage for query parameter handling in invoice retrieval operations. The tests verify that the retrieve() and all() methods correctly accept and pass query parameters like validation_type, include_edit_histories, and with_disabled to the API.

Key Changes

  • Added tests for single query parameter (validation_type) handling in both retrieve() and all() methods
  • Added comprehensive tests verifying multiple query parameters are correctly passed in API requests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

wscourge and others added 4 commits December 30, 2025 15:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@wscourge wscourge requested a review from loomchild December 31, 2025 11:53
@loomchild loomchild self-assigned this Dec 31, 2025
Copy link

@loomchild loomchild left a comment

Choose a reason for hiding this comment

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

Code looks OK, I have some minor comments.

But I don't know how to test it and whether adding extra fields was intentional.

disabled_at = fields.DateTime(allow_none=True)
disabled_by = fields.String(allow_none=True)
edit_history_summary = fields.Dict(allow_none=True)
errors = fields.Dict(allow_none=True)

Choose a reason for hiding this comment

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

So there's a functional change in addition to adding tests? Could you clarify here or in title/description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, I titled the draft PR when it was WIP and then realised it is going to need this changes too.

Adding these extra fields is intentional.

{"validation_type": ["all"]},
)

# Struct too complex to do 1:1 comparison

Choose a reason for hiding this comment

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

[minor] Remove unnecessary comment (here and below). Or perhaps there's a way to compare only parts of structures (similar to RSpec match?

json=retrieveInvoiceExample,
)

config = Config("token") # is actually checked in mock

Choose a reason for hiding this comment

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

I don't understand the comment - what is checked in mock and what does checking in mock mean? Please clarify or remove.

Copy link
Contributor

@pkopac pkopac left a comment

Choose a reason for hiding this comment

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

Please address @loomchild 's comments.

@wscourge wscourge changed the title Add tests confirming that retrieve accepts query params Add disabled, disabled_at, edit_history_summary and errors fields to Invoice Jan 2, 2026
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.

3 participants