Skip to content

Feat endpoint loans#1

Merged
MANDRW merged 4 commits into
mainfrom
feat-endpoint-loans
May 28, 2026
Merged

Feat endpoint loans#1
MANDRW merged 4 commits into
mainfrom
feat-endpoint-loans

Conversation

@MANDRW

@MANDRW MANDRW commented May 28, 2026

Copy link
Copy Markdown
Owner

This pull request introduces major improvements to the backend of the library system, focusing on implementing and testing the book loan and return functionality. It adds a new router for handling loans, updates the database schema and initialization, improves logging and environment variable handling, and introduces comprehensive automated tests for the loans API. Additionally, it refactors some schema files and updates dependencies.

The most important changes are:

Loan API Implementation and Testing

  • Added a new router_loans FastAPI router with endpoints for creating loans and returning books, including logic for updating book status, calculating and accumulating fines, and blocking users with excessive fines.
  • Added comprehensive tests for the loans endpoints in test_loans.py, covering scenarios like on-time returns, overdue fines, user blocking, missing loans or book copies, and correct status updates.

These changes collectively provide a robust foundation for managing book loans, handling edge cases, and ensuring the API is well-tested and maintainable.

@MANDRW MANDRW requested a review from Copilot May 28, 2026 12:39
@MANDRW MANDRW self-assigned this May 28, 2026
@MANDRW MANDRW merged commit 63e7238 into main May 28, 2026
@MANDRW MANDRW deleted the feat-endpoint-loans branch May 28, 2026 12:40
@MANDRW MANDRW removed the request for review from Copilot May 28, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant