YaleSTC / reservations

Manage equipment loans & reservations. Who can borrow what, for how long?
yalestc.github.io/reservations
MIT License
139 stars 58 forks source link

Renewals currently restricted by maximum checkout length #1734

Closed orenyk closed 5 years ago

orenyk commented 5 years ago

Feedback from BMEC:

We noticed today a problem with the renewal feature in Reservations. Most of our equipment is set to allow users to renew their equipment for one day if the equipment is available. This is working for users who have reserved equipment for a loan period shorter than the maximum. However, the renewal is no longer working properly for users who have borrowed equipment for the maximum allowed checkout time.

Example:

This person checked out a microphone for the maximum number of days allowed for this equipment. The renewal button is there and the item is available for tomorrow, but the reservation states that the user is eligible to renew the equipment until Monday, July 16, its current due date. They should be allowed to renew it until July 17. If I click renew on a reservation such as this, it “renews” and keeps the due date the same.

This person checked out a pair of Bose headphones for two days. The maximum checkout period for these is also 4 days. They’re currently due tomorrow, July 17, but you can see Reservations will allow a renewal of this item for an extra day to July 18, because it was not already checked out the maximum allowable length of time.

Possibly related to #1311?

orenyk commented 5 years ago

Verified the issue locally, looks like the renewal method isn't working. The reason is that the way we create renewals is by duplicating the reservation and checking to make sure that a reservation that starts the day after the current due date and lasts for the renewal duration is still valid. Since we now check for concurrent reservations violating the overall reservation length limit, this fails. Shouldn't be too hard to fix.