Skip to content

add alternative "quick" importer#530

Open
ufundo wants to merge 4 commits into
Project60:masterfrom
ufundo:quick-importer
Open

add alternative "quick" importer#530
ufundo wants to merge 4 commits into
Project60:masterfrom
ufundo:quick-importer

Conversation

@ufundo
Copy link
Copy Markdown
Contributor

@ufundo ufundo commented Apr 20, 2026

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_parsed as 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:

  • option to import from a URL (in the project I'm working on the source data comes from Google Sheets (:sigh:), this saves having to download and then re-upload)
  • provide a preview before run, which allows users to follow what is happening and pre check invalid data.

It only works for csv at the moment; I'm not sure how well it could be adapted for less flat xml source 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 sentinel type config to determine the correct importer.

@ufundo ufundo force-pushed the quick-importer branch 3 times, most recently from d49595c to 10589f8 Compare April 20, 2026 17:44
@jensschuppe jensschuppe added enhancement status:needs work There is code, but it needs additional work before it should be reviewed labels May 26, 2026
Copy link
Copy Markdown
Collaborator

@jensschuppe jensschuppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API action classes should be suffixed with Action.

/**
* Fetch statement from a Google Sheet
*/
abstract class ImportBase extends \Civi\Api4\Generic\AbstractAction {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API action classes should be suffixed with Action - so this should be AbstractImportAction.

/**
* Preview import
*/
class Preview extends ImportBase {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API action classes should be suffixed with Action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement status:needs work There is code, but it needs additional work before it should be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants