Skip to content

Feature/better menu#2

Merged
jsem-nerad merged 8 commits intomainfrom
feature/better-menu
Nov 11, 2025
Merged

Feature/better menu#2
jsem-nerad merged 8 commits intomainfrom
feature/better-menu

Conversation

@jsem-nerad
Copy link
Owner

kompletne prekopane fungovani menu. nyni samostatny objekt. nove jednodussi pouzivani a filtrace.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR completely refactors the menu functionality by extracting it into a standalone Menu class, introducing type-safe enums for meal and order types, and adding comprehensive error handling. The refactoring improves code organization, extensibility, and user experience with better filtering options and automatic validations.

Key changes:

  • Extracted menu functionality into a new Menu class that maintains a reference to the parent StravaCZ client
  • Added MealType and OrderType enums for type-safe meal categorization and order status tracking
  • Introduced specialized exceptions (InvalidMealTypeError, DuplicateMealError, InsufficientBalanceError) with automatic duplicate detection, meal type validation, and balance checking

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_strava_cz.py Comprehensive test suite added/updated for new Menu class features including filtering, ordering, error handling, and iteration support
src/strava_cz/main.py Complete refactoring with new Menu class, enums (MealType, OrderType), exception classes, and advanced error handling with rollback support
src/strava_cz/init.py Updated exports to include new Menu class, enums, and exception classes; version bumped to 0.2.0
pyproject.toml Version updated to 0.2.0 and repository URLs corrected to new GitHub location
notes/repo_rules.md Added guidelines for LLM usage in the project with emphasis on manual review
examples/example.py Comprehensive examples demonstrating new Menu API with filtering, error handling, and balance tracking
README.md Extensive documentation updates covering new Menu class API, enums, exceptions, filtering system, and migration notes
MIGRATION_GUIDE.md New detailed migration guide for users upgrading from 0.1.x to 0.2.0 with examples and architecture explanation
CHANGELOG.md Detailed changelog documenting all additions, changes, removals, and fixes in version 0.2.0
.flake8 Added flake8 configuration for code style enforcement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# These tests were made mostly by an LLM,
# but they have been reviewed by me.
# - - - - - - - - - - - - -
# Tyto testy byly vytvořeny převážně pomociLLM,
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spacing: 'pomociLLM' should be 'pomoci LLM' (missing space between 'pomoci' and 'LLM').

Suggested change
# Tyto testy byly vytvořeny převážně pomociLLM,
# Tyto testy byly vytvořeny převážně pomoci LLM,

Copilot uses AI. Check for mistakes.
if "konto" in response_data:
try:
self.strava.user.balance = float(response_data["konto"])
except (ValueError, TypeError):
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
@jsem-nerad jsem-nerad merged commit 708ddf9 into main Nov 11, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant