add alternative "quick" importer#530
Conversation
d49595c to
10589f8
Compare
jensschuppe
left a comment
There was a problem hiding this comment.
Didn't do a full review, just what caught my eye right away. Can you try making PHPStan and PHP_CodeSniffer happy first, @ufundo?
| /** | ||
| * Import a statement | ||
| */ | ||
| class Import extends ImportBase { |
There was a problem hiding this comment.
API action classes should be suffixed with Action.
| /** | ||
| * Fetch statement from a Google Sheet | ||
| */ | ||
| abstract class ImportBase extends \Civi\Api4\Generic\AbstractAction { |
There was a problem hiding this comment.
API action classes should be suffixed with Action - so this should be AbstractImportAction.
| /** | ||
| * Preview import | ||
| */ | ||
| class Preview extends ImportBase { |
There was a problem hiding this comment.
API action classes should be suffixed with Action.
|
Actually this adds a completely new approach for importing. I'm wondering if it would be better to have an APIv4 action that just references a configured importer. Apart of that I think it would make sense to refactor the current importer code and to separate data processing from persistence to make it easier to implement new import data processors. (Though that should be done in a different PR.) |
This adds an alternative UI / workflow for importing new statements into CiviBanking.
The import action does a series of auto-detections to find Date/Amount/Reference columns, and then imports all other columns into
data_parsedas is.It's probably not as robust as the standard approach with preconfigured settings, but quick to get going, and potentially more adaptable if source data columns change.
The UI component has a couple of niceties:
It only works for
csvat the moment; I'm not sure how well it could be adapted for less flatxmlsource data.I think it could be possible to allow using pre-configured importers with the same UI component, which could be really nice; but wasn't in scope for the project I was working on. Even better - if you could the
sentineltype config to determine the correct importer.