diff --git a/tap_quickbooks/quickbooks/__init__.py b/tap_quickbooks/quickbooks/__init__.py index 45cb495..f54507d 100644 --- a/tap_quickbooks/quickbooks/__init__.py +++ b/tap_quickbooks/quickbooks/__init__.py @@ -218,6 +218,50 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches } } + qb_types["LinkedTxn"] = { + "type": object_type["type"], + "properties": { + "TxnId": string_type, + "TxnType": string_type, + } + } + + qb_types["any"] = { + "type": object_type["type"], + "properties": { + "name": string_type, + "declaredType": string_type, + "scope": string_type, + "value": { + "type": object_type["type"], + "properties": { + "Name": string_type, + "Value": string_type, + } + }, + "nil": boolean_type, + "globalScope": boolean_type, + "typeSubstituted": boolean_type, + } + } + + qb_types["payment_line"] = { + "type": object_type["type"], + "properties": { + "Amount": number_type, + "LinkedTxn": {"type": "array", "items": qb_types["LinkedTxn"]}, + "LineEx": { + "type": object_type["type"], + "properties": { + "any": { + "type": "array", + "items": qb_types["any"] + } + } + } + } + } + qb_type = field['type'] property_schema = qb_types[qb_type] if qb_type == 'array': diff --git a/tap_quickbooks/quickbooks/schemas/object_definition.json b/tap_quickbooks/quickbooks/schemas/object_definition.json index e960141..28de90c 100644 --- a/tap_quickbooks/quickbooks/schemas/object_definition.json +++ b/tap_quickbooks/quickbooks/schemas/object_definition.json @@ -76,7 +76,7 @@ {"name": "DepositToAccountRef", "type": "string"}, {"name": "ExchangeRate", "type": "number"}, {"name": "SyncToken", "type": "string"}, - {"name": "Line", "type": "string"}, + {"name": "Line", "type": "array", "child_type": "payment_line"}, {"name": "TxnSource", "type": "string"}, {"name": "ARAccountRef", "type": "string"}, {"name": "TxnDate", "type": "string"},