Skip to content

Commit ccb791c

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): generate purchasing arrays correctly
1 parent b29b0e1 commit ccb791c

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
@@ -696,7 +696,6 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
696696
enabled: true,
697697
prompt:
698698
'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.',
699-
generationType: 'json-object',
700699
},
701700
},
702701
{
@@ -794,7 +793,6 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
794793
enabled: true,
795794
prompt:
796795
'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.',
797-
generationType: 'json-object',
798796
},
799797
},
800798
{

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)