Skip to content

Release v0.4.0 - OOP Architecture Overhaul, Services & Repositories

Pre-release
Pre-release

Choose a tag to compare

@devsmish devsmish released this 08 Sep 07:00
· 45 commits to main since this release
37eed74

馃攳 Feature Enhancements

  • **OOP Architecture Overhaul: Refactored core entities (Book, User, Purchase) to dataclasses in models.py. Introduced repository classes (BookRepository, UserRepository, PurchaseRepository) under bookstore_modules/db/ to encapsulate database queries and connection handling.
  • **Dedicated Service Layer: Extracted domain operations into pure business services (AuthService, CatalogService, PurchaseService, AdminService, SearchLogRepository) under bookstore_modules/services/ free of console I/O side effects.
  • **Decoupled User Interface: Isolated all input() and print() calls into dedicated CLI presentation components (ConsoleApp, UserMenu, AdminMenu) under bookstore_modules/user_interface/.

馃敀 Security & Access Control

  • **Restricted File Ingestion: Moved the bulk book import feature (import_from_file) from the unauthenticated public menu to AdminService / 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 from BookstoreError (UsernameTakenError, InsufficientStockError, BookNotFoundError, etc.).
  • **Refactored Entry Point: Updated main.py to instantiate repositories, services, and ConsoleApp via dependency injection instead of invoking top-level procedural functions.

Full Changelog: v0.3.1...v0.4.0