Currently creating a loan requires MongoDB ObjectIds for both book and customer
which is not practical in a real library scenario.
Instead of:
{
"bookId": "6a2aa818dbf3dce5994ce296",
"customerId": "6a2ae775e7356a48f90074b6",
...
}
Should accept:
{
"isbn": "9781234567890",
"customerId": "CUST001",
...
}
Tasks
- Update LoanService.createLoan() to accept isbn and customerId as human readable identifiers
- Service resolves isbn to bookId via BookRepository.findByIsbn()
- Service resolves customerId to MongoDB ID via CustomerRepository.findByCustomerId()
- Store MongoDB IDs internally in the Loan document as before
Note
Depends on Issue 11 (findByIsbn) being implemented first.
Currently creating a loan requires MongoDB ObjectIds for both book and customer
which is not practical in a real library scenario.
Instead of:
{
"bookId": "6a2aa818dbf3dce5994ce296",
"customerId": "6a2ae775e7356a48f90074b6",
...
}
Should accept:
{
"isbn": "9781234567890",
"customerId": "CUST001",
...
}
Tasks
Note
Depends on Issue 11 (findByIsbn) being implemented first.