From 50c7385cc3292bf037c01e3226adde0f5a28ebdc Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 14:38:12 -0600 Subject: [PATCH 01/12] create thread if needed --- src/components/Search.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index fcb915379181..5fbfa1fcdcf7 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -20,6 +20,8 @@ import type {SearchQuery} from '@src/types/onyx/SearchResults'; import type SearchResults from '@src/types/onyx/SearchResults'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; +import * as ReportActions from '@libs/actions/Report'; +import * as ReportUtils from '@libs/ReportUtils'; import SelectionList from './SelectionList'; import SearchTableHeader from './SelectionList/SearchTableHeader'; import type {ReportListItemType, TransactionListItemType} from './SelectionList/types'; @@ -136,6 +138,12 @@ function Search({query, policyIDs, sortBy, sortOrder}: SearchProps) { onSelectRow={(item) => { const reportID = isReportListItemType(item) ? item.reportID : item.transactionThreadReportID; + if (true) { + const newThreadID = ReportUtils.generateReportID(); + ReportActions.openReport(newThreadID, '', ['cc2@cc.com'], {}, item.parentReportActionID); + Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(query, newThreadID)); + return; + } openReport(reportID); }} shouldDebounceRowSelect From fc1ea1df9a1ec3b9e02c1f2847181bc524902fcf Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 15:04:38 -0600 Subject: [PATCH 02/12] move method --- src/components/Search.tsx | 14 ++++++++------ src/libs/actions/Search.ts | 12 ++++++++++++ src/types/onyx/SearchResults.ts | 3 +++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 5fbfa1fcdcf7..2ef9da087d6d 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -20,8 +20,6 @@ import type {SearchQuery} from '@src/types/onyx/SearchResults'; import type SearchResults from '@src/types/onyx/SearchResults'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; -import * as ReportActions from '@libs/actions/Report'; -import * as ReportUtils from '@libs/ReportUtils'; import SelectionList from './SelectionList'; import SearchTableHeader from './SelectionList/SearchTableHeader'; import type {ReportListItemType, TransactionListItemType} from './SelectionList/types'; @@ -39,6 +37,11 @@ function isReportListItemType(item: TransactionListItemType | ReportListItemType return reportListItem.transactions !== undefined; } +function isTransactionListItemType(item: TransactionListItemType | ReportListItemType): item is TransactionListItemType { + const transactionListItem = item as TransactionListItemType; + return transactionListItem.transactionID !== undefined; +} + function Search({query, policyIDs, sortBy, sortOrder}: SearchProps) { const {isOffline} = useNetwork(); const styles = useThemeStyles(); @@ -138,12 +141,11 @@ function Search({query, policyIDs, sortBy, sortOrder}: SearchProps) { onSelectRow={(item) => { const reportID = isReportListItemType(item) ? item.reportID : item.transactionThreadReportID; - if (true) { - const newThreadID = ReportUtils.generateReportID(); - ReportActions.openReport(newThreadID, '', ['cc2@cc.com'], {}, item.parentReportActionID); - Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(query, newThreadID)); + if (isTransactionListItemType(item) && item.transactionThreadReportID === '0' && item.moneyRequestReportActionID) { + SearchActions.createTransactionThread(hash, query, item.transactionID, item.moneyRequestReportActionID); return; } + openReport(reportID); }} shouldDebounceRowSelect diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 43f3e2697e8a..5c62fa5ef511 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -1,9 +1,13 @@ import Onyx from 'react-native-onyx'; import type {OnyxUpdate} from 'react-native-onyx'; import * as API from '@libs/API'; +import ROUTES from '@src/ROUTES'; import type {SearchParams} from '@libs/API/parameters'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; +import * as ReportUtils from '@libs/ReportUtils'; +import Navigation from '@navigation/Navigation'; +import * as ReportActions from './Report'; function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParams) { const optimisticData: OnyxUpdate[] = [ @@ -32,7 +36,15 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam API.read(READ_COMMANDS.SEARCH, {hash, query, offset, policyIDs, sortBy, sortOrder}, {optimisticData, finallyData}); } + +function createTransactionThread(hash: number, query: string, transactionID: string, moneyRequestReportActionID: string) { + const newTransactionThreadReportID = ReportUtils.generateReportID(); + ReportActions.openReport(newTransactionThreadReportID, '', ['cc2@cc.com'], {}, moneyRequestReportActionID); + Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(query, newTransactionThreadReportID)); +} + export { // eslint-disable-next-line import/prefer-default-export search, + createTransactionThread, }; diff --git a/src/types/onyx/SearchResults.ts b/src/types/onyx/SearchResults.ts index c7d63e95fd3d..5189a125db9c 100644 --- a/src/types/onyx/SearchResults.ts +++ b/src/types/onyx/SearchResults.ts @@ -151,6 +151,9 @@ type SearchTransaction = { /** The modified MCC Group associated with the transaction */ modifiedMCCGroup?: ValueOf; + + /** The ID of the money request reportAction associated with the transaction */ + moneyRequestReportActionID?: string; }; type SearchAccountDetails = Partial; From 68701361246ceff8446c368906af7033a0c3c046 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 15:34:38 -0600 Subject: [PATCH 03/12] refactor method --- src/components/Search.tsx | 27 +++++++++++---------------- src/libs/actions/Search.ts | 11 ++++------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 2ef9da087d6d..09b4a13290c8 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -20,6 +20,7 @@ import type {SearchQuery} from '@src/types/onyx/SearchResults'; import type SearchResults from '@src/types/onyx/SearchResults'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; +import * as ReportUtils from '@libs/ReportUtils'; import SelectionList from './SelectionList'; import SearchTableHeader from './SelectionList/SearchTableHeader'; import type {ReportListItemType, TransactionListItemType} from './SelectionList/types'; @@ -32,11 +33,6 @@ type SearchProps = { sortOrder?: SortOrder; }; -function isReportListItemType(item: TransactionListItemType | ReportListItemType): item is ReportListItemType { - const reportListItem = item as ReportListItemType; - return reportListItem.transactions !== undefined; -} - function isTransactionListItemType(item: TransactionListItemType | ReportListItemType): item is TransactionListItemType { const transactionListItem = item as TransactionListItemType; return transactionListItem.transactionID !== undefined; @@ -79,11 +75,19 @@ function Search({query, policyIDs, sortBy, sortOrder}: SearchProps) { return ; } - const openReport = (reportID?: string) => { + const openReport = (item: TransactionListItemType | ReportListItemType) => { + let reportID = isTransactionListItemType(item) ? item.transactionThreadReportID : item.reportID; + if (!reportID) { return; } + // If we're trying to open a legacy transaction without a transaction thread, let's create the thread and navigate the user + if (isTransactionListItemType(item) && reportID === '0' && item.moneyRequestReportActionID) { + reportID = ReportUtils.generateReportID(); + SearchActions.createTransactionThread(hash, item.transactionID, reportID, item.moneyRequestReportActionID); + } + Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(query, reportID)); }; @@ -138,16 +142,7 @@ function Search({query, policyIDs, sortBy, sortOrder}: SearchProps) { updateCellsBatchingPeriod={200} ListItem={ListItem} sections={[{data: sortedData, isDisabled: false}]} - onSelectRow={(item) => { - const reportID = isReportListItemType(item) ? item.reportID : item.transactionThreadReportID; - - if (isTransactionListItemType(item) && item.transactionThreadReportID === '0' && item.moneyRequestReportActionID) { - SearchActions.createTransactionThread(hash, query, item.transactionID, item.moneyRequestReportActionID); - return; - } - - openReport(reportID); - }} + onSelectRow={(item) => openReport(item)} shouldDebounceRowSelect shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()} listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]} diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 5c62fa5ef511..41d6668b9ae4 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -1,12 +1,10 @@ import Onyx from 'react-native-onyx'; import type {OnyxUpdate} from 'react-native-onyx'; import * as API from '@libs/API'; -import ROUTES from '@src/ROUTES'; import type {SearchParams} from '@libs/API/parameters'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; import * as ReportUtils from '@libs/ReportUtils'; -import Navigation from '@navigation/Navigation'; import * as ReportActions from './Report'; function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParams) { @@ -37,14 +35,13 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam API.read(READ_COMMANDS.SEARCH, {hash, query, offset, policyIDs, sortBy, sortOrder}, {optimisticData, finallyData}); } -function createTransactionThread(hash: number, query: string, transactionID: string, moneyRequestReportActionID: string) { - const newTransactionThreadReportID = ReportUtils.generateReportID(); - ReportActions.openReport(newTransactionThreadReportID, '', ['cc2@cc.com'], {}, moneyRequestReportActionID); - Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(query, newTransactionThreadReportID)); +function createTransactionThread(hash: number, transactionID: string, reportID: string, moneyRequestReportActionID: string) { + ReportActions.openReport(reportID, '', ['cc2@cc.com'], {}, moneyRequestReportActionID); + + Onyx.merge(); } export { - // eslint-disable-next-line import/prefer-default-export search, createTransactionThread, }; From e3d6431a0b17838d3b457f74ab72e4eb1c838a2f Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 15:46:59 -0600 Subject: [PATCH 04/12] update snapshot key --- src/libs/actions/Search.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 41d6668b9ae4..cc3eeea412b5 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -4,7 +4,6 @@ import * as API from '@libs/API'; import type {SearchParams} from '@libs/API/parameters'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; -import * as ReportUtils from '@libs/ReportUtils'; import * as ReportActions from './Report'; function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParams) { @@ -38,7 +37,15 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam function createTransactionThread(hash: number, transactionID: string, reportID: string, moneyRequestReportActionID: string) { ReportActions.openReport(reportID, '', ['cc2@cc.com'], {}, moneyRequestReportActionID); - Onyx.merge(); + Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`, { + [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: { + data: { + [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: { + transactionThreadReportID: reportID + } + } + } + }); } export { From 34507be6aa1eef7bcdc480665587552f162a9a13 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 15:48:06 -0600 Subject: [PATCH 05/12] add current user --- src/libs/actions/Search.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index cc3eeea412b5..ed7511ad7fab 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -6,6 +6,14 @@ import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; import * as ReportActions from './Report'; +let currentUserEmail: string; +Onyx.connect({ + key: ONYXKEYS.SESSION, + callback: (val) => { + currentUserEmail = val?.email ?? ''; + }, +}); + function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParams) { const optimisticData: OnyxUpdate[] = [ { @@ -35,7 +43,7 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam } function createTransactionThread(hash: number, transactionID: string, reportID: string, moneyRequestReportActionID: string) { - ReportActions.openReport(reportID, '', ['cc2@cc.com'], {}, moneyRequestReportActionID); + ReportActions.openReport(reportID, '', [currentUserEmail], {}, moneyRequestReportActionID); Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`, { [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: { From a37bf9c8492550094438500e1d12b01081306c49 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 16:09:26 -0600 Subject: [PATCH 06/12] update onyx --- src/libs/actions/Search.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index ed7511ad7fab..2de2f9904424 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -5,6 +5,7 @@ import type {SearchParams} from '@libs/API/parameters'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; import * as ReportActions from './Report'; +import { SearchTransaction } from '@src/types/onyx/SearchResults'; let currentUserEmail: string; Onyx.connect({ @@ -45,15 +46,15 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam function createTransactionThread(hash: number, transactionID: string, reportID: string, moneyRequestReportActionID: string) { ReportActions.openReport(reportID, '', [currentUserEmail], {}, moneyRequestReportActionID); - Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`, { - [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: { - data: { - [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: { - transactionThreadReportID: reportID - } + const onyxUpdate: Record>> = { + data: { + [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: { + transactionThreadReportID: reportID, } } - }); + }; + + Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`, onyxUpdate); } export { From 75be90e1bcd3e473a90a7908576da3bf0d87abc8 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 16:25:06 -0600 Subject: [PATCH 07/12] fix lint --- src/components/Search.tsx | 2 +- src/libs/actions/Search.ts | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 09b4a13290c8..b575beaa3298 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -8,6 +8,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as SearchActions from '@libs/actions/Search'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import Log from '@libs/Log'; +import * as ReportUtils from '@libs/ReportUtils'; import * as SearchUtils from '@libs/SearchUtils'; import type {SearchColumnType, SortOrder} from '@libs/SearchUtils'; import Navigation from '@navigation/Navigation'; @@ -20,7 +21,6 @@ import type {SearchQuery} from '@src/types/onyx/SearchResults'; import type SearchResults from '@src/types/onyx/SearchResults'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; -import * as ReportUtils from '@libs/ReportUtils'; import SelectionList from './SelectionList'; import SearchTableHeader from './SelectionList/SearchTableHeader'; import type {ReportListItemType, TransactionListItemType} from './SelectionList/types'; diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 2de2f9904424..d374b4919fd5 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -4,8 +4,8 @@ import * as API from '@libs/API'; import type {SearchParams} from '@libs/API/parameters'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; +import {SearchTransaction} from '@src/types/onyx/SearchResults'; import * as ReportActions from './Report'; -import { SearchTransaction } from '@src/types/onyx/SearchResults'; let currentUserEmail: string; Onyx.connect({ @@ -50,14 +50,11 @@ function createTransactionThread(hash: number, transactionID: string, reportID: data: { [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: { transactionThreadReportID: reportID, - } - } + }, + }, }; Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`, onyxUpdate); } -export { - search, - createTransactionThread, -}; +export {search, createTransactionThread}; From e61f8718b979a12052ed1225fd36b2142ed029f7 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 4 Jun 2024 16:48:33 -0600 Subject: [PATCH 08/12] fix import --- src/libs/actions/Search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index d374b4919fd5..97fae8467b52 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -4,7 +4,7 @@ import * as API from '@libs/API'; import type {SearchParams} from '@libs/API/parameters'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; -import {SearchTransaction} from '@src/types/onyx/SearchResults'; +import type {SearchTransaction} from '@src/types/onyx/SearchResults'; import * as ReportActions from './Report'; let currentUserEmail: string; From b0cf2920bc7c0d5b6e27774d4139e9b13f7694c6 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 6 Jun 2024 09:39:33 -0600 Subject: [PATCH 09/12] Update src/libs/actions/Search.ts Co-authored-by: Andrew Rosiclair --- src/libs/actions/Search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 97fae8467b52..a5d31582f67a 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -5,7 +5,7 @@ import type {SearchParams} from '@libs/API/parameters'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; import type {SearchTransaction} from '@src/types/onyx/SearchResults'; -import * as ReportActions from './Report'; +import * as Report from './Report'; let currentUserEmail: string; Onyx.connect({ From 45f3dbce5b5fea6d5bb7fad624fb51d9cd3bc12b Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 6 Jun 2024 09:39:42 -0600 Subject: [PATCH 10/12] Update src/libs/actions/Search.ts Co-authored-by: Andrew Rosiclair --- src/libs/actions/Search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index a5d31582f67a..49fb23130640 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -44,7 +44,7 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam } function createTransactionThread(hash: number, transactionID: string, reportID: string, moneyRequestReportActionID: string) { - ReportActions.openReport(reportID, '', [currentUserEmail], {}, moneyRequestReportActionID); + Report.openReport(reportID, '', [currentUserEmail], {}, moneyRequestReportActionID); const onyxUpdate: Record>> = { data: { From 745771b2fc83a1081eb467f22212a9810ec9b5e4 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 6 Jun 2024 09:46:18 -0600 Subject: [PATCH 11/12] add comment --- src/libs/actions/Search.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 49fb23130640..bf94de9c52b2 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -43,6 +43,10 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam API.read(READ_COMMANDS.SEARCH, {hash, query, offset, policyIDs, sortBy, sortOrder}, {optimisticData, finallyData}); } +/** + * It's possible that we return legacy transactions that don't have a transaction thread created yet. + * In that case, when users select the search result row, we need to create the transaction thread on the fly and update the search result with the new transactionThreadReport + */ function createTransactionThread(hash: number, transactionID: string, reportID: string, moneyRequestReportActionID: string) { Report.openReport(reportID, '', [currentUserEmail], {}, moneyRequestReportActionID); From 3c948ded123ccf37ea5961a1c53e1aeec96a680a Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 6 Jun 2024 11:07:13 -0600 Subject: [PATCH 12/12] fix ts error --- src/components/Search.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 5d7ce7437fb8..3d295e72c09e 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -33,6 +33,8 @@ type SearchProps = { sortOrder?: SortOrder; }; +const sortableSearchTabs: SearchQuery[] = [CONST.TAB_SEARCH.ALL]; + function isTransactionListItemType(item: TransactionListItemType | ReportListItemType): item is TransactionListItemType { const transactionListItem = item as TransactionListItemType; return transactionListItem.transactionID !== undefined;