Skip to content

Commit fc1bfdc

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): expose report header time
1 parent ff96e30 commit fc1bfdc

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

apps/sim/tools/generated/tool-metadata.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ describe('QuickBooks financial report responses', () => {
237237
const result = await quickbooksRunFinancialReportTool.transformResponse!(
238238
Response.json({
239239
Header: {
240+
Time: 'test-time',
240241
ReportName: 'ProfitAndLoss',
241242
ReportBasis: 'Accrual',
242243
Currency: 'USD',
@@ -253,7 +254,6 @@ describe('QuickBooks financial report responses', () => {
253254
},
254255
],
255256
},
256-
time: 'test-time',
257257
}),
258258
params
259259
)

apps/sim/tools/quickbooks/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ interface QuickBooksReportEnvelope {
400400
Header?: QuickBooksReportHeader
401401
Columns?: QuickBooksReportColumns
402402
Rows?: QuickBooksReportRows
403-
time?: string
404403
}
405404

406405
function assertQuickBooksReportSection<T>(value: unknown, section: string): T {
@@ -418,14 +417,15 @@ export async function transformQuickBooksReportResponse(
418417
response,
419418
`QuickBooks ${reportType} report response`
420419
)
420+
const header = assertQuickBooksReportSection<QuickBooksReportHeader>(data.Header, 'Header')
421421
return {
422422
success: true,
423423
output: {
424424
reportType,
425-
header: assertQuickBooksReportSection<QuickBooksReportHeader>(data.Header, 'Header'),
425+
header,
426426
columns: assertQuickBooksReportSection<QuickBooksReportColumns>(data.Columns, 'Columns'),
427427
rows: assertQuickBooksReportSection<QuickBooksReportRows>(data.Rows, 'Rows'),
428-
time: typeof data.time === 'string' ? data.time : null,
428+
time: typeof header.Time === 'string' ? header.Time : null,
429429
},
430430
}
431431
}

0 commit comments

Comments
 (0)