Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special override for _account_name (closes #16) #17

Closed
wants to merge 1 commit into from

Conversation

davestimpert
Copy link

Basic, not-so-elegant solution to #16
Could be made more generic for complex columns, though this may be a one-of-a-kind situation so I didn't take time to over-engineer it.

@@ -23,7 +23,11 @@ exports.getTransactions = async (transactionColumns, categoryOverrides, currentM
* { "category.0": "Food and Drink", "category.1": "Restaurants" }
*/
_.forEach(transactionColumns, column => {
sanitized[column] = _.get(sanitized, column);
if(column == "_ACCOUNT_NAME") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be ===

@kevinschaich
Copy link
Owner

kevinschaich commented Feb 11, 2019

This looks OK for now. If we run into this again, I think I'd prefer a "fallback list" for each column:

  const defaultTransactionColumns = [
    'date',
    'amount',
    'name',
    ['account_details.official_name', 'account_details.name'],
    'category.0',
    'category.1',
    'pending'
  ];

where in the code, we loop through and take the first value that is defined for that column.

@kevinschaich
Copy link
Owner

Closing in favor of #28, discussion to continue in #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants