Phase 1.1: Add exchange configuration

- Add exchange constants to shared/constants.json:
  - eurTradeMin: 100, eurTradeMax: 3000, eurTradeIncrement: 20
  - premiumPercentage: 5
  - priceRefreshSeconds: 60, priceStalenessSeconds: 300
- Add exchangeStatuses and tradeDirections to shared constants
- Add ExchangeStatus and TradeDirection enums to models.py
- Update shared_constants.py to export new exchange constants
- Update validate_constants.py to validate new enums and fields
This commit is contained in:
counterweight 2025-12-22 18:16:35 +01:00
parent c89e0312fa
commit 30e5d0828e
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
4 changed files with 84 additions and 1 deletions

View file

@ -68,6 +68,23 @@ class AppointmentStatus(str, PyEnum):
CANCELLED_BY_ADMIN = "cancelled_by_admin"
class ExchangeStatus(str, PyEnum):
"""Status of an exchange trade."""
BOOKED = "booked"
COMPLETED = "completed"
CANCELLED_BY_USER = "cancelled_by_user"
CANCELLED_BY_ADMIN = "cancelled_by_admin"
NO_SHOW = "no_show"
class TradeDirection(str, PyEnum):
"""Direction of a trade from the user's perspective."""
BUY = "buy" # User buys BTC, gives EUR
SELL = "sell" # User sells BTC, gets EUR
# Role name constants
ROLE_ADMIN = "admin"
ROLE_REGULAR = "regular"