arbret/backend/shared_constants.py
counterweight fa07490b7b
Fix: Update permission names, models and constants
Permission renames:
- BOOK_APPOINTMENT -> CREATE_EXCHANGE
- VIEW_OWN_APPOINTMENTS -> VIEW_OWN_EXCHANGES
- CANCEL_OWN_APPOINTMENT -> CANCEL_OWN_EXCHANGE
- VIEW_ALL_APPOINTMENTS -> VIEW_ALL_EXCHANGES
- CANCEL_ANY_APPOINTMENT -> CANCEL_ANY_EXCHANGE
- Add COMPLETE_EXCHANGE permission

Model changes:
- Delete AppointmentStatus enum
- Delete Appointment model

Schema changes:
- Delete BookingRequest (was for old booking)
- Delete AppointmentResponse, PaginatedAppointments
- Delete BookableSlot, AvailableSlotsResponse (unused)

Constants changes:
- Remove appointmentStatuses from shared/constants.json
- Merge booking constants into exchange section
- Update shared_constants.py and validate_constants.py
2025-12-22 20:28:21 +01:00

18 lines
865 B
Python

"""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())
# Exchange constants
SLOT_DURATION_MINUTES: int = _constants["exchange"]["slotDurationMinutes"]
MIN_ADVANCE_DAYS: int = _constants["exchange"]["minAdvanceDays"]
MAX_ADVANCE_DAYS: int = _constants["exchange"]["maxAdvanceDays"]
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"]