User CRUD Controllers¶
User Account CRUD Endpoints.
Defines all user account CRUD operations, requiring superuser privileges.
- async create_user(_: app.domain.users.schemas.UserAuth, data: UserCreate) MsgSpecJSONResponse[source]¶
Create a new user in the system.
- Returns:
The newly created user data.
- Return type:
- Raises:
ConflictException – If a user with the provided email already exists.
- async get_user(_: app.domain.users.schemas.UserAuth, user_id: UUID) MsgSpecJSONResponse[source]¶
Retrieve a user by ID.
- Returns:
The detailed user data.
- Return type:
- Raises:
UserNotFound – If the user with the given ID is not found.
- async get_list_users(_: app.domain.users.schemas.UserAuth) MsgSpecJSONResponse[source]¶
Retrieve a list of users.
- Returns:
Paginated list of users data.
- Return type:
OffsetPagination[User]
- async update_user(super_user: app.domain.users.schemas.UserAuth, data: UserUpdate, user_id: UUID) MsgSpecJSONResponse[source]¶
Update user details by ID.
This action also invalidates the user’s authentication cache in Redis.
- Returns:
The updated user data.
- Return type:
- Raises:
UserNotFound – If the user is not found.
ConflictException – If the new email provided is already in use by another user.
- async delete_user(super_user: app.domain.users.schemas.UserAuth, user_id: UUID) Response[source]¶
Delete a user from the system.
This action also invalidates the user’s authentication cache in Redis.
- Returns:
HTTP 204 No Content on successful deletion.
- Return type:
Response
- Raises:
UserNotFound – If the user is not found.