improve loan status: reservation | active | overdue | completed #41
Labels
2prio Medium
Do when there are no prio1 issues.
functionality
New feature or request
object loans
Issues related to loans.
Currently, 'status' is just a BOOL in LOANS that tells that a given loan is active (not returned yet).
Need to change this:
Tool itself needs a (redundant?) status [AVAILABLE | LOANED] to indicate whether it's free to loan.
If the tool status is AVAILABLE then show the LOAN button.
If the tool status is LOANED then show the RESERVE button (waiting list). Perhaps give an indication like MAX(agreedend)?
Action LOAN sets the tool status to LOANED, then creates an entry in table LOANS.
Action RESERVE creates an entry in table LOANS (#TODO later: the owner should be notified).
Action RETURN ends the current loan, then checks for any reservations and picks the one with MIN(agreedstart), then sets that loan to status ACTIVE (#TODO later: the new lender should be notified). If no next loan then set tool status to AVAILABLE.
The text was updated successfully, but these errors were encountered: