https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17712
--- Comment #7 from Lari Taskula <lari.task...@jns.fi> --- Created attachment 58447 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58447&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. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/