Skip to content

Loan creation by ISBN and customerId #12

Description

@NikosPoly

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions