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
This commit is contained in:
@@ -19,3 +19,6 @@ log = "0.4"
|
||||
env_logger = "0.11.8"
|
||||
anyhow = "1.0"
|
||||
dotenvy = "0.15"
|
||||
|
||||
[dev-dependencies]
|
||||
rstest = "0.21"
|
||||
|
||||
Reference in New Issue
Block a user