https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43616

            Bug ID: 43616
           Summary: Add core support for scheduled/automated patron import
                    (RFC)
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Patrons
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]
  Target Milestone: ---

This bug proposes adding native support to Koha core for scheduled,
unattended patron imports -- something core currently lacks entirely.

Today, Koha's patron import tooling (tools/import_borrowers.pl,
misc/import_patrons.pl, Koha::Patrons::Import) is manual-trigger only.
There is no way to configure a remote source and have Koha fetch and
import an updated patron file on a schedule without a human clicking
"import" or a hand-rolled external script.

In practice, this gap has been filled by third-party plugins -- most
notably koha-plugin-patrons-importer-advanced, which has real production
customers depending on scheduled SFTP-sourced patron imports, including
requests to run more than once per day. That plugin work highlighted
exactly what's missing from core.

This RFC proposes closing the gap with the same pattern Koha already
uses for a very similar problem: bug 43603 (scheduled article request
scan import), which polls a configured Koha::File::Transport (bug 35761)
for new files and imports them, with a DB-backed idempotency log so
repeated/frequent polling is safe.

Proposed for core:

- New tables patron_import_accounts and patron_import_log, mirroring
  the article_request_scan_accounts / article_request_scan_log pattern
  from bug 43603 (an account references a Koha::File::Transport, a
  matchpoint, defaults/preserve-fields, and an active flag; the log
  table records per-file processed/error status keyed by account and
  filename for idempotency).
- A new admin config page, admin/patron_import_accounts.pl, modeled on
  admin/article_request_scan_accounts.pl, for configuring named import
  sources.
- A new cronjob, misc/cronjobs/patron_imports.pl, modeled on
  misc/cronjobs/article_request_scans.pl, that polls active accounts,
  fetches new files via their configured file transport, and imports
  them via the existing Koha::Patrons::Import engine (no changes needed
  to the import engine itself -- this only adds scheduling/fetch
  infrastructure around it).

This is Phase B of a small roadmap; a follow-up bug (Phase C) would
apply the same pattern to scheduled patron photo import. This bug's
scope is Phase B only: scheduled patron record import.

No patch is attached yet. This bug is filed to open discussion on the
design (in particular, whether the article-request-scan pattern from
bug 43603 is the right one to reuse here) before implementation begins.

Depends on: bug 35761 (Koha::File::Transport)
See also: bug 43603 (article request scan import -- the precedent this
design follows)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to