View | Details | Raw Unified | Return to bug 35906
Collapse All | Expand All

(-)a/Koha/Item.pm (-18 lines)
Lines 1812-1835 sub itemtype { Link Here
1812
    return Koha::ItemTypes->find( $self->effective_itemtype );
1812
    return Koha::ItemTypes->find( $self->effective_itemtype );
1813
}
1813
}
1814
1814
1815
=head3 item_type
1816
1817
    my $item_type = $item->item_type;
1818
1819
Returns the effective I<Koha::ItemType> for the item.
1820
1821
FIXME: it should either return the 'real item type' or undef if no item type
1822
defined. And effective_itemtype should return... the effective itemtype. Right
1823
now it returns an id... This is all inconsistent. And the API should make it clear
1824
if the attribute is part of the resource, or a calculated value i.e. if the item
1825
is not linked to an item type on its own, then the API response should contain
1826
item_type: null! And the effective item type... be another attribute. I understand
1827
that this complicates filtering, but some query trickery could do it in the controller.
1828
1829
=cut
1830
1831
sub item_type {
1832
    return shift->itemtype;
1833
=head3 effective_bookable
1815
=head3 effective_bookable
1834
1816
1835
  my $bookable = $item->effective_bookable;
1817
  my $bookable = $item->effective_bookable;
(-)a/api/v1/swagger/definitions/item_type.yaml (-1 / +3 lines)
Lines 13-18 properties: Link Here
13
  description:
13
  description:
14
    description: A plain text explanation of the item type
14
    description: A plain text explanation of the item type
15
    type: string
15
    type: string
16
  bookable:
17
    description: Boolean denoting whether this item type is normally bookable
18
    type: boolean
16
  rentalcharge:
19
  rentalcharge:
17
    description: The amount charged when this item is checked out/issued
20
    description: The amount charged when this item is checked out/issued
18
    type:
21
    type:
19
- 

Return to bug 35906