From 05d4e59938a29601bad7e86f5eb74dad7888b96d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 26 Feb 2024 19:28:03 +0000 Subject: [PATCH] Bug 35906: (QA follow-up) Fix item-type schema --- Koha/Item.pm | 18 ------------------ api/v1/swagger/definitions/item_type.yaml | 3 +++ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 03e2d0794ad..b8189f425a3 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1812,24 +1812,6 @@ sub itemtype { return Koha::ItemTypes->find( $self->effective_itemtype ); } -=head3 item_type - - my $item_type = $item->item_type; - -Returns the effective I for the item. - -FIXME: it should either return the 'real item type' or undef if no item type -defined. And effective_itemtype should return... the effective itemtype. Right -now it returns an id... This is all inconsistent. And the API should make it clear -if the attribute is part of the resource, or a calculated value i.e. if the item -is not linked to an item type on its own, then the API response should contain -item_type: null! And the effective item type... be another attribute. I understand -that this complicates filtering, but some query trickery could do it in the controller. - -=cut - -sub item_type { - return shift->itemtype; =head3 effective_bookable my $bookable = $item->effective_bookable; diff --git a/api/v1/swagger/definitions/item_type.yaml b/api/v1/swagger/definitions/item_type.yaml index f451c2892ba..274c393b83d 100644 --- a/api/v1/swagger/definitions/item_type.yaml +++ b/api/v1/swagger/definitions/item_type.yaml @@ -13,6 +13,9 @@ properties: description: description: A plain text explanation of the item type type: string + bookable: + description: Boolean denoting whether this item type is normally bookable + type: boolean rentalcharge: description: The amount charged when this item is checked out/issued type: -- 2.30.2