diff --git a/tap_quickbooks/quickbooks/__init__.py b/tap_quickbooks/quickbooks/__init__.py index f5ba624..a2651ba 100644 --- a/tap_quickbooks/quickbooks/__init__.py +++ b/tap_quickbooks/quickbooks/__init__.py @@ -114,6 +114,14 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches "type": ["null", "array"] } + ref_type = { + "type": object_type["type"], + "properties": { + "value": string_type, + "name": string_type, + } + } + qb_types = { "number": number_type, "string": string_type, @@ -124,7 +132,8 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches "object_reference": string_type, "email": string_type, "address": string_type, - "metadata": string_type + "metadata": string_type, + "ref_type": ref_type } qb_types["custom_field"] = { @@ -148,10 +157,10 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches "SalesItemLineDetail": { "type": object_type["type"], "properties": { - "ItemRef": qb_types["object_reference"], - "ClassRef": qb_types["object_reference"], - "ItemAccountRef": qb_types["object_reference"], - "TaxCodeRef": qb_types["object_reference"], + "ItemRef": qb_types["ref_type"], + "ClassRef": qb_types["ref_type"], + "ItemAccountRef": qb_types["ref_type"], + "TaxCodeRef": qb_types["ref_type"], "Qty": number_type, "UnitPrice": number_type, "ServiceDate": qb_types["datetime"], @@ -159,7 +168,10 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches } }, "SubTotalLineDetail": { - "type": object_type["type"] + "type": object_type["type"], + "properties": { + "ItemRef": qb_types["ref_type"] + } }, "DiscountLineDetail": { "type": object_type["type"],