From b3b58d406ee7857a973e4f07f9732bf94f70452a Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 20 Jan 2020 11:08:23 -0300 Subject: [PATCH] Bug 24461: Add to_api_mapping to Koha::Acquisition::BasketGroup This patch adds to_api_mapping to the Koha::Acquistion::BasketGroup class. To test: 1. Compare the mapping with the one on the RFC => SUCCESS: They match 2. Sigh off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- Koha/Acquisition/BasketGroup.pm | 18 +++++++++++++++++- Koha/Schema/Result/Aqbasketgroup.pm | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Koha/Acquisition/BasketGroup.pm b/Koha/Acquisition/BasketGroup.pm index 69a8738a67..74af77720d 100644 --- a/Koha/Acquisition/BasketGroup.pm +++ b/Koha/Acquisition/BasketGroup.pm @@ -27,10 +27,26 @@ Koha::Acquisition::BasketGroup - Koha Basket group Object class =head1 API -=head2 Class Methods +=head2 Class methods + +=head3 to_api_mapping + +This method returns the mapping for representing a Koha::Acquisition::BasketGroup object +on the API. =cut +sub to_api_mapping { + return { + id => 'basket_group_id', + booksellerid => 'vendor_id', + deliveryplace => 'delivery_library_id', + freedeliveryplace => 'delivery_place', + deliverycomment => 'delivery_note', + billingplace => 'invoice_library_id', + }; +} + =head2 Internal methods =head3 _type diff --git a/Koha/Schema/Result/Aqbasketgroup.pm b/Koha/Schema/Result/Aqbasketgroup.pm index da3a3997c2..2511c2df1a 100644 --- a/Koha/Schema/Result/Aqbasketgroup.pm +++ b/Koha/Schema/Result/Aqbasketgroup.pm @@ -138,6 +138,9 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9cEWAMwcFKPYPEG1CaaD3w +__PACKAGE__->add_columns( + '+closed' => { is_boolean => 1 } +); sub koha_object_class { 'Koha::Acquisition::BasketGroup'; -- 2.39.5