File tree Expand file tree Collapse file tree
apps/sim/tools/quickbooks Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change @@ -400,7 +400,6 @@ interface QuickBooksReportEnvelope {
400400 Header ?: QuickBooksReportHeader
401401 Columns ?: QuickBooksReportColumns
402402 Rows ?: QuickBooksReportRows
403- time ?: string
404403}
405404
406405function 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}
You can’t perform that action at this time.
0 commit comments