arbret/backend/shared_constants.py

22 lines
945 B
Python
Raw Normal View History

"""Load shared constants from shared/constants.json."""
import json
from pathlib import Path
_constants_path = Path(__file__).parent.parent / "shared" / "constants.json"
_constants = json.loads(_constants_path.read_text())
# Booking constants
SLOT_DURATION_MINUTES: int = _constants["booking"]["slotDurationMinutes"]
MIN_ADVANCE_DAYS: int = _constants["booking"]["minAdvanceDays"]
MAX_ADVANCE_DAYS: int = _constants["booking"]["maxAdvanceDays"]
NOTE_MAX_LENGTH: int = _constants["booking"]["noteMaxLength"]
# Exchange constants
EUR_TRADE_MIN: int = _constants["exchange"]["eurTradeMin"]
EUR_TRADE_MAX: int = _constants["exchange"]["eurTradeMax"]
EUR_TRADE_INCREMENT: int = _constants["exchange"]["eurTradeIncrement"]
PREMIUM_PERCENTAGE: int = _constants["exchange"]["premiumPercentage"]
PRICE_REFRESH_SECONDS: int = _constants["exchange"]["priceRefreshSeconds"]
PRICE_STALENESS_SECONDS: int = _constants["exchange"]["priceStalenessSeconds"]