add .env.example, user-stories.md

This commit is contained in:
Dylan Knutson
2025-08-27 19:12:40 +00:00
parent 947092ce54
commit 30751181e4
24 changed files with 4191 additions and 4 deletions

View File

@@ -0,0 +1,64 @@
## Types of listings:
- Fixed price
- Basic auction
- Multi-slot auction
- Blind auction
## User stories for listing types:
### Fixed price
- As a seller,
- I can specify a fixed price.
- I can set a number of items / slots available for sale.
- I can edit the number of items / slots available for sale.
### Basic auction
- As a seller,
- I can create a basic auction with a starting price.
- I can specify the minimum price increment.
### Multi-slot auction
- As a seller,
- I can specify separate slots for an auction.
- I can specify separate starting prices on each slot.
- As a buyer,
- I can submit a bid contingent on mutliple slots
### Blind auction
- As a seller,
- I can specify a starting price.
- I can see submitted bids so far.
- I can end the auction early when I have a bid I am happy with.
- As a buyer,
- I can submit a bid with a price and a description.
- I can resubmit my bid with a higher price or revised description.
## User stories for all listing types:
- As a seller,
- I can create different listing types via the Pawctionerr telegram bot.
- I can specify photos and videos to be shown on the listing post.
- I can edit listings by adding and removing new photos and videos.
- I can edit listings by supplying a new description text.
- I can mark a won / purchased listing as paid for.
- I can view won / purchased listings by status (paid for, pending).
## User stories for auctions:
- As a seller,
- I can specify a starting date and time (or now).
- I can specify a duration.
- I can register for notifications when a bid is submitted.
- I can see a list of bids submitted so far.
- I can void bids.
- As a buyer,
- I can see the current high bid.
- I cannot see the name of the high bidder unless it is me.
- I can clearly see if I am the highest bidder.
- I can request my bid be voided.
## User stories for non-blind auctions:
- As a seller,
- I can specify an auto-buy price.
- I can specify an anti-sniping period.
- As a buyer,
- I can register for a notification when an artist starts a new auction.
- I can register for a notification when I am outbid.
- I can register for a notification when an auction ends.

View File

@@ -0,0 +1,21 @@
---
id: task-001
title: Set up database connection and SQLx integration
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Integrate SQLx with the existing configuration system to establish database connections. This includes setting up connection pooling and integrating with the Config struct.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Database connection pool is created using Config.database_url
- [ ] #2 Connection health check function is implemented
- [ ] #3 Database connection is properly integrated with main.rs
- [ ] #4 Error handling for database connection failures is implemented
<!-- AC:END -->

View File

@@ -0,0 +1,21 @@
---
id: task-002
title: Create database migration system
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Set up SQLx migrations infrastructure to manage database schema versions. Create the migrations directory structure and initial migration files.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 migrations/ directory is created with proper structure
- [ ] #2 001_initial_schema.sql migration file contains complete schema
- [ ] #3 Migration runner is integrated with application startup
- [ ] #4 Database schema matches the design specified in README.md
<!-- AC:END -->

View File

@@ -0,0 +1,24 @@
---
id: task-003
title: Create core database models and structs
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Define Rust structs and enums that represent the database schema entities. This includes User, Auction, Bid, ProxyBid, AuctionMedia, and UserSettings models with proper SQLx derive macros.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 User struct with all fields from users table is defined
- [ ] #2 Auction struct with AuctionType enum is defined
- [ ] #3 Bid and ProxyBid structs are defined with proper relationships
- [ ] #4 AuctionMedia and UserSettings structs are defined
- [ ] #5 All models have proper SQLx derive macros (FromRow, Type, etc.)
- [ ] #6 Rust Decimal is used for monetary fields
- [ ] #7 Chrono DateTime is used for timestamp fields
<!-- AC:END -->

View File

@@ -0,0 +1,22 @@
---
id: task-004
title: Implement user management database operations
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Create database operations for user registration, lookup, and management. This includes automatic user registration on first bot interaction and user preference management.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 User registration function creates new users from Telegram data
- [ ] #2 User lookup by telegram_id function is implemented
- [ ] #3 User settings creation with default values is implemented
- [ ] #4 User ban/unban functionality is implemented
- [ ] #5 User profile update functionality is implemented
<!-- AC:END -->

View File

@@ -0,0 +1,23 @@
---
id: task-005
title: Implement auction database operations
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Create database operations for auction management including creation, retrieval, updates, and media handling. Support all four auction types: standard, multi-slot, fixed-price, and blind auctions.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Auction creation function supports all four auction types
- [ ] #2 Auction retrieval by ID and by seller functions are implemented
- [ ] #3 Auction update functions (status, end time, etc.) are implemented
- [ ] #4 Active auctions listing with pagination is implemented
- [ ] #5 Auction media attachment functions are implemented
- [ ] #6 Auction search and filtering functionality is implemented
<!-- AC:END -->

View File

@@ -0,0 +1,24 @@
---
id: task-006
title: Implement bidding system database operations
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Create database operations for the bidding system including manual bids, proxy bids, and bid history tracking. This is critical for the auction functionality.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Manual bid placement function with validation is implemented
- [ ] #2 Proxy bid creation and management functions are implemented
- [ ] #3 Bid history retrieval functions are implemented
- [ ] #4 Winning bid calculation functions are implemented
- [ ] #5 Multi-slot auction winner selection is implemented
- [ ] #6 Bid cancellation functionality is implemented
- [ ] #7 Anti-snipe time extension logic is implemented
<!-- AC:END -->

View File

@@ -0,0 +1,24 @@
---
id: task-007
title: Create database integration tests
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Build comprehensive test suite for all database operations to ensure data integrity and proper functionality. Include edge cases and error scenarios.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 User management tests cover registration and lookup scenarios
- [ ] #2 Auction operation tests cover all auction types
- [ ] #3 Bidding system tests cover manual and proxy bids
- [ ] #4 Multi-slot auction tests verify winner selection logic
- [ ] #5 Database constraint tests verify foreign key relationships
- [ ] #6 Error handling tests for invalid data scenarios
- [ ] #7 Performance tests for database operations under load
<!-- AC:END -->

View File

@@ -0,0 +1,23 @@
---
id: task-008
title: Integrate database with bot commands
status: To Do
assignee: []
created_date: '2025-08-27 18:31'
labels: []
dependencies: []
---
## Description
Connect the database operations with the existing bot command handlers to enable real functionality. Replace stub implementations with actual database-backed operations.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Start command registers new users automatically
- [ ] #2 Settings command integrates with user_settings table
- [ ] #3 MyAuctions command displays user's actual auctions
- [ ] #4 MyBids command shows user's actual bid history
- [ ] #5 Error handling for database operations in commands
- [ ] #6 User context is properly passed to database operations
<!-- AC:END -->

View File

@@ -0,0 +1,24 @@
---
id: task-009
title: Create database module structure
status: To Do
assignee: []
created_date: '2025-08-27 18:32'
labels: []
dependencies: []
---
## Description
Organize database-related code into a proper module structure with separation of concerns. Create db module with sub-modules for different entity operations.
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 src/db/mod.rs module is created with proper exports
- [ ] #2 src/db/models.rs contains all database model definitions
- [ ] #3 src/db/users.rs contains user-related database operations
- [ ] #4 src/db/auctions.rs contains auction-related database operations
- [ ] #5 src/db/bids.rs contains bidding-related database operations
- [ ] #6 src/db/connection.rs handles database connection management
- [ ] #7 Database module is integrated with main.rs and config system
<!-- AC:END -->