Koha-clms/api/v1/swagger/paths
Zeno Tajoli 50a2e9316a Bug 33036: REST API: Merge biblio records implements merging of records
+ attached items, subscriptions etc via the API as an alternative to the web interface: cgi-bin/koha/cataloguing/merge.pl

This is a slightly improved version of Zenos patch: I (domm) have converted the code in Koha::Biblio to a more DBICy style and packed it into a transaction (as requested in Comment 23)

Even the QA script is happy now!

To test:
    1) you need an API user with the permissions "editcatalogue"
    2) two records: one to be merged into (with biblio_id, eg 262) and another one from
       which to merge (with biblio_id_to_merge, eg 9) which will be deleted!
       both records may/should have items, subscription, subscriptionhistory, serial, suggestions
       orders and holds
    3) check both records via the web
    4) Apply patch
    5) Write a JSON file with inside the field 'biblio_id_to_merge' and the biblionumber from wihich to merge.
       As example:
       {
         "biblio_id_to_merge" : 9
       }
     6) Execute an API call with correct headers and location. For example:
        curl -s -u koha:koha --header "Content-Type: application/json" --header "Accept: application/marc-in-json"
                  --request POST "http://127.0.0.1:8080/api/v1/biblios/262/merge" -d @file.json
        You must to setup the headers and to use a json file with parameters
     7) The record with the id 9 is deleted now, the record with 262 has all items, etc attached,
        the return is: return code 200 and the changed record 262 in marc-in-json format
     8) It is possible to override biblio data with an external bib record. You need to put external bib record
        into the json file in marc-in-json format. To write use the json file uploaded as example
        You need to fill the fields 'rules' and 'datarecord'. The field 'rules' must contains 'override_ext'
        To do the call:
         curl -s -u koha:koha --header "Content-Type: application/json" --header "Accept: application/marc-in-json"
                  --request POST "http://127.0.0.1:8080/api/v1/biblios/XXX/merge" -d @file_with_recod.json
      9) The record in 'biblio_id_to_merge' is deleted now, in biblio XXX now there are the bibliographic data
         of field 'datarecord' of json file, the return is: return code 200 and the changed record XXX in marc-in-json format
      10) Go into intranet and do a search. Select two or (better) more record.
      11) Merge them; merge must be a success.
      12) Test with prove -v t/db_dependent/Koha/Biblio.t
      13) Test with prove -v t/db_dependent/api/v1/biblios.t

To test with curl the step 8 you can customize the json file attached in bugzilla.
The marc-in-json record inside follows the MAR21 standard

Sponsored-by: Technische Hochschule Wildau
Co-authored-by: Zeno Tajoli <ztajoli@gmail.com>
Co-authored-by: Thomas Klausner <domm@plix.at>
Co-authored-by: Mark Hofstetter <<mark@hofstetter.at>>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>

Bug 33036: Update of test number.

