Skip to content

Commit

Permalink
type payment line as object (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyn4 authored May 31, 2024
1 parent 8e6837a commit 7410088
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 44 additions & 0 deletions tap_quickbooks/quickbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion tap_quickbooks/quickbooks/schemas/object_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 7410088

Please sign in to comment.