Skip to content

Commit

Permalink
fix: update ynab to 2.4.0 (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
gczobel authored Aug 1, 2024
1 parent 3962f8b commit 3633f8a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"hash-it": "^6.0.0",
"israeli-bank-scrapers": "^5.1.1",
"telegraf": "^4.16.3",
"ynab": "^2.2.0"
"ynab": "^2.4.0"
},
"devDependencies": {
"@types/debug": "^4.1.12",
Expand Down
6 changes: 3 additions & 3 deletions src/storage/ynab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class YNABStorage implements TransactionStorage {
} satisfies SaveStats;

// Initialize an array to store non-pending and non-empty account ID transactions on YNAB format.
const txToSend: ynab.SaveTransaction[] = [];
const txToSend: ynab.SaveTransactionWithOptionalFields[] = [];
const missingAccounts = new Set<string>();

for (let tx of txns) {
Expand Down Expand Up @@ -127,14 +127,14 @@ export class YNABStorage implements TransactionStorage {
private convertTransactionToYnabFormat(
tx: TransactionRow,
accountId: string,
): ynab.SaveTransaction {
): ynab.SaveTransactionWithIdOrImportId {
const amount = Math.round(tx.chargedAmount * 1000);

return {
account_id: accountId,
date: format(parseISO(tx.date), YNAB_DATE_FORMAT, {}),
amount,
payee_id: null,
payee_id: undefined,
payee_name: tx.description,
cleared:
tx.status === TransactionStatuses.Completed
Expand Down

0 comments on commit 3633f8a

Please sign in to comment.