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

Tdl 595 add quotes stream support #86

Merged
merged 7 commits into from Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
169 changes: 169 additions & 0 deletions tap_xero/schemas/quotes.json
@@ -0,0 +1,169 @@
{
"type": [
"null",
"object"
],
"properties":{
"Contact": {
"$ref": "contacts"
},
"Date": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"ExpiryDate": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"Status":{
"type":[
"null",
"string"
]
},
"LineAmountTypes": {
"type": [
"null",
"string"
]
},
"LineItems": {
"type": [
"null",
"array"
],
"items": {
"$ref": "line_items"
}
},
"SubTotal": {
"type": [
"null",
"number"
],
"minimum": -1e+33,
"maximum": 1e+33,
"multipleOf": 1e-06,
"exclusiveMinimum": true,
"exclusiveMaximum": true
},
"TotalTax": {
"type": [
"null",
"number"
],
"minimum": -1e+33,
"maximum": 1e+33,
"multipleOf": 1e-06,
"exclusiveMinimum": true,
"exclusiveMaximum": true
},
"Total": {
"type": [
"null",
"number"
],
"minimum": -1e+33,
"maximum": 1e+33,
"multipleOf": 1e-06,
"exclusiveMinimum": true,
"exclusiveMaximum": true
},
"TotalDiscount":{
"type":[
"null",
"number"
],
"minimum": 0,
"maximum": 100
},
"UpdatedDateUTC": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"CurrencyCode": {
"type": [
"null",
"string"
]
},
"CurrencyRate": {
"type": [
"null",
"number"
],
"minimum": -1e+33,
"maximum": 1e+33,
"multipleOf": 1e-06,
"exclusiveMinimum": true,
"exclusiveMaximum": true
},
"QuoteID":{
"type":[
"null",
"string"
]
},
"QuoteNumber":{
"type":[
"null",
"string"
]
},
"Reference": {
"type": [
"null",
"string"
]
},
"BrandingThemeID":{
"type": [
"null",
"string"
]
},
"Title": {
"type": [
"null",
"string"
]
},
"Summary": {
"type": [
"null",
"string"
]
},
"Terms": {
"type": [
"null",
"string"
]
},
"TrackingCategory": {
"type": [
"null",
"array"
],
"items": {
"$ref": "tracking_categories"
}
}
},
"tap_schema_dependencies": [
"contacts",
"line_items",
"tracking_categories"
],
"additionalProperties": false
}

2 changes: 2 additions & 0 deletions tap_xero/streams.py
Expand Up @@ -41,6 +41,7 @@ def _make_request(ctx, tap_stream_id, filter_options=None, attempts=0):

if e.response.status_code == 503:
raise RateLimitException() from e

raise
assert False

Expand Down Expand Up @@ -174,6 +175,7 @@ def sync(self, ctx):
# UpdatedDateUTC property and support the Modified After, order, and page
# parameters
PaginatedStream("bank_transactions", ["BankTransactionID"]),
PaginatedStream("quotes", "QuoteID"),
PaginatedStream("contacts", ["ContactID"], format_fn=transform.format_contacts),
PaginatedStream("credit_notes", ["CreditNoteID"], format_fn=transform.format_credit_notes),
PaginatedStream("invoices", ["InvoiceID"], format_fn=transform.format_invoices),
Expand Down
2 changes: 2 additions & 0 deletions tests/base.py
Expand Up @@ -74,6 +74,7 @@ def expected_pks(self):
"tax_rates": ["TaxType"],
"tracking_categories": ["TrackingCategoryID"],
"linked_transactions": ["LinkedTransactionID"],
"quotes": ["QuoteID"],
}

@property
Expand Down Expand Up @@ -101,6 +102,7 @@ def expected_bookmarks(self):
"receipts": ["UpdatedDateUTC"],
"users": ["UpdatedDateUTC"],
"linked_transactions": ["UpdatedDateUTC"],
"quotes": ["UpdatedDateUTC"]
}

@property
Expand Down