As an initial implementation, we could just match the 'memo' field with a regex. I'd be willing to give this a shot. Right now I think it should look something like this:
Data model: add an 'ImportPattern' StoredObject with the pattern/regex, the Account those lines should be linked to, and an index (because this should be an ordered list).
Logic: The logic could be called in ImportTwo#getSettings(). Instead of just attaching the 'default' account, first walk though the ImportPattern to see if any of those match.
UI: A 'Patterns...' button could be added to the 'Modify Transactions', the second tab of the 'import' wizard. It would open a popup in which ImportPatterns can be modified, reordered, deleted and added. It could have 'close' and 'apply' buttons: the former would just close the window, the latter would execute the automatic linkage logic again.
Does this sound like a reasonable approach?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As an initial implementation, we could just match the 'memo' field with a regex. I'd be willing to give this a shot. Right now I think it should look something like this:
Data model: add an 'ImportPattern' StoredObject with the pattern/regex, the Account those lines should be linked to, and an index (because this should be an ordered list).
Logic: The logic could be called in ImportTwo#getSettings(). Instead of just attaching the 'default' account, first walk though the ImportPattern to see if any of those match.
UI: A 'Patterns...' button could be added to the 'Modify Transactions', the second tab of the 'import' wizard. It would open a popup in which ImportPatterns can be modified, reordered, deleted and added. It could have 'close' and 'apply' buttons: the former would just close the window, the latter would execute the automatic linkage logic again.
Does this sound like a reasonable approach?
Preliminary patch: defining an applying works, but the UI needs work, patterns are not yet saved to the database and not applied initially
Implemetned with Bayes matching