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

            Bug ID: 43794
           Summary: Add REST API routes for record matching rules
                    (read-only)
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: REST API
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]
  Target Milestone: ---

Koha has no REST API for record matching rules (the marc_matchers table,
managed in Administration > Record matching rules and consumed by C4::Matcher).
Anything that needs to offer or display a matching rule has to get the list
some other way, by loading it server-side in a Perl script and embedding it in
the page, or by querying the database directly.

A concrete example: bug 30800 (a management page for MARC import staging
profiles) needs a matching-rule dropdown in a Vue form, and the profiles REST
resource (/import_batch_profiles) only returns the bare matcher_id.

Proposal

Add a read-only REST resource:
- GET /record_matchers (list, with the usual query, pagination and ordering
support)
- GET /record_matchers/{record_matcher_id}

Fields to expose: record_matcher_id (matcher_id), code, description,
record_type, threshold. The matchpoints and match checks (the detailed rules)
are out of scope for this bug.

Implementation notes
- There is a DBIC result class (Koha::Schema::Result::MarcMatcher) but no
Koha::Object wrapper yet; add Koha::RecordMatcher and Koha::RecordMatchers.
- Add the swagger definition and paths, and a Koha::REST::V1 controller.
- Add unit tests for the object classes and REST tests under
t/db_dependent/api/v1/.

Open questions
1. Permissions. The matching rules page uses the manage_matching_rules
parameters permission, but a cataloguer staging records (tools:
stage_marc_import) must be able to choose a rule. Reading should probably be
allowed with either; how best to express that in x-koha-authorization?
2. Naming: record_matchers, or matching_rules?
3. Write operations (add/edit/delete) are deliberately left to a later bug.

-- 
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