Skip to content

Commit

Permalink
docs: auto categorization and devlog
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Feb 27, 2024
1 parent a7b7d14 commit 7f9a59e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
31 changes: 29 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,26 @@ This tool can be configured using a `.budget-cli.json` file in the root of this
"AccountTranslatorName1": "/path/to/destination/directory/for/TranslatorName1",
"AccountTranslatorName2": "/path/to/destination/directory/for/TranslatorName2",
},
"defaultImportDir": "/path/to/default/import/directory"
"defaultImportDir": "/path/to/default/import/directory",
"autoCategorization": [
{
"descriptions": [
"Description 1",
"Description 2"
],
"amount": {
"lt": 150,
"lte": 125,
"gte": 75,
"gt": 50,
},
"categorization": {
"category": "expense",
"subCategory": "family",
"expenseType": "need",
"notes": "Notes here"
}
}
}
```

Expand All @@ -53,4 +72,12 @@ All keys are optional and will provide defaults.
- `expenseTypeMapping`: The keys in the object are expense categories and the values are an expense type of "need" or "want" to automatically map expense categories to types.
- `expenseAllowance`: This can be set to an object with keys indicating a specific year. Each year should be set to an object with expense sub-categories as keys. Each sub-category should be set to an object with the keys `allowance`, indicating how much is allowed per month, and `carryover`, indicating any rollover from the previous year (or `0` if none).
- `moveFilesAfterImport`: This can be set to an object with keys indicating an account name and values indicating an absolute path to a local directory. If a destination path is set for a specific account, the CSV file will be moved there after successful import.
- `defaultImportDir`: This can be set to a directory where the import command will look for CSV files. If this is not present then the command will require a directory path in the `input` flag.
- `defaultImportDir`: This can be set to a directory where the import command will look for CSV files. If this is not present then the command will require a directory path in the `input` flag.
- `autoCategorization`: This can be set to a specifically-shaped object that will be used to auto-categorize transactions.
- `descriptions` is an array of one or more strings that are used to match the incoming transaction description in an "or" strategy.
- `amount` is an object that should have at least one of the following keys:
- `gt` (greater than)
- `gte` (greater than or equals)
- `lt` (less than)
- `lte` (less than or equals)
- `categorization` is the object that is merged with the transaction data if the conditions are met.
10 changes: 8 additions & 2 deletions docs/devlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
Notes taken during development, newest to oldest.

TODO:
- [ ] Auto-categorization rules
- [ ] Deal with mistakes during import (summarize and accept or allow restarting)
- [ ] Editing transactions
- [ ] Deleting transactions
- [ ] Reconciling transactions against a folder of CSVs
- [ ] Investigate Plaid importing

## [[2024-02-26]]

I starting working on the auto-categorization and I knew I wanted to be able to see the auto-categorized transaction before saving it. So I worked on the transaction printing and added that as a confirm prompt if it's able to categorize. This worked pretty well as a solution to the editing problem. Now, after the transaction is complete, you have to confirm to save it. That's helped me a few times already walking through the imports for the year.

I got hung up on Jest testing as I was making this change. I realized that a lot of the Jest and TypeScript combination is a mystery, I just try different options until it works. I'd like to put together a TS + Node + Jest starter repo with everything all wired up so I can re-use it and *actually* understand how all of these flags are working together. It was a function of `moduleNameMapper` ([StackOverflow answer]([https://stackoverflow.com/a/69598249](https://stackoverflow.com/a/69598249))) changing the `*.js` import to remove the file extension. Why does it work in TS but not Jest? Who knows! 🪄

During my troubleshooting and testing today I tried out [csvlens](https://github.com/YS-L/csvlens) and it worked really well for navigating the CSV data output.

## [[2024-02-23]]

This tool has been very useful for me for the last year. The satisfaction of building your own tool combined with the ability to make the tool exactly what you need have both combined to make this feel like a resounding success so far. That said, there is plenty of room for improvement here.
Expand Down

0 comments on commit 7f9a59e

Please sign in to comment.