|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Borrowing
[usecase] This use case comprises all library customer functionality for borrowing and returning books.
| Method Summary | |
|---|---|
int |
borrowBook(int bookOnStockId,
int customerId)
[command] Generates a new Loan object. |
void |
returnBook(int loanId)
[command] Marks a Loan as being returned. |
| Method Detail |
|---|
int borrowBook(int bookOnStockId,
int customerId)
Loan object.
bookOnStockId - [in] id of BookOnStock to be borrowedcustomerId - [in] id of Customer who borrows the book
Loan object
[pre exists Customer c: c.id == customerId
pre exists BookOnStock boS: boS.id == bookOnStockId
post exists new Loan l:
l.id == result
&& l.loanDate is current date
&& l.dueDate is current date plus 30 days
&& l.customer.id == customerId
&& l.bookOnStock.id == bookOnStockId
&& l.reminder == null
&& l.status == LoanStatus.BORROWED
]
void returnBook(int loanId)
Loan as being returned.
loanId - [in] id of Loan object
[pre exists Loan l (l.id == loanId)
pre l.status == LoanStatus.BORROWED
post l.status == LoanStatus.RETURNED
]
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||