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

Add 'Tracking' as a plural of 'TrackingCategory' #149

Merged
merged 1 commit into from
Jul 9, 2016

Conversation

jakewins
Copy link
Contributor

This feels a bit uncomfortable, but effectively; the Xero API is inconsistent about using 'TrackingCategories' as the key for elements where it expects the sub-elements to be 'TrackingCategory'. Specifically, for LineItems, it uses the term 'Tracking' instead, as per https://developer.xero.com/documentation/api/invoices/

So, this adds 'Tracking' as a "plural" version of "TrackingCategory", to allow inserting line items with tracked options enabled. Without this, creating invoices fails with PostDataInvalidException: Object reference not set to an instance of an object. []

This feels a bit uncomfortable, but effectively; the Xero API is inconsistent about using 'TrackingCategories' as the key for elements where it expects the sub-elements to be 'TrackingCategory'. Specifically, for LineItems, it uses the term 'Tracking' instead, as per https://developer.xero.com/documentation/api/invoices/

So, this adds 'Tracking' as a "plural" version of "TrackingCategory", to allow inserting line items with tracked options enabled. Without this, creating invoices fails with `PostDataInvalidException: Object reference not set to an instance of an object. []`
@jakewins
Copy link
Contributor Author

jakewins commented Jul 8, 2016

@aidanlister hey mate, would you have time to review this? We're unable to move to prod without this fix since tracking categories don't work without it.

Let me know if I can help in any way, happy to expand/modify as you see fit.

@aidanlister
Copy link
Collaborator

Seems fine, so I'll merge ... but we'll need to redesign this project at some point to implement a specific serializer / deserializer for each endpoint to get away from this type of stuff.

@aidanlister aidanlister merged commit 1d2a2b9 into freakboy3742:master Jul 9, 2016
@jakewins jakewins deleted the patch-1 branch July 11, 2016 14:45
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

3 participants