Skip to content

Commit 62117d9

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): mark sales pagination outputs optional
1 parent dcad390 commit 62117d9

3 files changed

Lines changed: 41 additions & 10 deletions

File tree

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,6 @@ List or read one estimate, invoice, sales receipt, payment, credit memo, or refu
524524

525525
| Parameter | Type | Description |
526526
| --------- | ---- | ----------- |
527-
| `startPosition` | number | One-based position of the first item in this response |
528-
| `maxResults` | number | Actual number of items reported for this response |
529-
| `nextStartPosition` | number | Position to use when explicitly requesting the next page |
530-
| `hasMore` | boolean | Conservative indication that another page may exist |
531-
| `time` | string | QuickBooks response timestamp |
532527
| `transactionType` | string | Sales transaction type returned |
533528
| `item` | json | Single native QuickBooks sales transaction |
534529
|`Id` | string | QuickBooks sales transaction ID |
@@ -594,6 +589,12 @@ List or read one estimate, invoice, sales receipt, payment, credit memo, or refu
594589
|`MetaData` | json | Transaction creation and update timestamps |
595590
|`CreateTime` | string | Entity creation timestamp |
596591
|`LastUpdatedTime` | string | Entity last-updated timestamp |
592+
| `startPosition` | number | One-based position of the first item in this response |
593+
| `maxResults` | number | Actual number of items reported for this response |
594+
| `nextStartPosition` | number | Position to use when explicitly requesting the next page |
595+
| `hasMore` | boolean | Conservative indication that another page may exist |
596+
| `time` | string | QuickBooks response timestamp |
597+
597598
### `quickbooks_create_estimate`
598599

599600
Create an estimate with bounded item and description lines

apps/sim/tools/quickbooks/read_sales_transactions.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import type {
55
QuickBooksReadSalesTransactionsResponse,
66
QuickBooksSalesTransaction,
77
} from '@/tools/quickbooks/types'
8-
import {
9-
QUICKBOOKS_LIST_OUTPUTS,
10-
QUICKBOOKS_SALES_TRANSACTION_PROPERTIES,
11-
} from '@/tools/quickbooks/types'
8+
import { QUICKBOOKS_SALES_TRANSACTION_PROPERTIES } from '@/tools/quickbooks/types'
129
import {
1310
buildQuickBooksEntityUrl,
1411
buildQuickBooksQueryUrl,
@@ -152,6 +149,31 @@ export const quickbooksReadSalesTransactionsTool: ToolConfig<
152149
optional: true,
153150
items: { type: 'json', properties: QUICKBOOKS_SALES_TRANSACTION_PROPERTIES },
154151
},
155-
...QUICKBOOKS_LIST_OUTPUTS,
152+
startPosition: {
153+
type: 'number',
154+
description: 'One-based position of the first item in this response',
155+
optional: true,
156+
},
157+
maxResults: {
158+
type: 'number',
159+
description: 'Actual number of items reported for this response',
160+
optional: true,
161+
},
162+
nextStartPosition: {
163+
type: 'number',
164+
description: 'Position to use when explicitly requesting the next page',
165+
optional: true,
166+
},
167+
hasMore: {
168+
type: 'boolean',
169+
description: 'Conservative indication that another page may exist',
170+
optional: true,
171+
},
172+
time: {
173+
type: 'string',
174+
description: 'QuickBooks response timestamp',
175+
optional: true,
176+
nullable: true,
177+
},
156178
},
157179
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ describe('QuickBooks sales reader', () => {
129129
})
130130
})
131131

132+
it('marks mode-specific sales read outputs as optional', () => {
133+
expect(quickbooksReadSalesTransactionsTool.outputs.item?.optional).toBe(true)
134+
expect(quickbooksReadSalesTransactionsTool.outputs.items?.optional).toBe(true)
135+
for (const output of ['startPosition', 'maxResults', 'nextStartPosition', 'hasMore']) {
136+
expect(quickbooksReadSalesTransactionsTool.outputs[output]?.optional).toBe(true)
137+
}
138+
})
139+
132140
it('rejects malformed records without usable QuickBooks IDs', async () => {
133141
await expect(
134142
quickbooksReadSalesTransactionsTool.transformResponse!(

0 commit comments

Comments
 (0)