Skip to content

Commit 84ced60

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): include account in deposit updates
1 parent 3df48a1 commit 84ced60

7 files changed

Lines changed: 48 additions & 8 deletions

File tree

apps/docs/content/docs/en/integrations/quickbooks.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2290,14 +2290,15 @@ Create a deposit with bounded account lines
22902290

22912291
### `quickbooks_update_deposit`
22922292

2293-
Sparse-update deposit header fields using the current sync token
2293+
Sparse-update deposit header fields using the current sync token and destination account
22942294

22952295
#### Input
22962296

22972297
| Parameter | Type | Required | Description |
22982298
| --------- | ---- | -------- | ----------- |
22992299
| `depositId` | string | Yes | Deposit ID to update |
23002300
| `syncToken` | string | Yes | Current deposit sync token |
2301+
| `depositAccountId` | string | Yes | Current QuickBooks account receiving the deposit |
23012302
| `transactionDate` | string | No | Replacement date in YYYY-MM-DD format |
23022303
| `privateNote` | string | No | Replacement internal note |
23032304

apps/sim/blocks/blocks/quickbooks.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,11 +1029,16 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
10291029
'quickbooks_update_refund_receipt',
10301030
...PAYMENT_OPERATIONS,
10311031
'quickbooks_create_deposit',
1032+
'quickbooks_update_deposit',
10321033
],
10331034
},
10341035
required: {
10351036
field: 'operation',
1036-
value: ['quickbooks_create_refund_receipt', 'quickbooks_create_deposit'],
1037+
value: [
1038+
'quickbooks_create_refund_receipt',
1039+
'quickbooks_create_deposit',
1040+
'quickbooks_update_deposit',
1041+
],
10371042
},
10381043
},
10391044
{
@@ -1385,8 +1390,7 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
13851390
confirmPosting: isJournalEntry
13861391
? parseConfirmation(params.confirmPosting, 'confirmPosting')
13871392
: undefined,
1388-
depositAccountId:
1389-
isCreate && !isJournalEntry ? optionalValue(params.depositAccountId) : undefined,
1393+
depositAccountId: !isJournalEntry ? optionalValue(params.depositAccountId) : undefined,
13901394
transactionDate: optionalValue(params.transactionDate),
13911395
documentNumber: isJournalEntry ? optionalValue(params.documentNumber) : undefined,
13921396
privateNote: optionalValue(params.privateNote),

apps/sim/lib/integrations/integrations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14724,7 +14724,7 @@
1472414724
},
1472514725
{
1472614726
"name": "Update Deposit",
14727-
"description": "Sparse-update deposit header fields using the current sync token"
14727+
"description": "Sparse-update deposit header fields using the current sync token and destination account"
1472814728
}
1472914729
],
1473014730
"operationCount": 39,

apps/sim/tools/quickbooks/accounting.test.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,25 @@ describe('QuickBooks accounting mutations', () => {
257257
...authParams,
258258
depositId: '13',
259259
syncToken: '2',
260+
depositAccountId: '35',
260261
transactionDate: '2026-08-01',
261262
})
262-
).toEqual({ Id: '13', SyncToken: '2', sparse: true, TxnDate: '2026-08-01' })
263+
).toEqual({
264+
Id: '13',
265+
SyncToken: '2',
266+
sparse: true,
267+
DepositToAccountRef: { value: '35' },
268+
TxnDate: '2026-08-01',
269+
})
263270
expect(() =>
264271
buildQuickBooksUpdateDepositBody({
265272
...authParams,
266273
depositId: '13',
267274
syncToken: '2',
275+
depositAccountId: '35',
268276
})
269277
).toThrow('at least one field')
278+
expect(quickbooksUpdateDepositTool.params.depositAccountId).toMatchObject({ required: true })
270279
})
271280

272281
it.each([
@@ -324,6 +333,22 @@ describe('QuickBooks accounting block', () => {
324333
depositAccountId: '35',
325334
lines: depositLines,
326335
})
336+
expect(
337+
QuickBooksBlock.tools.config!.params!({
338+
operation: 'quickbooks_update_deposit',
339+
oauthCredential: 'credential-id',
340+
transactionId: '204',
341+
syncToken: '0',
342+
depositAccountId: '35',
343+
privateNote: 'Updated through Sim',
344+
})
345+
).toMatchObject({
346+
credential: 'credential-id',
347+
depositId: '204',
348+
syncToken: '0',
349+
depositAccountId: '35',
350+
privateNote: 'Updated through Sim',
351+
})
327352
})
328353

329354
it('exposes exactly 39 operations with tool/access parity', () => {
@@ -344,6 +369,7 @@ describe('QuickBooks accounting block', () => {
344369
oauthCredential: 'credential-id',
345370
transactionId: '12',
346371
syncToken: '1',
372+
depositAccountId: '35',
347373
confirmPosting: 'yes',
348374
privateNote: 'Updated',
349375
journalLines: JSON.stringify(journalLines),

apps/sim/tools/quickbooks/accounting_utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,9 @@ export function buildQuickBooksUpdateDepositBody(
295295
Id: requiredQuickBooksString(params.depositId, 'depositId'),
296296
SyncToken: requiredQuickBooksString(params.syncToken, 'syncToken'),
297297
sparse: true,
298+
DepositToAccountRef: quickBooksReference(params.depositAccountId, 'depositAccountId'),
298299
...transactionHeader(params),
299300
}
300-
assertQuickBooksSparseUpdate(body)
301+
assertQuickBooksSparseUpdate(body, 4)
301302
return body
302303
}

apps/sim/tools/quickbooks/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ export interface QuickBooksCreateDepositParams extends QuickBooksAuthParams {
341341
export interface QuickBooksUpdateDepositParams extends QuickBooksAuthParams {
342342
depositId: string
343343
syncToken: string
344+
depositAccountId: string
344345
transactionDate?: string
345346
privateNote?: string
346347
}

apps/sim/tools/quickbooks/update_deposit.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export const quickbooksUpdateDepositTool: ToolConfig<
2323
> = {
2424
id: 'quickbooks_update_deposit',
2525
name: 'QuickBooks Update Deposit',
26-
description: 'Sparse-update deposit header fields using the current sync token',
26+
description:
27+
'Sparse-update deposit header fields using the current sync token and destination account',
2728
version: '1.0.0',
2829
params: {
2930
accessToken: {
@@ -50,6 +51,12 @@ export const quickbooksUpdateDepositTool: ToolConfig<
5051
visibility: 'user-or-llm',
5152
description: 'Current deposit sync token',
5253
},
54+
depositAccountId: {
55+
type: 'string',
56+
required: true,
57+
visibility: 'user-or-llm',
58+
description: 'Current QuickBooks account receiving the deposit',
59+
},
5360
transactionDate: {
5461
type: 'string',
5562
required: false,

0 commit comments

Comments
 (0)