Bug 24366: Merge biblioitem in Koha::Biblio->to_api
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 7 Jan 2020 17:41:50 +0000 (14:41 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 14 Jan 2020 14:12:46 +0000 (14:12 +0000)
commit52d3b5439ddf5efd374749548a523a4a8e7ccd8a
treea7da621dc0cda69c0f53994f11c6dcbb6ce98cca
parent0d634ca43057f679009294bb11931f831914fff9
Bug 24366: Merge biblioitem in Koha::Biblio->to_api

This patch moves the bilbioitem object merge into the
Koha::Biblio->to_api method, as opposed to doing it in the controller.
This is an inevitable change as other endpoints might require to embed
biblio objects, and they need to carry the biblioitem information.

Also, if we merge the tables, the transition will be straightforward
(remove the tests this patch introduces, and merge the mappings from
Koha::Biblioitem into Koha::Biblio).

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t \
           t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass! i.e. the new to_api method is tested, and the
API tests don't expect any behavior change.
3. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Biblio.pm
Koha/Biblioitem.pm
Koha/REST/V1/Biblios.pm