[Bug 43795] New: Add REST API routes for MARC modification templates (read-only)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43795 Bug ID: 43795 Summary: Add REST API routes for MARC modification templates (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: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: tomascohen@gmail.com CC: tomascohen@gmail.com Target Milestone: --- Koha has no REST API for MARC modification templates (the marc_modification_templates and marc_modification_template_actions tables, managed in Tools > MARC modification templates and applied by C4::MarcModificationTemplates). Anything that needs to offer or display a template has to load the list server-side in a Perl script and embed it in the page. A concrete example: bug 30800 (a management page for MARC import staging profiles) needs a template dropdown in a Vue form, and the profiles REST resource (/import_batch_profiles) only returns the bare template_id. Proposal Add a read-only REST resource: - GET /marc_modification_templates (list, with the usual query, pagination and ordering support) - GET /marc_modification_templates/{marc_modification_template_id} Fields to expose: marc_modification_template_id (template_id) and name. The actions belonging to a template could be exposed later through ?_embed, but are out of scope for this bug. Implementation notes - There are DBIC result classes (Koha::Schema::Result::MarcModificationTemplate and ...Action) but no Koha::Object wrappers yet; add Koha::MarcModificationTemplate and Koha::MarcModificationTemplates. - 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. Managing templates uses the tools: marc_modification_templates permission, but a cataloguer staging records (tools: stage_marc_import) or doing batch modifications must be able to choose a template. Reading should probably be allowed with any of these; how best to express that in x-koha-authorization? 2. Write operations (add/edit/delete) and the template actions are deliberately left to later bugs. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43795 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30800 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30800 [Bug 30800] Ability to view, modify, and delete profiles for staging MARC records for import -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43795 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43795 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43795 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 207966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207966&action=edit Bug 43795: Add Koha::MarcModificationTemplate(s) object classes This patch adds Koha::MarcModificationTemplate and Koha::MarcModificationTemplates object classes on top of the marc_modification_templates table, along with unit tests. The next patch adds REST API routes built on these classes. Test plan: 1. Apply both patches of this bug 2. yarn build; restart_all 3. prove t/db_dependent/Koha/MarcModificationTemplates.t \ t/db_dependent/api/v1/marc_modification_templates.t 4. Both pass Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43795 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 207967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207967&action=edit Bug 43795: Add REST API routes for MARC modification templates Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43795 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org