Skip to content

Commit 877f834

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): generate purchasing arrays correctly
1 parent 2be8b04 commit 877f834

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

apps/sim/blocks/blocks/quickbooks.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
684684
enabled: true,
685685
prompt:
686686
'Generate a JSON array of QuickBooks purchasing lines. Use account lines with lineType account, positive amount, accountId, and optional description; or item lines with lineType item, positive amount, itemId, and optional description, positive quantity, and positive unitPrice. When quantity and unitPrice are both present, amount must equal their product. Return ONLY the JSON array - no explanations, no extra text.',
687-
generationType: 'json-object',
688687
},
689688
},
690689
{
@@ -782,7 +781,6 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
782781
enabled: true,
783782
prompt:
784783
'Generate a JSON array of QuickBooks Bill allocations using only billId and a positive amount. Allocation amounts must total the payment amount. Return ONLY the JSON array - no explanations, no extra text.',
785-
generationType: 'json-object',
786784
},
787785
},
788786
{

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,14 @@ describe('QuickBooks purchasing mutation bodies', () => {
448448
})
449449

450450
describe('QuickBooks purchasing block', () => {
451+
it('does not force array-valued wand prompts through JSON-object generation', () => {
452+
for (const id of ['purchasingLines', 'billAllocations']) {
453+
const subBlock = QuickBooksBlock.subBlocks.find((candidate) => candidate.id === id)
454+
expect(subBlock?.wandConfig?.enabled).toBe(true)
455+
expect(subBlock?.wandConfig?.generationType).toBeUndefined()
456+
}
457+
})
458+
451459
it('parses dynamic purchasing JSON and numeric values in block parameter mapping', () => {
452460
expect(
453461
QuickBooksBlock.tools.config!.params!({

0 commit comments

Comments
 (0)