@@ -20,7 +20,7 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
2020 try {
2121 const scraper = createScraper ( {
2222 companyId,
23- startDate : moment ( ) . subtract ( 6 , 'month' ) . toDate ( ) ,
23+ startDate : moment ( ) . subtract ( 12 , 'month' ) . toDate ( ) ,
2424 // ExecutablePath: '/opt/homebrew/bin/chromium',
2525 args : [ '--user-data-dir=./chrome-data' ] ,
2626 additionalTransactionInformation : true ,
@@ -50,9 +50,6 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
5050 const accountBalance = result . accounts ! [ 0 ] . balance ! ;
5151 const payees : PayeeEntity [ ] = await actual . getPayees ( ) ;
5252
53- // Print first 5 scraped transactions for debugging
54- log ( 'SCRAPED_TRANSACTIONS_SAMPLE' , { sample : transactions . slice ( 0 , 5 ) } ) ;
55-
5653 const mappedTransactions = transactions . map ( async x => ( {
5754 date : moment ( x . date ) . format ( 'YYYY-MM-DD' ) ,
5855 amount : actual . utils . amountToInteger ( x . chargedAmount ) ,
@@ -62,9 +59,6 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
6259 imported_id : `${ x . identifier } -${ moment ( x . date ) . format ( 'YYYY-MM-DD HH:mm:ss' ) } ` ,
6360 } ) ) ;
6461
65- // Print first 5 mapped transactions for debugging
66- log ( 'MAPPED_TRANSACTIONS_SAMPLE' , { sample : await Promise . all ( mappedTransactions . slice ( 0 , 5 ) ) } ) ;
67-
6862 stdout . mute ( ) ;
6963 const importResult = await actual . importTransactions ( bank . actualAccountId , await Promise . all ( mappedTransactions ) , { defaultCleared : true } ) ;
7064 stdout . unmute ( ) ;
0 commit comments