Release v0.4.0 - OOP Architecture Overhaul, Services & Repositories
Pre-release
Pre-release
馃攳 Feature Enhancements
- **OOP Architecture Overhaul: Refactored core entities (
Book,User,Purchase) to dataclasses inmodels.py. Introduced repository classes (BookRepository,UserRepository,PurchaseRepository) underbookstore_modules/db/to encapsulate database queries and connection handling. - **Dedicated Service Layer: Extracted domain operations into pure business services (
AuthService,CatalogService,PurchaseService,AdminService,SearchLogRepository) underbookstore_modules/services/free of console I/O side effects. - **Decoupled User Interface: Isolated all
input()andprint()calls into dedicated CLI presentation components (ConsoleApp,UserMenu,AdminMenu) underbookstore_modules/user_interface/.
馃敀 Security & Access Control
- **Restricted File Ingestion: Moved the bulk book import feature (
import_from_file) from the unauthenticated public menu toAdminService/AdminMenu, ensuring bulk database writes require administrative privileges.
鈿狅笍 Breaking Changes
- **Exception-Driven Business Logic: Replaced console
print()error statements inside business workflows with domain exceptions inheriting fromBookstoreError(UsernameTakenError,InsufficientStockError,BookNotFoundError, etc.). - **Refactored Entry Point: Updated
main.pyto instantiate repositories, services, andConsoleAppvia dependency injection instead of invoking top-level procedural functions.
Full Changelog: v0.3.1...v0.4.0