16 Commits

Author SHA1 Message Date
Dylan Knutson
a955acbdce add listing expiry checker task 2025-09-10 03:15:58 +00:00
Dylan Knutson
0d18016993 integration tests for confirm bid amount 2025-09-09 01:40:36 +00:00
Dylan Knutson
af5b8883af mocakble message sender trait 2025-09-05 21:48:52 +00:00
Dylan Knutson
9ad562a4b2 basic scaffold for placing bids 2025-09-03 00:28:46 +00:00
Dylan Knutson
f74c3502d6 basic listing stuff 2025-09-02 01:47:45 +00:00
Dylan Knutson
a39dd01452 Refactor bot commands and database models
- 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
2025-08-30 11:04:40 -07:00
Dylan Knutson
9ef36b760e feat: Add high-level integration testing framework
- 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.
2025-08-30 04:41:07 +00:00
Dylan Knutson
374abf8c42 major db refactors 2025-08-29 23:25:12 +00:00
Dylan Knutson
34de9b6d59 Major refactor: restructure new listing command and update data models
- 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
2025-08-29 10:21:39 -07:00
Dylan Knutson
71fe1e60c0 feat: Add comprehensive edit screen to new listing wizard
- 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
2025-08-28 06:58:55 +00:00
Dylan Knutson
8745583990 Add configuration and database setup
- Updated Cargo.toml with necessary dependencies
- Enhanced config.rs with database and application configuration
- Updated main.rs with improved bot initialization
- Added development database file
2025-08-28 01:28:31 +00:00
Dylan Knutson
af1f3271a3 chore: update rstest dependency from 0.21 to 0.26.1
- Update rstest version for better test parametrization support
- Update corresponding Cargo.lock
2025-08-28 01:19:41 +00:00
Dylan Knutson
5212175df5 refactor: organize type definitions into dedicated db/types/ directory
- 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
2025-08-28 01:17:45 +00:00
Dylan Knutson
32dca5f4de refactor: Convert MoneyAmount to INTEGER cents storage and modularize currency types
- 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
2025-08-27 23:19:13 +00:00
Dylan Knutson
30751181e4 add .env.example, user-stories.md 2025-08-27 19:12:40 +00:00
Dylan Knutson
caebe567df initial commit 2025-08-26 22:39:40 -04:00