From 72d2b7e42b24ddb862d1886f8ad5799fd8a20fbd Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 19 Jul 2024 14:02:28 +0100 Subject: [PATCH] Bug 28924: (follow-up) Add new fields to categories api The patron categories API is failing due to the new fields added in this bug not being properly handled yet.. This fixes that. --- Koha/Patron/Category.pm | 53 ++++++++++--------- .../swagger/definitions/patron_category.yaml | 15 ++++++ 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/Koha/Patron/Category.pm b/Koha/Patron/Category.pm index 8a9a77a320..5d307a4daf 100644 --- a/Koha/Patron/Category.pm +++ b/Koha/Patron/Category.pm @@ -280,31 +280,34 @@ object on the API. sub to_api_mapping { return { - categorycode => 'patron_category_id', - description => 'name', - enrolmentperiod => 'enrolment_period', - enrolmentperioddate => 'enrolment_period_date', - password_expiry_days => 'password_expiry_days', - upperagelimit => 'upper_age_limit', - dateofbirthrequired => 'lower_age_limit', - finetype => undef, # Unused - bulk => undef, # Unused - enrolmentfee => 'enrolment_fee', - overduenoticerequired => 'overdue_notice_required', - issuelimit => undef, # Unused - reservefee => 'reserve_fee', - hidelostitems => 'hide_lost_items', - category_type => 'category_type', - BlockExpiredPatronOpacActions => 'block_expired_patron_opac_actions', - default_privacy => 'default_privacy', - checkprevcheckout => 'check_prev_checkout', - can_place_ill_in_opac => 'can_place_ill_in_opac', - can_be_guarantee => 'can_be_guarantee', - reset_password => 'reset_password', - change_password => 'change_password', - min_password_length => 'min_password_length', - require_strong_password => 'require_strong_password', - exclude_from_local_holds_priority => 'exclude_from_local_holds_priority' + categorycode => 'patron_category_id', + description => 'name', + enrolmentperiod => 'enrolment_period', + enrolmentperioddate => 'enrolment_period_date', + password_expiry_days => 'password_expiry_days', + upperagelimit => 'upper_age_limit', + dateofbirthrequired => 'lower_age_limit', + finetype => undef, # Unused + bulk => undef, # Unused + enrolmentfee => 'enrolment_fee', + overduenoticerequired => 'overdue_notice_required', + issuelimit => undef, # Unused + reservefee => 'reserve_fee', + hidelostitems => 'hide_lost_items', + category_type => 'category_type', + BlockExpiredPatronOpacActions => 'block_expired_patron_opac_actions', + default_privacy => 'default_privacy', + checkprevcheckout => 'check_prev_checkout', + can_place_ill_in_opac => 'can_place_ill_in_opac', + can_be_guarantee => 'can_be_guarantee', + reset_password => 'reset_password', + change_password => 'change_password', + min_password_length => 'min_password_length', + require_strong_password => 'require_strong_password', + exclude_from_local_holds_priority => 'exclude_from_local_holds_priority', + noissuescharge => 'no_issues_charge', + noissueschargeguarantees => 'no_issues_charge_guarantees', + noissueschargeguarantorswithguarantees => 'no_issues_charge_guarantors_with_guarantees' }; } diff --git a/api/v1/swagger/definitions/patron_category.yaml b/api/v1/swagger/definitions/patron_category.yaml index ec3c87aa9c..c0cea1b676 100644 --- a/api/v1/swagger/definitions/patron_category.yaml +++ b/api/v1/swagger/definitions/patron_category.yaml @@ -100,6 +100,21 @@ properties: - boolean - "null" description: Exclude patrons of this category from local holds priority + no_issues_charge: + type: + - number + - "null" + description: Set threshold of debt allowed before issues are blocked + no_issues_charge_guarantees: + type: + - number + - "null" + description: Set threshold of debt allowed, inclusive of guarantees debts, before issues are blocked + no_issues_charge_guarantors_with_guarantees: + type: + - number + - "null" + description: Set threshold of debt allowed, inclused of relations debts, before issues are blocked additionalProperties: false required: - patron_category_id