25 lines
687 B
Python
25 lines
687 B
Python
"""Meta endpoints for shared constants."""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from models import (
|
|
ROLE_ADMIN,
|
|
ROLE_REGULAR,
|
|
BitcoinTransferMethod,
|
|
InviteStatus,
|
|
Permission,
|
|
)
|
|
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(
|
|
permissions=list(Permission),
|
|
roles=[ROLE_ADMIN, ROLE_REGULAR],
|
|
invite_statuses=list(InviteStatus),
|
|
bitcoin_transfer_methods=list(BitcoinTransferMethod),
|
|
)
|