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.