- Update my_listings command structure and keyboard handling
- Enhance new_listing workflow with improved callbacks and handlers
- Refactor database user model and keyboard utilities
- Add new handler utilities module
- Update main bot configuration and start command
- Created trait abstractions for dependency injection with mockall support
- Added comprehensive integration tests focusing on:
* Database operations and persistence
* Complete user workflow scenarios
* Dialogue state transitions and validation
* Multi-user scenarios and data integrity
- Removed trivial unit tests, kept only meaningful business logic tests
- Added UserRepository, ListingRepository, and BotMessenger traits
- Integration tests verify end-to-end workflows with real database
- Total: 30 focused tests (4 unit + 8 integration + 18 validation tests)
Key integration test scenarios:
- Complete listing creation workflow with database persistence
- Listing update workflows with state validation
- Multi-user independent operations
- Error handling that preserves data integrity
- Business rule enforcement (e.g., no timing changes on live listings)
Framework ready for advanced mock-based testing when needed.
- Refactor new_listing from single file to modular structure
- Add handler factory pattern for state management
- Improve keyboard utilities and validations
- Update database models for bid, listing, and user systems
- Add new types: listing_duration, user_row_id
- Remove deprecated user_id type
- Update Docker configuration
- Enhance test utilities and message handling
- Replace individual state structs with unified ListingDraft struct
- Add EditingListing state with field selection interface
- Implement individual field editing states (Title, Description, Price, Slots, StartTime, Duration)
- Add field-specific keyboards with Back buttons and Clear functionality for description
- Update all handlers to use ListingDraft instead of separate state structs
- Rename Confirming to ViewingDraft for clarity
- Add proper validation and error handling for all field edits
- Enable seamless navigation between edit screen and confirmation
- Maintain all existing functionality while adding edit capabilities
- Move type files to src/db/types/: currency_type, listing_id, user_id, money_amount, telegram_user_id
- Create types/mod.rs with proper re-exports for all type modules
- Update db/mod.rs to import from new types module instead of individual files
- All tests pass - no functionality changes
- Improves code organization by clearly separating types, DAOs, and models
- Refactor MoneyAmount to store as INTEGER cents instead of TEXT decimals
- Move CurrencyType to separate currency_type.rs module
- Rename money.rs to money_amount.rs for clarity
- Update database schema to use INTEGER for all monetary columns
- Remove complex CAST AS REAL workarounds from database queries
- Add comprehensive test coverage for cent-based arithmetic and storage
- Enable STRICT mode and foreign key constraints in SQLite
- Add rstest dependency for parameterized testing
Benefits:
- Faster INTEGER-based comparisons vs TEXT casting
- Exact financial precision without floating-point errors
- Simpler, cleaner SQL queries
- Better performance for auction bid operations