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:
Dylan Knutson
2025-08-27 23:19:13 +00:00
parent 348fa416e8
commit 32dca5f4de
13 changed files with 1966 additions and 27 deletions

View File

@@ -19,3 +19,6 @@ log = "0.4"
env_logger = "0.11.8"
anyhow = "1.0"
dotenvy = "0.15"
[dev-dependencies]
rstest = "0.21"