diff --git a/src/CONST.ts b/src/CONST.ts index 1ef2f3e83246..fb3e2ead7976 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1170,6 +1170,7 @@ const CONST = { SMALL_NORMAL: 'small-normal', }, EXPENSIFY_CARD: { + BANK: 'Expensify Card', FRAUD_TYPES: { DOMAIN: 'domain', INDIVIDUAL: 'individal', diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index bbb938a666ac..beb0ea800091 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -1,3 +1,6 @@ +import {Card} from '../types/onyx'; +import CONST from '../CONST'; + /** * @returns string with a month in MM format */ @@ -15,4 +18,11 @@ function getYearFromExpirationDateString(expirationDateString: string) { return cardYear.length === 2 ? `20${cardYear}` : cardYear; } -export {getMonthFromExpirationDateString, getYearFromExpirationDateString}; +function getCompanyCards(cardList: {string: Card}) { + if (!cardList) { + return []; + } + return Object.values(cardList).filter((card) => card.bank !== CONST.EXPENSIFY_CARD.BANK); +} + +export {getMonthFromExpirationDateString, getYearFromExpirationDateString, getCompanyCards};