arbret/backend/models/enums.py
2025-12-26 20:04:46 +01:00

59 lines
1.5 KiB
Python

from enum import Enum as PyEnum
class Permission(str, PyEnum):
"""All available permissions in the system."""
# Audit permissions
VIEW_AUDIT = "view_audit"
FETCH_PRICE = "fetch_price"
# Profile permissions
MANAGE_OWN_PROFILE = "manage_own_profile"
# Invite permissions
MANAGE_INVITES = "manage_invites"
VIEW_OWN_INVITES = "view_own_invites"
# Exchange permissions (regular users)
CREATE_EXCHANGE = "create_exchange"
VIEW_OWN_EXCHANGES = "view_own_exchanges"
CANCEL_OWN_EXCHANGE = "cancel_own_exchange"
# Availability/Exchange permissions (admin)
MANAGE_AVAILABILITY = "manage_availability"
VIEW_ALL_EXCHANGES = "view_all_exchanges"
CANCEL_ANY_EXCHANGE = "cancel_any_exchange"
COMPLETE_EXCHANGE = "complete_exchange"
class InviteStatus(str, PyEnum):
"""Status of an invite."""
READY = "ready"
SPENT = "spent"
REVOKED = "revoked"
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
class BitcoinTransferMethod(str, PyEnum):
"""Bitcoin transfer method for exchange trades."""
ONCHAIN = "onchain"
LIGHTNING = "lightning"