@@ -668,18 +668,17 @@ export const makeInfiniteApi = (config: InfiniteApiConfig): InfiniteApi => {
668668 accounts : bankAccountCache . map ( account => ( {
669669 id : account . id ,
670670 type : 'EXTERNAL_BANK_ACCOUNT' ,
671- status :
672- account . verificationStatus === 'pending' ? 'PENDING' : 'ACTIVE' ,
673- currency : 'USD' ,
671+ status : account . status === 'PENDING' ? 'PENDING' : 'ACTIVE' ,
672+ currency : account . currency ,
674673 bankName : account . bankName ,
675- accountNumber : `**** ${ account . last4 } ` ,
676- routingNumber : '****0021' ,
674+ accountNumber : account . accountNumber ,
675+ routingNumber : account . routingNumber ,
677676 accountType : 'checking' ,
678- holderName : account . accountName ,
679- createdAt : new Date ( ) . toISOString ( ) ,
677+ holderName : account . holderName ,
678+ createdAt : account . createdAt ,
680679 metadata : {
681680 externalAccountId : `ext_acct_${ Date . now ( ) } ` ,
682- verificationStatus : account . verificationStatus
681+ verificationStatus : account . status
683682 }
684683 } ) ) ,
685684 totalCount : bankAccountCache . length
@@ -710,11 +709,15 @@ export const makeInfiniteApi = (config: InfiniteApiConfig): InfiniteApi => {
710709 id : `acct_bank_${ Date . now ( ) } _${ Math . random ( )
711710 . toString ( 36 )
712711 . substring ( 7 ) } `,
713- type : 'bank_account' ,
712+ type : 'EXTERNAL_BANK' ,
713+ status : 'PENDING' ,
714+ currency : 'USD' ,
714715 bankName : params . bankName ,
715- accountName : params . accountName ,
716- last4 : params . accountNumber . slice ( - 4 ) ,
717- verificationStatus : 'pending'
716+ accountNumber : `****${ params . accountNumber . slice ( - 4 ) } ` ,
717+ routingNumber : `****${ params . routingNumber . slice ( - 4 ) } ` ,
718+ holderName : params . accountOwnerName ,
719+ createdAt : new Date ( ) . toISOString ( ) ,
720+ metadata : { }
718721 }
719722
720723 // Add to cache
0 commit comments