Bug 29002 - Add ability to book items ahead of time
Summary: Add ability to book items ahead of time
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL: https://gitlab.com/mrenvoize/Koha/-/c...
Keywords:
Depends on: 29422 29450 29133 29397
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-13 10:54 UTC by Martin Renvoize
Modified: 2022-03-14 08:18 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29002: Add bookings table to kohastructure (4.37 KB, patch)
2021-09-29 15:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29002: DBIC Schema Build (6.72 KB, patch)
2021-09-29 15:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29002: Add Booking objects and API classes (39.26 KB, patch)
2021-09-29 15:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29002: Add ability to book material (10.49 KB, patch)
2021-09-29 15:48 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2021-09-13 10:54:51 UTC
Normal loans allow a patron to pick an item and take it out immediately.

Reserves allow a patron to add themselves to a queue for the item should it already be checked out to someone.

We have a library that wishes to allow patrons to book items for a specific date and loan period and have the item guaranteed to be available to them for that period.

This bug intends to introduce that functionality, adding a bookable option to items and exposing a calendar with bookable loan slots.
Comment 1 Donna 2021-09-13 11:44:31 UTC
I think this is a great idea, and I have had other libraries ask about being able to do this.  It will be well received!
Comment 2 Martin Renvoize 2021-09-29 15:48:02 UTC
Created attachment 125456 [details] [review]
Bug 29002: Add bookings table to kohastructure
Comment 3 Martin Renvoize 2021-09-29 15:48:06 UTC
Created attachment 125457 [details] [review]
Bug 29002: DBIC Schema Build
Comment 4 Martin Renvoize 2021-09-29 15:48:10 UTC
Created attachment 125458 [details] [review]
Bug 29002: Add Booking objects and API classes
Comment 5 Martin Renvoize 2021-09-29 15:48:14 UTC
Created attachment 125459 [details] [review]
Bug 29002: Add ability to book material

This patch introduces a new modal to the biblio details page to allow
booking of materials.

Test plan
1) Navigate to the details page of a biblio
2) Note the new 'Place booking' button in the toolbar
3) Click the new button and note the new modal dialogue
4) Enter part of a patron name or cardnumber and then select from the
   presented results
5) Select a start date and end date from the calender
6) Submit
Comment 6 Martin Renvoize 2021-09-29 15:50:28 UTC
Lots more to do.. but the basics of creating a booking and being able to see the bookings for a biblio are now there..

Next steps...
1) Either add bookings to the 'Holds to pull' page or add a now 'Bookings to collect' page
2) Integrate booking fulfilment into circulation
Comment 7 Arthur Suzuki 2021-10-20 23:29:12 UTC
Hello,
Just stumbling on that bug, we at BibLibre have been using HoldTitle and HoldItems with needed_before_date and expiry_date parameters to hack this functionality in our frontend software (Bokeh).
Althought the demo is in french you could see some visuals showing how it looks.

https://wiki.bokeh-library-portal.org/index.php?title=R%C3%A9servation_calendaire_de_lots

I guess those parameters are also available not only from ILS-DI but also from staff interface.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23531

If the functionality is going to be implemented in Koha separately from the reserve module, then it might be nice to make it available through the API as well.
Comment 8 Martin Renvoize 2021-10-21 08:24:10 UTC
Current work is distinct from reserves.. although I see many parallels there I felt the 'Queue' nature of reserves vs the 'Booked dates' nature of bookings distinguished them.

As for API, the entire thing is designed from the ground up using modern best-practice.. as such, it will all exposed via the RESTful API's.. see the patches on the gitlab branch ;)

This is all very much a work in progress ;)
Comment 9 Arthur Suzuki 2021-10-26 22:38:25 UTC
(In reply to Martin Renvoize from comment #8)
> Current work is distinct from reserves.. although I see many parallels there
> I felt the 'Queue' nature of reserves vs the 'Booked dates' nature of
> bookings distinguished them.

Indeed, actually it seems even more relevant compared to the hack we made to bring this functionality to Bokeh!
Reserves means it can still be loaned on a conflicting period, or there can be conflicting reserves made from different users.
TLDR; I guess you made things in such a way that this situation cannot happen on your branch?
I admit i didn't go through all your commits... yet ;)

> As for API, the entire thing is designed from the ground up using modern
> best-practice.. as such, it will all exposed via the RESTful API's.. see the
> patches on the gitlab branch ;)

Seen that on https://gitlab.com/mrenvoize/Koha/-/commit/c2d3412d390b5a49cc2998ba9c8c25efd074d4fe

* thumbsup * Thanks for thinking API-wise :)

Also I didn't knew about that practice of linking to a git branch instead of uploading the commits... nice :) are we going to use more gitlab workflows like merge request? From my experience, code reviews are quite easy to read and process on gitlab!

> This is all very much a work in progress ;)

Nice work already! Wish you can make a demo for next hackfest, hopefully in March? :)
Comment 10 David Cook 2021-10-26 22:49:50 UTC
Interested to hear how this goes.

We've had calls for this at times, and I've personally worked in libraries where this would've been useful. We ended up using separate booking systems and it was a bit of a pain.
Comment 11 Fridolin Somers 2022-01-22 06:14:54 UTC
Please have a look at Bug 15261 looks similar
It would be great to share the code that gives same feature.
Comment 12 Katrin Fischer 2022-01-23 14:17:33 UTC
(In reply to Fridolin Somers from comment #11)
> Please have a look at Bug 15261 looks similar
> It would be great to share the code that gives same feature.

Bug 15261 tries to add this feature to the holds system with some global switches for the behavior, while this keeps it separate. I have to say I am in favor of keeping it separate as it won't be necessary to make it work/play nicely with all the hold related features we already have.
Comment 13 Marie 2022-03-14 08:18:08 UTC
I'm interested in this too. We're using a combination of several reports and a special Withdrawn status right now. 

I tried to test the patch using ByWaters sandbox but I didn't see the button "Place booking" on the biblio detail page. Don't know if I did the setup wrong or something else, I'm new to testing but happy to learn.