Open brafdlog opened 4 years ago
@baruchiro I updated the description, please take a look and see what you think.
Issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Currently the logic for classifying a transaction relies on the
categoryCalculationScript.js
. Most of the logic there is matching patterns of descriptions to patterns or exact matches. In order to make this easily configurable by the user, we want to move this logic to a json configuration that will contain the list of patterns and exact matches. After this is taken from the json, expose a ui for managing this in the config screen.Notes:
Proposed solution:
The
getCategoryNameByTransactionDescription
will fetch this json and use it to get the transaction category according to the following logic:Look for an exact match for the transaction description string in the
exactMatches
arrays.If not found fall back to looking for substring matches in the
patternMatches
arrays.JSON structure:
This json should be saved in a place where it can be used both in development and in release. There are a few options to implement this, see open questions.
Have a
defaultCategoryMapping.json
file committed to git. If the user has no mapping logic defined yet, take the default and save it as the user's json for future customization.Open questions: