Step 8: Cleanup old constants
- Remove EUR_TRADE_MIN, EUR_TRADE_MAX, PREMIUM_PERCENTAGE from shared_constants.py - Remove eurTradeMin, eurTradeMax, premiumPercentage from shared/constants.json - Update validate_constants.py to not require removed fields - Update seed.py and seed_e2e.py to use defaults if fields don't exist - Update tests to handle missing constants gracefully
This commit is contained in:
parent
41e158376c
commit
549fbf4975
6 changed files with 20 additions and 25 deletions
|
|
@ -88,10 +88,11 @@ async def seed_pricing_config(db: AsyncSession) -> None:
|
|||
with constants_path.open() as f:
|
||||
constants = json.load(f)
|
||||
|
||||
exchange_config = constants["exchange"]
|
||||
premium_percentage = exchange_config["premiumPercentage"]
|
||||
eur_trade_min = exchange_config["eurTradeMin"]
|
||||
eur_trade_max = exchange_config["eurTradeMax"]
|
||||
exchange_config = constants.get("exchange", {})
|
||||
# Use defaults if fields don't exist (for backward compatibility during migration)
|
||||
premium_percentage = exchange_config.get("premiumPercentage", 5)
|
||||
eur_trade_min = exchange_config.get("eurTradeMin", 100)
|
||||
eur_trade_max = exchange_config.get("eurTradeMax", 3000)
|
||||
|
||||
# Convert EUR amounts to cents
|
||||
eur_min_cents = eur_trade_min * 100
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue