Koha-clms/api/v1/swagger/definitions
Zeno Tajoli c60a6d8cd9
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>
2024-03-18 11:03:39 +01:00
..
account_line.yaml
…
advancededitormacro.yaml
…
allows_renewal.yaml
…
authorised_value.yaml
…
authorised_value_category.yaml
…
basket.yaml
…
booking.yaml Bug 36100: Remove readOnly from bookings definition. 2024-03-07 16:36:41 +01:00
bundle_link.yaml
…
cashup.yaml
…
checkout.yaml
…
checkout_availability.yaml
…
checkouts.yaml
…
circ-rule-kind.yaml
…
city.yaml
…
club_hold.yaml
…
club_hold_patron_hold.yaml
…
club_hold_patron_holds.yaml
…
club_holds.yaml
…
credit.yaml
…
debit.yaml
…
edifact_file.yaml Bug 30070: EDIFACT and ID are abbreviations 2024-01-17 11:38:59 +01:00
erm_agreement.yaml
…
erm_agreement_license.yaml
…
erm_agreement_period.yaml
…
erm_agreement_relationship.yaml
…
erm_config.yaml
…
erm_counter_file.yaml
…
erm_counter_log.yaml
…
erm_counter_registry.yaml
…
erm_custom_report.yaml
…
erm_default_usage_report.yaml
…
erm_document.yaml
…
erm_eholdings_package.yaml
…
erm_eholdings_package_agreement.yaml
…
erm_eholdings_resource.yaml
…
erm_eholdings_title.yaml
…
erm_license.yaml
…
erm_license_agreement.yaml
…
erm_sushi_service.yaml
…
erm_usage_data_provider.yaml
…
erm_usage_database.yaml
…
erm_usage_item.yaml
…
erm_usage_mus.yaml
…
erm_usage_platform.yaml
…
erm_usage_title.yaml
…
erm_usage_yus.yaml
…
erm_user_role.yaml
…
error.yaml
…
fund.yaml
…
hold.yaml
…
holds.yaml
…
identity_provider.yaml
…
identity_provider_domain.yaml
…
ill_backend.yaml
…
ill_backends.yaml
…
ill_batch.yaml
…
ill_batches.yaml
…
ill_batchstatus.yaml
…
ill_batchstatuses.yaml
…
ill_request.yaml
…
ill_status.yaml
…
import_batch_profile.yaml
…
import_batch_profiles.yaml
…
import_record_match.yaml
…
invoice.yaml
…
item.yaml
…
item_group.yaml
…
item_type.yaml
…
item_type_translated_description.yaml
…
job.yaml
…
library.yaml
…
merge_biblios.yaml Bug 33036: REST API: Merge biblio records implements merging of records 2024-03-18 11:03:39 +01:00
order.yaml
…
patron.yaml Bug 35744: Implement +strings for GET /patrons/:patron_id 2024-01-29 12:24:59 +01:00
patron_account_credit.yaml
…
patron_balance.yaml
…
patron_extended_attribute.yaml
…
preservation_config.yaml
…
preservation_processing.yaml
…
preservation_processing_attribute.yaml
…
preservation_train.yaml
…
preservation_train_item.yaml
…
quote.yaml
…
renewal.yaml
…
renewals.yaml
…
return_claim.yaml
…
search_filter.yaml
…
smtp_server.yaml
…
suggestion.yaml
…
ticket.yaml
…
ticket_update.yaml
…
transfer_limit.yaml
…
vendor.yaml
…
vendor_alias.yaml
…
vendor_issue.yaml
…