This commit is contained in:
Shubhankar45
2026-10-27 12:03:31 +00:00
parent 2ed3945b5d
commit 4e5e95775d
104 changed files with 5210 additions and 606 deletions
+11
View File
@@ -6,6 +6,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
from app.auth.dependencies import client_ip, get_current_user, require_role
from app.common.enums import Role
from app.database.session import get_db
from app.users import overview
from app.users.models import User
from app.users.schemas import MyProfile, UserCreate, UserRead, UserUpdate
from app.users.service import UserService
@@ -20,6 +21,16 @@ async def my_profile(
return await UserService(db).my_profile(current_user)
@router.get("/{user_id}/overview")
async def user_overview(
user_id: uuid.UUID,
current_user: User = Depends(require_role(Role.ADMIN, Role.GM)),
db: AsyncSession = Depends(get_db),
) -> dict:
"""The whole picture of one person, for the General Manager and Admin."""
return await overview.user_overview(db, current_user, user_id)
@router.get("", response_model=list[UserRead])
async def list_users(
role: Role | None = None,