Skip to content

Commit

Permalink
fix: visa Cal wrong day of transaction, and missing fields (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro authored May 2, 2023
1 parent 580cc03 commit 6b961fd
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/scrapers/visa-cal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,21 @@ function convertParsedDataToTransactions(parsedData: CardTransactionDetails[]):
}

const result: Transaction = {
chargedAmount,
identifier: transaction.trnIntId,
description: transaction.merchantName,
originalAmount,
originalCurrency: transaction.trnCurrencySymbol,
processedDate: transaction.debCrdDate,
type: [trnTypeCode.regular, trnTypeCode.standingOrder].includes(transaction.trnTypeCode) ?
TransactionTypes.Normal :
TransactionTypes.Installments,
status: TransactionStatuses.Completed,
date: installments ?
date.add(installments.number - 1, 'month').toISOString() :
date.toISOString(),
type: [trnTypeCode.regular, trnTypeCode.standingOrder].includes(transaction.trnTypeCode) ?
TransactionTypes.Normal :
TransactionTypes.Installments,
memo: transaction.transTypeCommentDetails.toString() || undefined,
processedDate: new Date(transaction.debCrdDate).toISOString(),
originalAmount,
originalCurrency: transaction.trnCurrencySymbol,
chargedAmount,
chargedCurrency: transaction.debCrdCurrencySymbol,
description: transaction.merchantName,
memo: transaction.transTypeCommentDetails.toString(),
category: transaction.branchCodeDesc,
};

Expand Down

0 comments on commit 6b961fd

Please sign in to comment.