Conversation
- Configure REST Framework with JWT authentication - Set up custom Authorize header for JWT tokens - Add Swagger/OpenAPI documentation with drf-spectacular - Configure Stripe and Telegram API settings - Set up Django-Q for async task processing - Add URL routing for all services - Configure custom User model authentication
- Add custom User model with email as username field - Implement UserManager for user/superuser creation - Add user registration endpoint (POST /api/users/register/) - Add JWT token endpoints (POST /api/users/token/ and /token/refresh/) - Add user profile management (GET/PATCH /api/users/me/) - Configure UserSerializer and UserDetailSerializer - Set up URL routing for users endpoints - Run initial migrations for User model
- Add Book model with title, author, cover, inventory, daily_fee - Implement BookSerializer for API representation - Add BookViewSet with proper permissions (admin-only write, public read) - Configure admin panel for book management - Add URL routing for books endpoints (GET/POST/PUT/PATCH/DELETE)
- Add Borrowing model with book, user, dates - Implement list/detail/create endpoints - Add filtering by is_active and user_id (admin only) - Non-admin users see only their own borrowings - Decrease book inventory on borrowing creation - Add return endpoint to mark book as returned - Increase inventory on return - Prevent returning same book twice
- Add Payment model with status, type, session data - Create Stripe checkout sessions for borrowings - Automatically create payment on borrowing creation - Implement success/cancel payment endpoints - Add fine payment creation for overdue returns - Calculate fees based on borrowing days and daily_fee - Non-admin users see only their own payments - Display payments in borrowing detail serializer
- Add telegram_helper with notification functions - Send notification on new borrowing creation - Send notification on successful payment - Add scheduled task for daily overdue borrowings check - Integrate notifications into borrowings and payments services
- Add telegram_helper with notification functions - Send notification on new borrowing creation - Send notification on successful payment - Add scheduled task for daily overdue borrowings check - Implement management command to set up scheduled tasks - Integrate notifications into borrowings and payments services - Add notifications app to INSTALLED_APPS
- Add tests for User registration, JWT authentication, profile management - Add tests for Book CRUD operations with permission checks - Add tests for Borrowing creation, filtering, returns, inventory updates - Add tests for Payment and Stripe integration - Mock external services (Stripe, Telegram) in tests - Ensure users see only their own data, admins see all - Test validation and error cases
- Fix Decimal multiplication in stripe_helper - Update tests to use Decimal for daily_fee instead of string - Mock reverse() and Stripe API in payment tests - All 13 tests passing successfully
- Add Dockerfile and docker-compose.yml with Postgres, Redis, web, and qcluster services - Update .env.sample for Docker and local development - Add STATIC_ROOT and PostgreSQL support in settings.py - Split requirements into requirements.txt (prod) and requirements-dev.txt (dev) - Remove duplicate and unnecessary dependencies from requirements.txt - Add psycopg2-binary and redis for Docker/Postgres/Redis support - Clean up flake8, black, pytest (move to requirements-dev.txt) - Add .dockerignore Project can now be started via: docker-compose up --build
- Change PostgreSQL port from 5432 to 5433 to avoid conflicts - Add setuptools==69.0.0 to requirements.txt for pkg_resources - Update docker-compose.yml with proper sleep delays for service startup - Add container_name for easier debugging - All services (db, redis, web, qcluster) now working correctly - Docker setup tested and fully functional
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR merges the
developbranch intomain, completing the Library Service project with full implementation of all required features.Changes
Testing
Deployment
Checklist
##Screenshots