File ../biblios.t was update with a new subutest.
So we need this update to have a 'OK' after test running.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c60a6d8cd9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-03-21 10:43:30 +01:00
..
acquisitions_baskets.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
acquisitions_funds.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
acquisitions_orders.yaml Bug 36066: (follow-up) Move 403 to 409 when status ne cancelled 2024-03-11 15:35:52 +01:00
acquisitions_vendor_issues.yaml Bug 35634: (bug 33105 follow-up) fix typo issues_manage vs issue_manage 2024-01-15 15:22:24 +01:00
acquisitions_vendors.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
advancededitormacros.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
article_requests.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
auth.yaml Bug 34313: Add patron information in pass validation response 2023-08-29 14:59:02 -03:00
authorised_value_categories.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
authorised_values.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
authorities.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
biblios.yaml Bug 35469: Add 'manage_bookings' permission to biblios/checkouts 2024-03-11 11:22:54 +01:00
biblios_item_groups.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
biblios_merge.yaml Bug 33036: REST API: Merge biblio records implements merging of records 2024-03-21 10:43:30 +01:00
bookings.yaml Bug 36100: (QA follow-up) Move 400 to 409 2024-03-11 11:00:23 +01:00
cash_registers.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
checkouts.yaml Bug 35469: Add 'manage_bookings' subpermission to /checkouts 2024-03-11 11:22:54 +01:00
circulation-rules.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
cities.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
clubs.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
config_smtp_servers.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
erm_agreements.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_config.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_counter_files.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_counter_logs.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_counter_registries.yaml Bug 34587: Move everything into a ERM/EUsage subfolder 2023-10-31 16:46:18 -03:00
erm_custom_reports.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_default_usage_reports.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_documents.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_eholdings_packages.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_eholdings_packages_resources.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_eholdings_resources.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_eholdings_titles.yaml Bug 34789: Database and API update 2023-09-18 12:06:17 -03:00
erm_eholdings_titles_resources.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_licenses.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
erm_sushi_services.yaml Bug 34587: Fix stray type definition 2023-11-01 15:00:17 -03:00
erm_usage_data_providers.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_usage_databases.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_usage_items.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_usage_platforms.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_usage_titles.yaml Bug 35219: Fix ERM usage endpoints to show in docs 2023-11-06 08:42:40 -03:00
erm_users.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
holds.yaml Bug 34333: Add embed option for `cancellation_requested` for holds 2023-09-18 15:31:49 -03:00
ill_backends.yaml Bug 22440: Move backend statuses api endpoint 2023-05-05 09:13:43 -03:00
ill_batches.yaml Bug 30719: (QA follow-up) Pick better column names and cleanup 2023-10-17 14:45:23 -03:00
ill_batchstatuses.yaml Bug 30719: (QA follow-up) Rename illbatchstatuses 2023-10-17 14:45:22 -03:00
ill_requests.yaml Bug 30719: Rename `batch` for `ill_batch` in Koha::Illrequest 2023-10-17 14:45:25 -03:00
import_batch_profiles.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
import_batches.yaml Bug 30855: Rename /import => /import_batches 2022-06-02 13:42:28 -03:00
item_types.yaml Bug 34008: Add REST endpoint for list of itemtypes 2023-11-01 17:23:14 -03:00
items.yaml Bug 29002: (follow-up) Rebase fix, remove q_header 2023-11-03 12:04:15 -03:00
jobs.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
libraries.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
oauth.yaml Bug 32354: Accept session_state param given by OAuth IdP 2022-12-07 12:58:32 -03:00
patrons.yaml Bug 35773: Add manage_bookings subpermission to patron searching 2024-03-11 11:22:07 +01:00
patrons_account.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
patrons_extended_attributes.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
patrons_holds.yaml Bug 35658: Fix misaligned collectionFormat in patron_holds.yaml 2024-01-08 15:05:50 +01:00
patrons_password.yaml Bug 29926: (QA follow-up) Date format missing in spec 2022-05-06 10:33:10 -10:00
preservation_config.yaml Bug 30708: Rebase - Use a dedicated 'config' endpoint 2023-10-18 15:42:00 -03:00
preservation_processings.yaml Bug 30708: Remove q_header from specs 2023-10-18 15:41:57 -03:00
preservation_trains.yaml Bug 33547: Add print slip 2023-10-23 11:33:51 -03:00
preservation_waiting_list.yaml Bug 30708: Adjust spec for train_item 2023-10-20 14:44:05 -03:00
public_oauth.yaml Bug 32354: Accept session_state param given by OAuth IdP 2022-12-07 12:58:32 -03:00
public_patrons.yaml Bug 35368: Add public to "Add a new checkout" in API documentation 2024-02-01 17:18:09 +01:00
quotes.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
return_claims.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
rotas.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
search_filters.yaml Bug 34387: Improve API docs naming consistency 2023-08-15 11:25:35 +03:00
suggestions.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
tickets.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00
transfer_limits.yaml Bug 33971: Remove x-koha-query header support 2023-07-03 10:35:06 -03:00