You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to use Caspion to export transactions into YNAB, but I have multiple accounts on the same financial providers and I don't want to export all of them.
This is impossible at the moment. If your YNAB config has unmapped accounts, the YNAB exporter hangs and logs the following:
Unhandled account number <accountNumber>
Describe the solution you'd like
Simply ignore transactions from accounts that have no YNAB mapping. Emit a message in the logger indicating which accounts were skipped.
Describe alternatives you've considered
I see 2 options:
Always ignore unmapped accounts
Add an option in the config to allow ignoring unmapped accounts. If it's enabled - skip. Otherwise - error.
Additional context
The root cause is the throw statement here:
thrownewError(`Unhandled account number ${transactionAccountNumber}`);
}
returnynabAccountId;
}
I think the proper solution would be to refactor the YNAB exporter such that it exports transactions by account. This way the skip can be done before processing the transactions, and we'll have a single log line per skipped account instead of a line per transaction from skipped accounts.
Something along the lines of:
constcreateTransactions: ExportTransactionsFunction=async({ transactionsToCreate, startDate },eventPublisher)=>{// ...consttransactionsByAccount=// mapping from accountNumber to list of transactions from that accountconstresults=transactionsByAccount.forEach(createTransactionsByAccount(accountNumber,accountTransactions))returnsum(results)}functioncreateTransactionsByAccount(accountNumber,accountTransactions){if(unmapped(accountNumber)){emit("skipping message")// or throw, depending on the decided approachreturn}// process transactions as before}
I'm willing to work on this, but let me know what you think first :)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to use Caspion to export transactions into YNAB, but I have multiple accounts on the same financial providers and I don't want to export all of them.
This is impossible at the moment. If your YNAB config has unmapped accounts, the YNAB exporter hangs and logs the following:
Describe the solution you'd like
Simply ignore transactions from accounts that have no YNAB mapping. Emit a message in the logger indicating which accounts were skipped.
Describe alternatives you've considered
I see 2 options:
Additional context
The root cause is the throw statement here:
caspion/packages/main/src/backend/export/outputVendors/ynab/ynab.ts
Lines 136 to 142 in 3e7c007
I think the proper solution would be to refactor the YNAB exporter such that it exports transactions by account. This way the skip can be done before processing the transactions, and we'll have a single log line per skipped account instead of a line per transaction from skipped accounts.
Something along the lines of:
I'm willing to work on this, but let me know what you think first :)
The text was updated successfully, but these errors were encountered: