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

An optional 'id' argument for Manager.save method. #215

Merged
merged 9 commits into from
Feb 11, 2023

Conversation

vadim-pavlov
Copy link
Contributor

The new argument should enable Xero API methods utilizing Resource ID URI parameter in POST requests. Such as deletion of payments and bank transactions:
https://developer.xero.com/documentation/api/payments#POST
https://developer.xero.com/documentation/api/banktransactions#POST

Copy link
Owner

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Thanks for the suggestion; but I'm not convinced this is the right approach to this API. If the use case is deletion, then we should add a delete entry point on objects (or, at least, on objects that support it)

@vadim-pavlov
Copy link
Contributor Author

I've changed the solution based on your feedback. I added a PaymentManager with a custom delete method.

@vadim-pavlov
Copy link
Contributor Author

I guess a better alternative could be to pass a delete_strategy callable to the BaseManager constructor, in this case there will be no need to define a manager class for every entity that has non-standard API.

Copy link
Owner

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Apologies for the delay in reviewing this; the PR appears to have drifted out of sync with main. Could I ask you to merge it with main?

@vadim-pavlov
Copy link
Contributor Author

Not a problem @freakboy3742. I've merged it with the latest main.

@freakboy3742
Copy link
Owner

Looks like I have some additional housekeeping to do (dropping Python 3.6 support); I'll add that to my todo list, then review this for you.

Copy link
Owner

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Looks good; apologies again for the late review, and thanks for the contribution!

@freakboy3742 freakboy3742 merged commit 7505962 into freakboy3742:main Feb 11, 2023
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.

None yet

2 participants