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
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:
We need to allow people to have their own setup - both control category names and control the mapping, because this is something that is not consistent across people and across budgeting tools. In the future we may consider having this configuration per output vendor.
We want this to work both in development from the repository and for the released electron app.
When running for the first time (either in dev or released electron app) should work with a default configuration without requiring an initial setup.
In future consider supporting regex patterns, but not required for initial phase.
Write unit tests for this logic.
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:
{
"exactMatches": {
"electricity": ["חברת חשמל", "חיוב חשמל חודשי"],
"groceries": ["המכולת של יהונתן", "המכולת של ברוך"]
},
"patternMatches": {
"car maintenance": ["מוסך", "טסט"],
"groceries": ["מכולת"]
}
}
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:
Should this be part of the config or separate json?
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:
The text was updated successfully, but these errors were encountered: