[Koha-bugs] [Bug 17712] Move availability calculation to the Koha namespace

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 26 14:28:44 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17712

Lari Taskula <lari.taskula at jns.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #60148|0                           |1
        is obsolete|                            |

--- Comment #34 from Lari Taskula <lari.taskula at jns.fi> ---
Created attachment 62720
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62720&action=edit
Bug 17712: Koha::Availability, a base for availability information

This patch adds a new class, Koha::Availability, which is designed to contain
availability information for each type of availability in an uniform way.
Because
of this, Koha::Availability has no actual availability calculation logic, but
simply methods to get and set availability information into the object.

With such design, we can next create new classes Koha::Availability::Hold and
Koha::Availability::Checkout and let them inherit Koha::Availability so that
they
are able to handle availaibility information in an uniform way.

       Koha::Availability::Hold          Koha::Availability::Checkout
                  |                                   |
                   \_________________________________/
                                   |
                          Koha::Availability

Koha::Availability can represent four levels of availability statuses:
1. available
2. available, with an additional note
3. available, but requires confirmation
4. unavailable

Additional notes, reasons for a need to confirm and reasons for
unavailabilities
are kept in a HASHref, where each value in my proposal is a
Koha::Exceptions::*.
This allows us to easily store any additional data directly into the reason.
For
example, if we want to check biblio availability for hold and find out it is
not
available, the HASHref for unavailabilities has a
Koha::Exceptions::Patron::Debt
that contains parameters "current_outstanding" and "max_outstanding" which lets
us pick up the information easily later on without making new queries.

To test:
1. Run t/Koha/Availability.t

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list