2025-12-20 23:06:05 +01:00
|
|
|
"""Meta endpoints for shared constants."""
|
2025-12-21 21:54:26 +01:00
|
|
|
|
2025-12-20 23:06:05 +01:00
|
|
|
from fastapi import APIRouter
|
|
|
|
|
|
2025-12-23 14:28:28 +01:00
|
|
|
from models import (
|
|
|
|
|
ROLE_ADMIN,
|
|
|
|
|
ROLE_REGULAR,
|
|
|
|
|
BitcoinTransferMethod,
|
|
|
|
|
InviteStatus,
|
|
|
|
|
Permission,
|
|
|
|
|
)
|
2025-12-20 23:06:05 +01:00
|
|
|
from schemas import ConstantsResponse
|
|
|
|
|
|
|
|
|
|
router = APIRouter(prefix="/api/meta", tags=["meta"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.get("/constants", response_model=ConstantsResponse)
|
|
|
|
|
async def get_constants() -> ConstantsResponse:
|
|
|
|
|
"""Get shared constants for frontend/backend synchronization."""
|
|
|
|
|
return ConstantsResponse(
|
2025-12-21 23:55:47 +01:00
|
|
|
permissions=list(Permission),
|
2025-12-20 23:06:05 +01:00
|
|
|
roles=[ROLE_ADMIN, ROLE_REGULAR],
|
2025-12-21 23:55:47 +01:00
|
|
|
invite_statuses=list(InviteStatus),
|
2025-12-23 14:28:28 +01:00
|
|
|
bitcoin_transfer_methods=list(BitcoinTransferMethod),
|
2025-12-20 23:06:05 +01:00
|
|
|
)
|